Audio focus lost when resuming after call

App version: x.y.z (state whether from Google Play/F-Droid/Custom built APK)
2.4.7 from Google Play

Android version: 5.x (Please mention if you are using a custom rom!)
11.0 stock

Device model:
Huawei Mate 20 Pro

Expected behaviour:
Pause playback during phone call via BT Headset and resume, when call has ended.

Current behaviour:
After the call has ended, AntennaPod loses the audio focus and PowerAmp starts playing instead, although it wasn’t active in the fist place.

First occurred: (e.g. about x days/weeks ago)
last year

Steps to reproduce:
pre-cond: Install PowerAmp, configure it same as AntennaPod: pause audio during call, resume after call has ended, start and stop the playback once in PowerAmp and close the App.
Steps:

  1. connect Headset via BT
  2. start playback in AntennaPod
  3. receive a call via headset
  4. after call has ended, PowerAmp starts playing, although AntennaPod is still listed as actice in the notivication area

Environment: (Settings you have changed (e.g. Auto Download). “Unusual” devices you use (e.g. Bluetooth headphones). Did you select another media player?)

  • PowerAmp for MP3 playback
  • BT headset
  • cross check with Google podcast: there this beaviour is not happening

@S_Martin can you confirm what version of AntennaPod? You wrote 2.4.7, is that a beta version?

Hi,
as stated above, it is the bone stock 2.4.7 from Google Play.

Best regards,
Sebastian

Are you sure you are actually using AntennaPod and not a freebooted clone? AntennaPod version 2.4.7 does not exist.

Dang, you’re right. I don’t know how I managed to misread that twice.
The actual version of my bone stock installation from Google Playstore is: 2.4.0 (f4d3ebb22)
Sorry for the confusion.

Sebastian

I’m getting similar behavior with AntennaPod 2.4.1 and the Deezer music player app. It happens intermittently, and a phone call doesn’t have to be involved. It can just be a pause of the audio using the bluetooth headset. If I am listening to a podcast on AntennaPod and pause it using the button on my bluetooth headset, it will often switch to Deezer upon resumption (it would also sometimes switch to the Soundcloud app, but I have since uninstalled that app.) The likelihood of switching apps is increased the longer the pause is.

Device model : OnePlus 6T
Android version : Android 11 OxygenOS 11.1.2.2
App version : 2.4.1 from Google Play

I am seeing the same behaviour reported by pahool, which I believe is related to S_Martin’s original report.

When I press the pause button on my bluetooth headset, AntennaPod correctly pauses. After a while, I press the same button to resume play, but the default music player will start playing instead of AntennaPod.

Device model : Huawei POT-LX1
Android version : Android 10
App version : 2.4.2 from Google Play

Out of curiosity I searched for bluetooth in AntennaPod’s source code and get the impression
this BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED registration, and the corresponding actual handling of the Intent, might be good places to look for those hoping it might be in AntennaPod’s power to address how other apps are behaving.

While I didn’t read them, reference docs seem to be at: BluetoothA2dp  |  Android Developers

Does anyone see anything possible to do better or differently?

I can confirm this behaviour with a BT headset. Sometimes this happens within seconds, sometimes it works some hours as expected. And the focus always goes back to last used other player (e. g. for me Smart Audiobook Player, EscapePod)

Device model: OnePlus Nord CE
Android Version: Android 11
App version: 2.4.2 from Playstore

1 Like

I’ve been suffering from this issue since forever. I’m pausing my Bluetooth headphones to listen to somebody talking to me, and, sometimes after seconds, sometimes after minutes, restarting playback starts whatever previous media app I used (spotify, somafm radio, etc…)
I’ve often been tempted to set AntennaPod to “don’t optimize” in the battery manager of oneplus (which is notorious for messing a bit with background applications) but since I don’t have to do it for other apps I always assumed it was some manifest flag or something in AntennaPod.
I only decided to look into what the community had on this today. I’m glad I’m not alone.

Device model: OnePlus 7 Pro
Android Version: Android 11
App version: 2.5.0 from Playstore

Welcome to the club.
I doubt that we will ever find a solution to this strange behaviour. Which is sad because the app is very good. I was looking for an alternative but they all have flaws in one way or another.

In my mind this is down to Android to improve / tighten up Bluetooth media control and for these other rogue apps to use the existing Bluetooth media control features correctly. In the mean time Force Stop’ing these rogue apps after use is one workaround even if it is a bit of a faff.

By “rogue apps” you mean every other media player? I’m not convinced that antennapod is the only app that does it right. Regarding “close the other rogue apps” well, there are none running. They are closed and this only happens when antennapod is running. There is something odd about this whole situation.

You seem surprised by how many, even mainstream, media apps seem to think they are the only player in town and don’t need to worry about relinquishing control when they should.

Closing an app is not the same or as drastic as Force Stop’ing and app.

The funny thing is I asked the developer of Poweramp the same thing. His answer was nearly identical, my so does it right, the others are wrong.
Are there different methods of stopping and resuming playback after bluetooth interrupt? Like one global and one more specific to one app itself?

I don’t have this issue if I use Pocket Casts at all, so it doesn’t seem to be an insurmountable problem. I’ve unfortunately taken to using Pocket Casts because a lot of my listening situations put me in the position of having to be able to reliably control my playback using bluetooth only.

The point being that Pocket Casts seems to be able to get this right, so I don’t think it’s strictly a case of rogue apps. Unless Antennapod is doing it right and Pocket Casts is somehow steamrolling other apps. This doesn’t seem to be the case however, as I haven’t had any issues with Pocket Casts stealing playback focus from other audio apps.

Would anyone who experience this issue be able to reproduce it with another open source app as the one unexpectedly “resuming” playback? It might be easier to realize what’s happening if one would be able to study what both involved apps are doing.

I’ll try installing on a clean install of LineageOS on an old phone and see if I can reproduce the behavior with another open source app.

1 Like

I also switched to another podcast app.
I use about 5 mediaplayers regularly and none of the others has this problems.
I hope there will be a solution soon because no other podcast player fits my needs like AntennaPod does (although some others are a lot faster).

Just an idea, is it possible that Android Auto has an influence on that behaviour?
I use both PowerAmp and Antennapod with Android Auto and I noticed that the behaviour of resuming after a call did change for some reason.