PDA

View Full Version : Alarms vs Notifications vs Call



Dennis Rockwell
07-16-2015, 11:55 AM
I don't think that this is a BP bug, but it's something that I'd like to mess with, and I don't know where to start.

I have a Samsung S4 Mini, unrooted stock 4.4.2 Android, latest BP beta.

My issue is that alarms (I use Alarm Clock Plus (https://play.google.com/store/apps/details?id=com.vp.alarmClockPlusDock&hl=en)) and power plug in notifications silence or override BP's audio, but don't cause BP to pause.

An ongoing phone call isn't interrupted this way.

BP correctly pauses and resumes when I receive or make a phone call, and I would like BP to similarly pause for alarms and such.

I cannot find any setting to enable or disable the plug-in bleep (I certainly don't need it), or in Alarm Clock Plus to manage the notification in some other way.

Is there something I can do about this? Some setting or app I can install?

juwlz
07-16-2015, 01:10 PM
I'm assuming you've got BP set to Pause on Notification? (Player Settings | Automatic Pause and Resume | Pause on Notification)

That should work for anything that Android treats as a notification.

Julie

Dennis Rockwell
07-16-2015, 01:30 PM
Yeah, that's been set for a while. That's part of what's interesting, I think that the plug-in bleep isn't a notification, as it doesn't put something in with the notifications; any idea what that sort of alert is called?

appel
07-16-2015, 03:04 PM
It doesn't really have to do with notifications. It all depends on if the app playing a sound requests audio focus or not and what type of audio focus it requests. I'm guessing the alarm app doesn't request a transient audio focus which it probably should.

Dennis Rockwell
07-16-2015, 03:12 PM
Thanks for the 'transient' keyword! I suspect you're right, and I'll request that the author make that change.

However, shouldn't BP still get the onAudioFocusChange and behave accordingly? This might be a BP issue after all!

As always, I'll be happy to install a test version of BP to test any changes. Of course, this can easily be tested, the alarm clock is free.

StefanK
07-17-2015, 08:01 AM
BeyondPod does handle onAudioFocusChange - both permanent and transient (if it is being requested by other apps) - this is how it pauses for phone calls, notifications etc. Unfortunately, onAudioFocus change is being sent only if some other app explicitly requests audio focus. My guess is that BeyondPod does not get onAudioFocus change events for some reason in those cases.

I tried Alarm Clock Plus on my device (Nexus 5) but for some reason no alarms sound is being played (I get notification that alarm is going on and can be "snoozed", but can't hear the alarm).

We do log all AudioFocus events and how BeyondPod responds to them in Logcat (In BeyondPod - Settings >Menu > View Logs > View Android Log), so you can take a look if anything unusual is happening when alarms or plug-in sounds play.

Dennis Rockwell
07-17-2015, 09:25 AM
Ah, there you go. Yes, BP does see the event. I can't apparently email the log, my issue, not yours.

Oh, I see. For the plugin bleep, it gets AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK, BP says it's ducking, then it says it's pausing. I've attached the relevant parts of the log.

For the alarm, I see no log entry showing that BP sees any indication at all. Does that imply that the alarm app just plays the sound, without doing the more polite focus requesting?

I suppose that I can help the plugin bleep by setting a rewind, but BP pauses and resumes absolutely correctly for a phone call.

*sigh*

Do other phones bleep when plugged in? My Nexus 7 tablet doesn't.

juwlz
07-17-2015, 09:28 AM
Plugged into what?

Dennis Rockwell
07-17-2015, 09:44 AM
Sorry, my phone bleeps when I plug in the USB charging cord.

juwlz
07-17-2015, 11:05 AM
Ah that. Yes, my Xperia Z3c warbles when I either plug in USB charger or sit it on a magnetic charging dock. I've never found a way to switch if off, but it's a pleasant enough warble that it doesn't bother me much, and doesn't have any impact on anything else (I never plug in power when I'm in the middle of playing something).

For the record, it DOESN'T warble when I plug in something via USB OTG.

Julie

StefanK
07-22-2015, 05:55 PM
Yes, If you don't see the audio focus "dance" (interaction) for the alarm, then the alarm is not requesting audio focus. Audio focus logic was introduced a few Android versions ago so it is possible that the app was just not updated.

Somewhat puzzling is the "plug-in" beep - according to the log BP is pausing and resuming as it should. My only guess is that because pause/resume happen so quickly after each other (within a second according to the log timestamps), there are may be some latency while various audio buffers get flushed that keep the sound on for a little longer after pause has occurred.

Dennis Rockwell
07-23-2015, 09:27 AM
Yeah, that's what puzzles me the most. BP pauses and resumes seamlessly for phone calls, but not for this little bleep.

*sigh*