2

I'm designing a Raspberry Pi -based LED visualization wall that can, for example, display the frequency spectrum of the sound output of another computer. The logical choice would be to use PulseAudio for monitoring the audio over LAN.

There's a problem, though. I can easily play audio from one computer to another and also record a remote mic input, so there's nothing wrong with my basic setup, but for some reason I fail to record the monitor source that should provide a mix of all audio played on the remote computer. I can even see the remote monitor source on the input list of PulseAudio Volume Control (pavucontrol), but all I get is silence when it's selected for recording. Locally the monitor source works OK. The sink is a HDMI output with regular stereo PCM, not AC3/DTS passthrough.

Am I missing something essential here? Is network access to monitor sources prevented for some reason?

If there's a solution to this, I'd be happy to see a CLI alternative too, as that's what I'll primarily need for my project.

I've used up all my Google-fu with no success, but I'd be surprised if nobody has done this before.

Update: Added output of pacmd list-sources | grep name: as requested. Tunneled items are listed twice because of IPv6, but that's not a problem.

name: <alsa_output.pci-0000_00_1b.0.analog-stereo.monitor>
name: <alsa_input.pci-0000_00_1b.0.analog-stereo>
name: <tunnel.mediacenter.local.alsa_input.pci-0000_00_14.2.analog-stereo>
name: <tunnel.mediacenter.local.alsa_input.pci-0000_00_14.2.analog-stereo.2>
name: <tunnel.mediacenter.local.alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor>
name: <tunnel.mediacenter.local.alsa_output.pci-0000_00_14.2.iec958-stereo.monitor>
name: <tunnel.mediacenter.local.alsa_output.pci-0000_01_00.1.hdmi-stereo.2.monitor>
name: <tunnel.mediacenter.local.alsa_output.pci-0000_00_14.2.iec958-stereo.2.monitor>
  • First thing to try is to check whether you can record the monitor source locally instead of remotely. Also, please edit question with output of pacmd list-sources | grep name:, so we get a better idea which devices are attached. – dirkt Aug 29 '17 at 10:02
  • @dirkt I already mentioned that locally the source works. I added the list output. – Martin Laakso Aug 29 '17 at 11:55
2

I'm posting a solution of my own, found with the help of PulseAudio developers, so that others may avoid my struggles.

The issue turned out to be a bug in the zeroconf module of PulseAudio 10.0 and will probably get fixed sooner or later. Until then the only solution (besides creating a tunnel manually) is to record directly from the remote PulseAudio server, bypassing the tunnel module. This probably won't work with GUI applications, though. Example command to record a remote monitor source:

PULSE_SERVER=REMOTE_HOST parecord --device=MONITOR_SOURCE > recording.wav

Replace REMOTE_HOST and MONITOR_SOURCE with appropriate values, using the source's local name (i.e. in my case alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor).

A similar direct PulseAudio connection can be used with GStreamer, which has handy CLI tools and bindings for various programming languages. Example command to play a remote monitor source locally:

gst-launch-1.0 pulsesrc server=REMOTE_HOST device=MONITOR_SOURCE ! pulsesink

GStreamer can also provide spectrum data, which may be useful in visualization projects. Example with a long interval and no audio throughput:

gst-launch-1.0 -m pulsesrc server=REMOTE_HOST device=MONITOR_SOURCE\
 ! spectrum interval=400000000 bands=10 threshold=-100 ! fakesink

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.