0
votes

I'm trying to create a Bluetooth A2DP sink (receiver) then output the audio to a vorbis radio stream (LAN only). Basically I want this as a bluetooth add-on to a squeezebox (squeezelite) multi-room music system. The A2DP-sink-radio-transmitter is a standalone Raspberry Pi that can be added to any system easily. I'm relatively new to Linux.

I HAVE already achieved a working setup, but it all falls over when I pause Audio on the bluetooth source (phone).

The Setup: Bluetooth Phone -> Received by Bluez/PulseAudio [PA] -> PulseAudio Bluez Source through a PA 'module-loopback' to ALSA audio card Sink -> Darkice to encode vorbis stream using pulseaudio as source (device = pulse) -> icecast2 to broadcast

This works well but when I pause the phone the stream (as received by VLC/Squeezebox) STOPS (time stamp stops ticking). Resuming the audio gives a huge latency (I think it's the same length as the pause duration). After long pauses the stream can fail to restart. Darkice is clearly seeing that the audio input has stopped.

I think I need to tell PulseAudio to fill the pause with some silence somehow. I've tried routing through an ALSA dummy (snd-dummy), this just gave constant noise. I couldn't get jackd to work.

Darkice can take the following sources: OSS, ALSA and JACK.

Please help, I'm sooooo close!

2

2 Answers

1
votes

I was having the exact same problem except I was streaming my phone's bluetooth to Sonos using a Raspberry Pi and Sonos would disconnect from the Icecast server whenever the Darkice bluetooth audio stream was interrupted. I tried liquidsoap but couldn't get it to recognize my bluealsa stream so I started experimenting with fallback streams in the Icecast2.xml configuration file and discovered if you encode a one-second silent mp3 file and give it the same name as the Darkice stream and designate it as the main mount point, the stream never gets interrupted. https://www.instructables.com/id/Play-Bluetooth-on-Sonos-Using-Raspberry-Pi/

0
votes

I've found a solution.

I've removed Darkice and I'm using liquidsoap to create the vorbis stream. This has the option mksafe() which will send silence if the incoming audio source is not available. Exactly as I wanted!