Pipewire-roc(ks)

In case you didn’t knew :

The package pipewire-roc adds modules to pipewire which support the ROC-toolkit for realtime low latency audio streaming.

Via sound server modules, as listed here audio streams between pulseaudio, pipewire as well as macOS virtual devices could be streamed.

Why you might ask ? Well, I’ve moved my USB-DAC to another device, an SBC which is an NanoPI Nano (an rather old Arm Cortex-A7 with 1.2GHz, 512mb of RAM and only 100mbit Ethernet) which I’m going to route my whole audio output to instead of using my Desktop client. That way I could use different devices to stream audio to the NanoPI, which would also receive streams from my Apple devices, and, most importantly to me, I’m going to add an I2S ADC board to the NanoPI which would digitalize my phono input additionally - without the need to have my Desktop running just to listen to audio. And that way I’löd have the opportunity to apply an parametric equalizer to the phono source as well - which is more or less an room equalization filter that has been generated via the software room eq wizard to achieve a better frequency response from my speakers.

Up so far, I’m quite impressed. As the audio stream would introduce some latency to the signal. But as the ROC-toolkit is actually optimized for that purpose, the outcome while playing back videos, displaying it on my Desktop and streaming the audio to the SBC doesn’t seem to introduce much latency, as I can’t really tell that the audio signal is totally out of sync.

Unfortunately the part to get it running on the SBC hasn’t been that straight forward. But as that is related to the fact that I’m running DietPI (headless) on the NanoPI, which is a leight-weight distro based on Debian Trixie which is optimized, even for older SBCs. Therefore, no arch repos… but also not the bloat Raspberry PI OS (Lite) comes with. And it’s also less resource demanding than a minimal Armbian install.

So after some compiling on the SBC itself, the creation of some systemd unit files and other shenanigans, I know have a little audio server that would idle away unattended. And just do it’s thing as long as it’s microSD card might survive. And then, I’m screwed :wink: Guess I should prepare an backup copy next.

Same here, all audio streams through the raspi: Android, TV with Bluetooth, Linux with pipewire and roc-tookit, Apple with AirPlay. Roc-toolkit latency is really good and no complains for consumption like video playback and gaming.

The pipewire-roc support on Debian/Ubuntu/RaspiOS packages was (and afaik still is) broken for years, so you have to compile it yourself. Eventually I craved and installed Arch Linux on ARM on the Raspi. Running an Arch server now. :zany_face:

1 Like

Yes. On the side of EndeavourOS, all it required has been that package and a simple conf file for the sink,

~/.config/pipewire/pipewire.conf.d/roc-sink.conf

context.modules = [
    { name = libpipewire-module-roc-sink
        args = {
            fec.code = rs8m
            remote.ip = "mine.not.yours"        # SBC IP
            remote.source.port = 10001
            remote.repair.port = 10002
            remote.control.port = 10003
            sink.props = {
                node.name = "roc-sink"
                node.description = "Network Audio to SBC"
                audio.rate = 48000
            }
        }
    }
]

Would have used Arch ARM on the NanoPI … but I don’t have any clue how well it would perform on that SBC. Compilation wasn’t that bad… only finding the right compilation flags took a while.

And that DietPi actually doesn’t ship with pipewire or any systemd user units, including the actual correct wireplumber configuration … that took most of the time actually.

1 Like