Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVCRP audio focus causes attenuation #2

Open
Trinition opened this issue May 14, 2015 · 1 comment
Open

AVCRP audio focus causes attenuation #2

Trinition opened this issue May 14, 2015 · 1 comment

Comments

@Trinition
Copy link

I often listen to iHeartRadio. When a notification comes in, the iHeartRadio audio level attenuates while the notification ding plays. But the audio level never restores. My work-around is to stop/start iHeartReadio (or cycle bluetooth, or reboot, etc.).

I next found that Botifier attenuates the audio with Google Play Music as well as iheartradio.

Finally I found that if I set Botifier AVCRP plug-in to clear the notification after a timeout (e.g. 10s), the audio attenuation ended after that time.

I recently learned a little about Android audio focus, including ducking. I found in the Botifier code that it grabs audio focus with duckability (AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK). I suspect this might be the cause of the audio attenuation.

Why does Botifier need to grab audio focus? The system is handling the notification sound, right? And while the TTS module might need audio focus, that's not part of the AVCRP plug-in, but the TTS plug-in (which is not using).

@grimpy
Copy link
Owner

grimpy commented May 15, 2015

This is because the AVRCP information does not get pushed if the 'application' does not have audiofocus.
In android 5.0 there is a whole new API to play with which should be able to prevent this. But in older version I dont thiink there is a way around this. Some applications (powerAmp) can ignore audioducking and keep playing at the same sound level.

Ill keep this issue open untill I make a release with the 5.0 code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants