google / oboe

Oboe is a C++ library that makes it easy to build high-performance audio apps on Android.
Apache License 2.0
3.68k stars 563 forks source link

Connecting Bluetooth Speaker from Bluetooth in Control Panel on a Paused or Stopped Stream Doesn't call Error Callback for MMAP Streams #1862

Open RichardXiao13 opened 1 year ago

RichardXiao13 commented 1 year ago

Android version(s): 12 Android device(s): Samsung S10e, Pixel 6? (don't remember pixel version) Oboe version: 1.7.4 App name used for testing: OboeTester (Please try to reproduce the issue using the OboeTester or an Oboe sample.)

Short description (Please only report one bug per Issue. Do not combine multiple bugs.) Connecting a bluetooth speaker from the bluetooth button in the control panel on a paused or stopped MMAP stream won't call the error callback for MMAP stream.

Steps to reproduce

  1. Turn off bluetooth from the control panel
  2. Open a MMAP stream in Test Output in OboeTester
  3. Start the stream.
  4. Pause or Stop the stream.
  5. Turn on bluetooth from the control panel and connect a speaker.
  6. Start the stream again.
  7. Audio continues to play out of the device speaker rather than display an error.

Expected behavior OboeTester should display an error with code -869 or something similar.

Actual behavior Audio continues playing from the device speaker.

Device Samsung S10e

ro.product.brand = samsung ro.product.manufacturer = samsung ro.product.model = SM-G970U ro.product.device = beyond0q ro.product.cpu.abi = arm64-v8a ro.build.description = beyond0qltesq-user 12 SP1A.210812.016 G970USQS6HVC6 release-keys ro.hardware = qcom ro.hardware.chipname = SM8150 ro.arch = | grep aaudio = [aaudio.hw_burst_min_usec]: [2000]

RichardXiao13 commented 1 year ago

I used Apple Air Pods Pro as the Bluetooth speaker if it helps.

philburk commented 1 year ago

@RichardXiao13 - Thanks for the detailed repro steps.

I could not reproduce this on Pixel 7 Pro using Pixel Buds. The stream closed when I connected my Pixel Buds. Then when I hit START I got an error -869.

@robertwu1 - could you test on your Samsung device?

robertwu1 commented 1 year ago

A similar but different issue occurs for me #1874

robertwu1 commented 1 year ago

Can you try the latest OboeTester with #1875?

RichardXiao13 commented 1 year ago

@robertwu1 Still not working for me.

philburk commented 1 year ago

@RichardXiao13 wrote:

Still not working for me.

Did you try the latest OboeTester from Play Store or from building the GitHub source?

What is your OboeTester version number from the main screen?