A2DP Change samplerate

2 views
Skip to first unread message

Edwin van den Oosterkamp

unread,
Nov 6, 2025, 9:05:20 AM (6 days ago) Nov 6
to btstack-dev
Hello,

I'm using a Raspberry Pi Pico2 W to send audio to a sink. The sink supports 44.1kHz as well as 48kHz. The samplerate of the audio I'm sending depends on the source material, which is either 44.1kHz or 48kHz, but can change any time the user selects a different source.

Is there a way to renegotiate the samplerate of the stream without disconnecting from the sink and reconnecting with a different  preferred samplerate set?

Matthias Ringwald

unread,
Nov 6, 2025, 9:10:28 AM (6 days ago) Nov 6
to btsta...@googlegroups.com
Hi Edwin

You can change the sampling rate by:
- pause the stream with a2dp_source_pause_stream
- changing the sampling rate with a2dp_source_reconfigure_stream_sampling_frequency
- restarting the stream with a2dp_source_start_stream

This is demonstrated in our a2dp_source_demo for quick testing btw.

Alternatively, you could just use 48 khz and use our btstack_resample.c implementation to upsample a lower sampling rate, e.g. 44.1 kHz, to 48 kHz.

Cheers
Matthias
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/btstack-dev/a3f21b78-aff4-4c48-9bd2-760b6959a03en%40googlegroups.com.

Edwin van den Oosterkamp

unread,
Nov 7, 2025, 4:54:43 AM (6 days ago) Nov 7
to btstack-dev
Hello Matthias,

Many thanks for your reply - not sure how I managed to miss it in the example!

Best regards,
Edwin
Reply all
Reply to author
Forward
0 new messages