Audio focus lost when resuming after call

This could be a idea. I have never had problems before for years. And now for some months I am using Android Auto.

I have another point related to this topic. Most of the articles here are talking about ā€œlosing the focusā€ related to another player.

But I am losing the focus without the interception of another player. What I mean is not another player pops up and takes over sound control but nothing happens. Non of my players react on the button press on my BT headset. And this happens in the scenario described by [signaleleven] on March 20 above. You presss Pause, talk some words to another person and bangā€¦ you canā€™t restart AntennaPod within seconds.

1 Like

Iā€™m having this issue without using Android Auto, so itā€™s not limited to that case.

I just installed LineageOS 18.1 on an old Samsung Galaxy S5 with AntennaPod and AudioAnchor. Iā€™m going to see if I can recreate the behavior reliably with open source applications per cosā€™s comment above.

In the mean time, I had this behavior with LOS 18.1 and Sony + F-Droid-V 2.5.2, too. Thereā€™s an app ā€œandroid autoā€ present, but not actively in use. But as stated elsewhere: itā€™s hard to tell if this is a feature (Automatic small rewind when starting back - #13 by MCBuhl)

I just have to repeat what I wrote 21d ago: I have the situation that I pause my podcast (e. g. to talk to someone) and AntennaPod wonā€™t start playback after that. And no other player starts!

Noone will tell me this is ā€œworks as intendedā€, wonā€™t you?

I tried a lot of different things this weeks. I kept the focus on AntennaPod as ā€˜foreground appā€™. I chose all of AntennePods Screens. I always killed all other audio apps (probably thats why no other app intercepted anymore). Nothing helped. This is also reproducable with BT Speakers which have a play/pause button and obviously act like a headset.

I still hope that sometime someone will look at this and find a solution.

(My frustration is big enough that I uninstalled AntennaPod and use another Podcatcher in the meantime.)

Some more datapoints:

  • on a recent car trip, I used the split screen functionality to keep AntennaPod on the screen together with the navigation app. The problem was NOT present. (when a traffic announcement is detected on the radio, my car pauses whatever playback is running, including bluetooth sources, and then goes back to it. Itā€™s functionally the same as hitting pause on a bluetooth speaker and starting it again after some variable, short, time). So on a long drive I have several automatic test runs of this issue. But the problem can be even triggered by pauses due to turn-by-turn instructions).
    As soon as I put Maps fullscreen, the problem presented itself after the first interruption.

  • whether ā€œanother app startsā€ or ā€œnothing startsā€ when recovering depends indeed if there are other applications running. This should address the question whether this is due to another appā€™s behavior. It is reproducible with Antennapod being the only application.

Iā€™m not an Android developer and Iā€™m not sure if I can find the relevant part of the code. When ā€œdoing it rightā€ is mentioned, is this due to some Android dev guideline? If this is damaging the user experience, and the guideline is ignored by pretty much everybody else, can AntennaPod follow suite?

I really wish I could help more with this issue.

And the help could come byā€¦ looking at logcat, for instance.

not knowing any better, I started logcat and grepping case-insensitive for antennapod

A few seconds after pausing playback, the following message appeared.

06-01 13:04:04.949  1596  3603 I ActivityManager: Process de.danoeh.antennapod (pid 20313) has died: svcb SVC 

06-01 13:04:04.953  1596  3603 W ActivityManagerServiceInjector: AMS will block de.danoeh.antennapod(de.danoeh.antennapod) autostart due to process is killed by lmk in low memory

Attempts to restart it (twice) from the headphones control lead to nothing playing, but these two messages.

06-01 13:04:05.490 12013 12569 E music   : MediaInfo{currVol=22, maxVol=30, artist='Nosaj Thing - Aquarium', album='Digitalis', title='Digitalis', duration=-1, pos=0, state=1, mediaPlayerName='AntennaPod', playerHasGone=0, stateChangeTimeMs=1654081428602, speed=0.0}

06-01 13:04:11.140 12013 12569 E music   : MediaInfo{currVol=22, maxVol=30, artist='Nosaj Thing - Aquarium', album='Digitalis', title='Digitalis', duration=-1, pos=0, state=1, mediaPlayerName='AntennaPod', playerHasGone=0, stateChangeTimeMs=1654081450634, speed=0.0}

