Skip to content

AAudio Stream disconnection #1287

@darshanbr

Description

@darshanbr

Android version(s): R (AAOS)

Discription
On Android R we are facing AAudio stream disconnection issue. Bluetooth will be playing initially(which uses AAudio). AAudio stream is being disconnected as soon as we switched from Bluetooth to FM. Therefore there is no audio available once after we switched back from FM to Bluetooth.

Steps to reproduce

  1. BT Stereo Audio is playing.
  2. Change the source to FM which uses HwAudioSource player
  3. Now, Change the source to BT SA - observed audio loss

Expected behavior
Audio should be available

Actual behavior
Audio not available after source switch

Below logs are from BT SA to FM switch, in which the AAudio stream goes to disconnect state

03-29 13:31:21.374 3555 6534 W APM_AudioPolicyManager: disconnectAudioSource source has neither SW nor HW output
03-29 13:31:21.374 3555 6534 E APM_AudioPolicyManager: releaseAudioPatchInternal: no patch found with handle=0
03-29 13:31:21.391 4651 8205 D AudioStreamLegacy: onAudioDeviceUpdate() devId 3 => 2
03-29 13:31:21.391 4651 8205 D AudioStreamLegacy: onAudioDeviceUpdate() DISCONNECT the stream now
03-29 13:31:21.391 4651 8205 D AAudioStream: setState(s#2) from 4 to 13
03-29 13:31:21.392 3555 3592 D AF::TrackHandle: OpPlayAudio: not muting track:68 usage:0 for service UID 1041
03-29 13:31:21.392 3555 3567 E AudioFlinger::PatchPanel: Software patch connections leaked 268 276
03-29 13:31:21.392 3555 3567 E AudioFlinger::PatchPanel: A non empty Patch Endpoint leaked, handle 268
03-29 13:31:21.392 3555 3567 E AudioFlinger::PatchPanel: A non empty Patch Endpoint leaked, handle 276
03-29 13:31:21.393 4651 4651 I bt_btif_a2dp_sink: btif_a2dp_sink_set_focus_state_req
03-29 13:31:21.393 4651 5580 I bt_btif_a2dp_sink: btif_a2dp_sink_set_focus_state_event: state=0

after this Tuner plays but when we change back to BT SA the AAudio stream (which was supposed to be paused due to FM playback) is unable to resume. i.e DISCONNECTED

our system property configurations are as below
PRODUCT_PROPERTY_OVERRIDES += aaudio.mmap_policy=1
PRODUCT_PROPERTY_OVERRIDES += aaudio.mmap_exclusive_policy=1

it's an always issue and we can reproduce it anytime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions