I have a RPi that is running videos with omxplayer and outputting to my tv. HDMI video and audio out work just fine, but I would additionally like to stream only the audio to my network (via RTP or other means) so I can connect other devices in different rooms and continue listening -- like a LAN radio broadcast of sorts. I have tried using avconv and ffmpeg but have only been successful in capturing audio before it is sent to the tv (on $DISPLAY=0).

I am currently working on duplicating the audio and capturing it that way but have only come up with silent audio files so far.

I can record audio with avconv / ffmpeg before it gets sent to HDMI out but can't get the duplicated audio to record anything.

I successfully streamed previously saved audio files via RTP, but it was a little too choppy for my liking - audio was dropping every 10-ish seconds. Is this a limitation of the RPi 3B+ hardware? Ideally I would like to stream the HDMI audio with as little delay as possible. It is not necessarily my goal to save the HDMI audio as a large file as I plan to leave the service running for long periods of time.

Also, while following the above link, I am not entirely sure what to put as the device name in asound.conf

pcm.output {
    type hw
    card <Your Output Device Name>

card 0? or the HDMI device?

  • You don't "capture the HDMI audio output". Instead, install Pulseaudio if it isn't installed, make a custom audio "null" audio sink, then choose it as default sink and connect it up both to the HDMI audio sink and a stream sink (Pulseaudio has a few choices, including RTP). There are questions on this site describing how to do this, though probably not with your exact configuration. – dirkt May 7 at 6:07

You need Pulseaudio to stream audio over LAN

you would need to install Pulseaudio and:

Pulseaudio Volume Control (pavucontrol) for sound levels and routing audio streams

Pulseaudio Preferences (paprefs) for streaming
Multicast/RTP tab to configure for RTP sender or reciever
Simultaneous Output tab to get audio playing to multiple devices

LAN streaming audio can be delayed by 1 or 2 seconds compared to audio source, so audio is not good if you can hear both unsynchronized audio streams at once when moving between two rooms

  • Thank you. Between @dirkt and your comment I was able to get it working properly.. My only issue is a ~ 0.5 second delay in audio which is better than I expected it to be. So now I am working on getting omxplayer's video to be delayed 0500 ms but have audio play normally.. not sure if thats even possible – Emved May 12 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.