Digitalis is a radio I was playing yesterday with the SomaFM player. Note how it shows metadata from SomaFM, but still ā€œAntennaPodā€ as mediaPlayerName.
Again, nothing was playing.
Insisting on hitting play/pause on the headphones, eventually started SomaFM, but this message appeared:

06-01 13:04:26.500 21534 21534 V LASTMESSAGEi: Removed update AntennaPod - Loading. If this does not go away, play any episode and contact us.

Now, letā€™s see if thereā€™s a way to tune or exclude the AntennaPod service from lmk (low memory killer - more vicious than the zodiac killer)

This blog post shows the rules the lmk uses to rank sacrificeable processes. No wonder than keeping the activity (UI) of AntennaPod visible with the screen on ā€œsolvesā€ the problem"

In a ā€œblack boxā€ reasoning, I would assume that either we have to prevent this killing, or see if there is something wrong in the way the application is resumed after a pause.
I donā€™t see any other killing related to other media players in similar tests (though I see tons of others. Amazing how every other application tries to leave something running - even when there is no obvious reason for it)

Edit:
OnePlus is notorious for being overly zealous in killing apps. I set AntennaPod to ā€œdonā€™t optimizeā€ (OneplusLingo for avoiding background kills for battery optimization) and it seems toā€¦ mitigate the problem. I could endure longer pauses without losing the ability to restart the playback, but after about 3 minutesā€¦

06-01 13:30:07.241  1596  3604 D MediaSessionService: Sending KeyEvent { action=ACTION_UP, keyCode=KEYCODE_MEDIA_PAUSE, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=0, downTime=0, deviceId=-1, source=0x0, displayId=0 } to de.danoeh.antennapod/PlaybackService (userId=0)

06-01 13:30:07.249  6453  6453 D NotificationListener: onNotificationPosted# sbn: 135468050, package = de.danoeh.antennapod

06-01 13:30:07.256 26104 26104 D NeoBean_NotificationListener: onNotificationPosted()::sbn.getPackageName() = de.danoeh.antennapod

06-01 13:30:07.260 22511 22511 D Popcorn_NotificationListener: onNotificationPosted()::sbn.getPackageName() = de.danoeh.antennapod

06-01 13:30:07.260  2565  2565 D InterruptionStateProvider: No alerting: filtered notification: 0|de.danoeh.antennapod|2131427989|null|10261

06-01 13:30:07.268 12013 12013 E music   : onNotificationPosted...StatusBarNotification(pkg=de.danoeh.antennapod user=UserHandle{0} id=2131427989 tag=null key=0|de.danoeh.antennapod|2131427989|null|10261: Notification(channel=playing shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x8 color=0x00000000 category=transport actions=4 vis=PUBLIC))

06-01 13:30:07.278  2565  2565 D InterruptionStateProvider: No alerting: filtered notification: 0|de.danoeh.antennapod|2131427989|null|10261

06-01 13:30:07.278  2565  2565 D InterruptionStateProvider: No pulsing: notification shouldn't alert: 0|de.danoeh.antennapod|2131427989|null|10261

06-01 13:30:07.278  2565  2565 D InterruptionStateProvider: No alerting: filtered notification: 0|de.danoeh.antennapod|2131427989|null|10261

06-01 13:30:07.278 12013 12013 E music   : de.danoeh.antennapod

06-01 13:30:07.407 26104 26104 D NeoBean_NotificationListener: onNotificationPosted()::sbn.getPackageName() = de.danoeh.antennapod

06-01 13:30:07.440 12013 12013 E music   : onNotificationPosted...StatusBarNotification(pkg=de.danoeh.antennapod user=UserHandle{0} id=2131427989 tag=null key=0|de.danoeh.antennapod|2131427989|null|10261: Notification(channel=playing shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x8 color=0x00000000 category=transport actions=4 vis=PUBLIC))

06-01 13:30:07.440 12013 12013 E music   : de.danoeh.antennapod

06-01 13:30:07.443 22511 22511 D Popcorn_NotificationListener: onNotificationPosted()::sbn.getPackageName() = de.danoeh.antennapod

06-01 13:30:07.456  6453  6453 D NotificationListener: onNotificationPosted# sbn: 136919011, package = de.danoeh.antennapod

06-01 13:30:07.473 12013 12013 E music   : onNotificationPosted...StatusBarNotification(pkg=de.danoeh.antennapod user=UserHandle{0} id=2131427989 tag=null key=0|de.danoeh.antennapod|2131427989|null|10261: Notification(channel=playing shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x8 color=0x00000000 category=transport actions=4 vis=PUBLIC))

