You are not logged in.

#1 2020-10-22 19:55:59

BertiBoeller
Member
Registered: 2009-01-19
Posts: 58

[Solved] PulseAudio does not use hardware volume control

According to the PulseAudio documentation the volume mixer should use a combination of hardware and software volume control if the audio master volume gets changed: https://www.freedesktop.org/wiki/Softwa … MyVolumes/

Unfortunately PulseAudio doesn't use hardware volume control for my USB soundcard (Apogee Groove). The HW_VOLUME_CTRL flag is not listed when I run pacmd list-cards.

I can change the hardware volume using alsamixer and then selecting the Groove sound card.

Apparently PulseAudio is not able to detect the hardware volume mixer:

$ pulseaudio -v
...
I: [pulseaudio] alsa-sink.c: Driver does not support hardware volume control, falling back to software volume control.
I: [pulseaudio] alsa-sink.c: Driver does not support hardware mute control, falling back to software mute control.
...

I've found this post where the problem is solved by selecting a different control. But I have no idea how to find out if there are any other controls and which control gets used by default.

$ pacmd list-cards
    index: 1
        name: <alsa_card.usb-Apogee_Groove-00>
        driver: <module-alsa-card.c>
        owner module: 7
        properties:
                alsa.card = "2"
                alsa.card_name = "Groove"
                alsa.long_card_name = "Apogee Groove at usb-0000:0b:00.3-3.1, high speed"
                alsa.driver_name = "snd_usb_audio"
                device.bus_path = "pci-0000:0b:00.3-usb-0:3.1:1.0"
                sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:0b:00.3/usb3/3-3/3-3.1/3-3.1:1.0/sound/card2"
                udev.id = "usb-Apogee_Groove-00"
                device.bus = "usb"
                device.vendor.id = "0c60"
                device.vendor.name = "Apogee Electronics Corp."
                device.product.id = "001f"
                device.product.name = "Groove"
                device.serial = "Apogee_Groove"
                device.string = "2"
                device.description = "Groove"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-usb"
        profiles:
                output:analog-stereo: Analog Stereo-Ausgabe (priority 6500, available: unknown)
                output:iec958-stereo: Digital Stereo (IEC958)-Ausgabe (priority 5500, available: unknown)
                off: Aus (priority 0, available: unknown)
        active profile: <output:analog-stereo>
        sinks:
                alsa_output.usb-Apogee_Groove-00.analog-stereo/#0: Groove Analog Stereo
        sources:
                alsa_output.usb-Apogee_Groove-00.analog-stereo.monitor/#0: Monitor of Groove Analog Stereo
        ports:
                analog-output: Analog Output (priority 9900, latency offset 0 usec, available: unknown)
                        properties:

                iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
                        properties:
$ amixer -c Groove
Simple mixer control 'Groove Output',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 64
  Mono: Playback 14 [22%] [-50.00dB] [on]
$ amixer -c Groove controls
numid=4,iface=CARD,name='Apogee Internal Clock Validity'
numid=5,iface=CARD,name='Keep Interface'
numid=2,iface=MIXER,name='Groove Output Playback Switch'
numid=3,iface=MIXER,name='Groove Output Playback Volume'
numid=1,iface=PCM,name='Playback Channel Map'

Last edited by BertiBoeller (2020-10-22 22:58:34)

Offline

#2 2020-10-22 20:56:33

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 17,620

Re: [Solved] PulseAudio does not use hardware volume control

By default pulse tries PCM and Master and Speaker as controls, it seems you've identified your control it's called 'Groove Output'

Offline

#3 2020-10-22 22:57:31

BertiBoeller
Member
Registered: 2009-01-19
Posts: 58

Re: [Solved] PulseAudio does not use hardware volume control

Thank you! That worked. I saw the mixer name but I've tried 'Groove Output Playback Volume' as mixer name. Is there any documentation on how to find the correct name?

My current configuration is looks like this:

$ cat .config/pulse/default.pa
# device_id: pacmd list-cards -> alsa.card_name
# control: amixer -c <alsa.card_name> -> Simple mixer control name
load-module module-alsa-card device_id='Groove' control='Groove Output' ignore_dB=1 deferred_volume=1

.include /etc/pulse/default.pa

I've used the ignore_dB option because when I decreased the volume below a certain level pulseaudio was not able to increase the volume anymore (the volume slider in pavucontrol was grayed out). If anybody knows the reason for this I would be really interested why this is the case.

When I tried module-alsa-sink instead of module-alsa-card:

load-module module-alsa-sink device=hw:'Groove' control='Groove Output'

pulseaudio would immediately crash. Is this a bug?

Last edited by BertiBoeller (2020-10-25 18:56:09)

Offline

#4 2020-10-23 00:55:56

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 17,620

Re: [Solved] PulseAudio does not use hardware volume control

I doubt there is a way to identify the correct control automatically, there's no inherent heuristic to tell you "this is correct" (which is why you  explicitly have to set this in the first place). The only thing I have here is that "controls" is too low of a level and it just looks up the simple mixer controls. Not sure on the ignoreDB requirement but afaik the option is explicitly there because some HW reacts in weird ways in this case.

Offline

#5 2020-10-23 10:07:20

BertiBoeller
Member
Registered: 2009-01-19
Posts: 58

Re: [Solved] PulseAudio does not use hardware volume control

One last question: How did you know the name of the control had to be Groove Output not Groove Output Playback Volume?

Offline

#6 2020-10-23 12:24:12

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 17,620

Re: [Solved] PulseAudio does not use hardware volume control

As mentioned, the controls listed by "amixer controls" are too low level and not normally manipulated by "normal" applications that want to manipulate a devices mixer state. These low level controls are logically combined into the "outwards" exposed

$ amixer -c Groove
Simple mixer control 'Groove Output',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 64
  Mono: Playback 14 [22%] [-50.00dB] [on]

so that's the device you want to access from pulse's (or any other normal mixer trying to access the device's controls)

From what I'm seeing this single control is a logical combination of at least three of the ones in the listing of amixer controls. It defines the playback switch (as in is the device available for playback (that might be off for an unplugged jack for example)), the volume which defines the applicable volume range (... and is likely where the incorrect dB information is coming from) and  the channel map, which defines how many channels the control manipulates (in this case it's a mono channel stream)) this get's combined into a single logical control that gets exposed and is accessible for normal ALSA applications.

So you can basically treat the 'Playback' as a piece of metadata to know which parameters have to be combined to form a valid Playback device. So the Playback gets stripped and what remains is the device 'Groove Output' with all the logical controls mentioned to have a relevance here combined.

Offline

#7 2020-10-25 19:01:19

BertiBoeller
Member
Registered: 2009-01-19
Posts: 58

Re: [Solved] PulseAudio does not use hardware volume control

Thanks again for explaining!

Offline

Board footer

Powered by FluxBB