Skip to content

When running a2dp_sink_demo, an error occurs after pausing and then resuming the music. #716

Description

@huenrong

Describe the bug

When running a2dp_sink_demo on RK3308, an error occurs after pausing and then resuming the music.
Error message: Error storing samples in SBC ring buffer!!!

To Reproduce

Steps to reproduce the behavior:

  1. Run example 'a2dp_sink_demo' on RK3308
  2. Connect to device 'iPhone17'
  3. Playing music on an iPhone 17, the RK3308 can output sound
  4. Paused on the iPhone 17, the RK3308 outputs no sound
  5. Waiting for the RK3308 terminal to output "A2DP Sink : Stream paused"
  6. Resumes on the iPhone 17, the RK3308 terminal displays an error message. Error storing samples in SBC ring buffer!!!

Expected behavior

Playback can be resumed normally.

HCI Packet Logs

hci_dump_a2dp_sink_demo.tar.gz

Additional context

My investigation revealed that adding a call to the snd_pcm_prepare() function within the alsa_stop_stream() function in the btstack_audio_alsa.c file resolved the issue.

The modified function is as follows

static void alsa_stop_stream(void) {
    snd_pcm_drop(pcm_handle);
    snd_pcm_prepare(pcm_handle); // add
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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