06-01 13:30:07.473 12013 12013 E music   : de.danoeh.antennapod

06-01 13:30:07.482  2565  2565 D InterruptionStateProvider: No alerting: filtered notification: 0|de.danoeh.antennapod|2131427989|null|10261

06-01 13:30:07.484  2565  2565 D InterruptionStateProvider: No alerting: filtered notification: 0|de.danoeh.antennapod|2131427989|null|10261

06-01 13:30:07.484  2565  2565 D InterruptionStateProvider: No pulsing: notification shouldn't alert: 0|de.danoeh.antennapod|2131427989|null|10261

06-01 13:30:07.484  2565  2565 D InterruptionStateProvider: No alerting: filtered notification: 0|de.danoeh.antennapod|2131427989|null|10261

06-01 13:30:07.491 22511 22511 D Popcorn_NotificationListener: onNotificationPosted()::sbn.getPackageName() = de.danoeh.antennapod

06-01 13:30:07.493 26104 26104 D NeoBean_NotificationListener: onNotificationPosted()::sbn.getPackageName() = de.danoeh.antennapod

06-01 13:30:07.498  6453  6453 D NotificationListener: onNotificationPosted# sbn: 86386144, package = de.danoeh.antennapod

06-01 13:30:07.542  2565  2565 D InterruptionStateProvider: No alerting: filtered notification: 0|de.danoeh.antennapod|2131427989|null|10261

06-01 13:30:07.544  2565  2565 D InterruptionStateProvider: No alerting: filtered notification: 0|de.danoeh.antennapod|2131427989|null|10261

06-01 13:30:07.544  2565  2565 D InterruptionStateProvider: No pulsing: notification shouldn't alert: 0|de.danoeh.antennapod|2131427989|null|10261

06-01 13:30:07.544  2565  2565 D InterruptionStateProvider: No alerting: filtered notification: 0|de.danoeh.antennapod|2131427989|null|10261

06-01 13:30:07.721 12013 12569 E music   : MediaInfo{currVol=22, maxVol=30, artist='Back to Work', album='Back to Work', title='Episode 577: Transylvanian Meditation', duration=4929758, pos=2827362, state=2, mediaPlayerName='AntennaPod', playerHasGone=0, stateChangeTimeMs=1654083007134, speed=1.0}

06-01 13:32:57.646  1596  3595 I ActivityManager: Process de.danoeh.antennapod (pid 11549) has died: cch+94 SVC 

06-01 13:32:58.254 12013 12569 E music   : MediaInfo{currVol=22, maxVol=30, artist='BistroBoy - The fear of death', album='Digitalis', title='Digitalis', duration=-1, pos=1452, state=0, mediaPlayerName='AntennaPod', playerHasGone=0, stateChangeTimeMs=1654082486266, speed=0.0}

(note the last line. I bet I will get SomaFM playing when I press play. And I did)

So, clearly not 100% AntennaPodā€™s fault, but without special configuration other apps manage to stay alive. What, if anything, could be done to increase the survivability rate of antennapod in the eyes of the lmk?

2 Likes

Very nice work! I hope this leeds to a solution.

Not having sufficient understanding Iā€™m wildly speculating here, but does this mean that AntennaPod needs to perform something in addition to what it already does when launching the media player?

Today I recognized that there is a new version of AntennaPod in F-Droid. The changes say nothing about this problem here. There are no news to this, I presume?

I experience the loss-of-focus problem occasionally, too, when playing through the BlueTooth headphones and using Magic Earth GPS app. Sometimes after Magic Earth GPS issues directions, AntennaPod doesnā€™t resume playing. Tapping the button on my BlueTooth headphones gets it going again.

This is for AntennaPod 2.6.1 from F-Droid and the immediately-prior version. The phone is plugged into USB to charge, and the screen is on, with Magic Earth GPS in the foreground and AntennaPod in the background, on a Murena Teracube 2e running de-Googleā€™d /e/OS Android 11. Android Auto not used.

I searched Github for resume, but could not realize whether this issue is represented there or not. There seems to be no mention in the thread about an issue number. Maybe someone who is experiencing this would wish to create a ticket, unless there already is one that I am missing?

Probably the same thing that is already tracked in Won't resume after interruption when screen is locked on Android 12 Ā· Issue #5803 Ā· AntennaPod/AntennaPod Ā· GitHub

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.