Hi,
I’m working on a Bluetooth media player on i.MX8MP with Qt. I’m using BlueZ with PulseAudio. One phone(A2DP source) can connect and stream music to the board (A2DP sink) without problems. But while the first phone is playing, a second phone can also connect and start playing, and then I hear two songs mixed together.
What I notice is that when Bluetooth is running, every connected device gets its own PulseAudio Bluetooth card/profile (A2DP). So if two phones stream, PulseAudio just mixes both streams to the output.
I want only one active A2DP stream at a time (single source policy). Ideally, when a second phone starts streaming, the first one should be stopped/disconnected, or the second stream should be rejected. Is there a recommended way to enforce this with BlueZ + PulseAudio on i.MX8MP? Should this be solved with a BlueZ D-Bus policy (monitor MediaTransport state and disconnect the previous device), or is there a simpler config/module setting to prevent multiple A2DP streams?