[pulseaudio-discuss] Networking and volume control

Matt Garman matthew.garman at gmail.com
Fri Nov 6 16:45:37 UTC 2020


I posted about this earlier, but now am facing a different problem.
Recap from original post:

I have PulseAudio set up on a Raspberry Pi as a sound server.  The RPi
is connected to a USB DAC, which has hardware volume control
capabilities.  This is what I have in my /etc/pulse/default.pa:

load-module module-alsa-sink control='D70 '

Note: I am deliberately NOT loading module-udev-detect, otherwise
PulseAudio reverts to software volume control.  (The device is a
Topping D70, and the space between the zero and the quote above is
deliberate.)

Now, on the client, if I do this:

# PULSE_SERVER=rpi_server_hostname pavucontrol

Everything works as expected.  That is, I have an output device
("D70") whose hardware volume I can control with pavucontrol.  So I
went ahead and put "default-server = rpi_server_hostname" in my
~/.pulse/client.conf.  Then all my apps route sound to the RPi.

But then I realized that config makes the RPi the *only* sound device
I can use on my PC.  Sometimes I plug in other devices (e.g. webcam,
headphones) directly to the PC, and those get ignored with the
"default-server" config in place.

So it looks like one solution is to remove the "default-server" config
on the client, and use zeroconf/avahi so that the client can
automatically discover the RPi server as another output device, and
co-exist with local devices.

I set this up, basically by loading the "module-zeroconf-discover" on
the client PC, loading "module-zeroconf-publish" on the RPi server,
and running the avahi daemon on the server.  With this in place, I do
see the RPi server showing up as an output device on my PC.  However,
it doesn't work: I can't get any sound to come from it.  Furthermore,
the volume control doesn't have any effect either.  (I can play sounds
via MPD running locally on the RPI server.  I can adjust the volume in
an MPD client.  I can adjust volume from my PC using pavucontrol only
when using PULSE_SERVER or default-server, but not with the zeroconf
config I'm trying to get working.)

My suspicion is the zeroconf is only working enough to advertise the
device as available, but not advertising enough info to actually make
the device usable.

My other thought is that, given how I had to explicitly configure the
control on the server side, maybe I need to do a similar explicit
config on the client side?

I don't know if this helps, but maybe it offers a clue: on the client
PC, running "pactl list sinks" with and without being prefixed by
PULSE_SERVER:

$ PULSE_SERVER=dietpi-music pactl list sinks
Sink #0
        State: RUNNING
        Name: alsa_output.default
        Description: D70
        Driver: module-alsa-sink.c
        Sample Specification: s32le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 5
        Mute: no
        Volume: front-left: 5727 /   9% / -63.51 dB,   front-right:
5727 /   9% / -63.51 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor Source: alsa_output.default.monitor
        Latency: 22567 usec, configured 24988 usec
        Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
        Properties:
                alsa.resolution_bits = "32"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "USB Audio"
                alsa.id = "USB Audio"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "1"
                alsa.card_name = "D70"
                alsa.long_card_name = "Topping D70 at
usb-0000:01:00.0-1.2, high speed"
                alsa.driver_name = "snd_usb_audio"
                device.bus_path =
"platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0"
                sysfs.path =
"/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1"
                udev.id = "usb-Topping_D70-00"
                device.bus = "usb"
                device.vendor.id = "152a"
                device.vendor.name = "Thesycon Systemsoftware & Consulting GmbH"
                device.product.id = "8750"
                device.product.name = "D70"
                device.serial = "Topping_D70"
                device.string = "default"
                device.buffering.buffer_size = "705600"
                device.buffering.fragment_size = "352800"
                device.access_mode = "mmap+timer"
                device.description = "D70"
                alsa.mixer_name = "USB Mixer"
                alsa.components = "USB152a:8750"
                device.icon_name = "audio-card-usb"
        Formats:
                pcm


Versus running without the PULSE_SERVER environment:

$ pactl list sinks
Sink #0
        (snipped for brevity - my HDMI monitor, which has sound output
capabilities)

Sink #1
        State: SUSPENDED
        Name: tunnel.dietpi-music.local.alsa_output.default
        Description: D70 on root at dietpi-music
        Driver: module-tunnel.c
        Sample Specification: s32le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 26
        Mute: no
        Volume: front-left: 7575 /  12%,   front-right: 7575 /  12%
                balance 0.00
        Base Volume: 65536 / 100%
        Monitor Source: tunnel.dietpi-music.local.alsa_output.default.monitor
        Latency: 0 usec, configured 0 usec
        Flags: NETWORK HW_MUTE_CTRL HW_VOLUME_CTRL LATENCY
        Properties:
                device.description = "D70 on root at dietpi-music"
                tunnel.remote.server = "[10.18.51.63]:4713"
                tunnel.remote.sink = "alsa_output.default"
                device.icon_name = "computer"
                tunnel.remote_version = "32"
                tunnel.remote.user = "root"
                tunnel.remote.fqdn = "dietpi-music"
                tunnel.remote.description = "D70"
        Formats:
                pcm


Thank you for any help or hints!


More information about the pulseaudio-discuss mailing list