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

Reopening stream causes switching playback from headset to internal earphones #995

Closed
gavv opened this issue Aug 29, 2020 · 2 comments
Closed
Labels

Comments

@gavv
Copy link

gavv commented Aug 29, 2020

Android version(s): 10 QKQ1.190910.002
Android device(s): Xiaomi Redmi Note 7
Oboe version: 1.4.2
App name used for testing: custom example

Short description

Recently I've upgraded my phone to Android 10 and started experiencing the following bug:

  1. Open playback stream with device ID of a Bluetooth headset.
  2. Start playback. It goes to headset.
  3. Stop and close stream.
  4. Repeat exactly the same several times. All stream parameters and device ID are the same.
  5. After repeating one or a few times, playback now goes to internal earphones!
  6. Further restarts change nothing, playback still goes to the wrong place.

How to reproduce

I can reproduce the bug using the example which I've shared earlier (oboe-example repo) in another issue: #953

I've pushed a new commit that just adds beeping. Now you can connect BT headset and wait until it starts producing beep, and then press STOP-START several times. After one or a few restarts, you'll hear that beeping now goes from internal earphones instead of headset. You can check in the logs that device ID (and other parameters) are still the same.

Workarounds

So far I've found two workarounds:

  • restart the app
  • OR, first open stream with another device ID, close it, and then open with desired device ID; playback will now go to the right place

Just in case: I also tried to reset WiFi & Bluetooth settings of the phone. It didn't help.

Device

ro.product.brand = xiaomi
ro.product.manufacturer = Xiaomi
ro.product.model = Redmi Note 7
ro.product.device = lavender
ro.product.cpu.abi = arm64-v8a
ro.build.description = lavender-user 10 QKQ1.190910.002 V11.0.1.0.QFGMIXM release-keys
ro.hardware = qcom
ro.hardware.chipname = 
ro.arch = 
@gavv gavv added the bug label Aug 29, 2020
@philburk
Copy link
Collaborator

philburk commented Sep 2, 2020

There have been a number of bugs similar to this involving BT routing. The bug is in Q so it may have been fixed already.
It seems like a duplicate of this bug:
b/142293357 | Device show playing media to my Bluetooth headphones, but actually to speaker

This routing issue is below the level of Oboe and routing issues are hard to workaround. So there is not much we can do in Oboe.

If you would like the BT team to look at this then please file an Android bug at:
https://source.android.com/setup/contribute/report-bugs

One thing we could do it write an automated test that tries to connect repeatedly to a BT device.

@gavv
Copy link
Author

gavv commented Dec 4, 2020

Thanks for clarifying!

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

No branches or pull requests

2 participants