Third. This is just a question. Is this : https://bugs.freedesktop.org/show_bug.cgi?id=86676 actually a pulseaudio bug, or is it an issue with alsa? I'm only asking since Raymond linked something that seemed to belong to
the
alsa project.
This is a bug both in ALSA and in PulseAudio.
The ALSA part (from the user viewpoint) is that the softvol plugin does
not reprocess the already-submitted but buffered samples when the volume changes. But it can't, because that would require an additional thread for monitoring the software volume changes, and such thread does not exist.
The PulseAudio part of the bug is that it does not deactivate softvols,
even though it can apply volume in software itself. In October 2014, in Dusseldorf, a general agreement has been reached on the following arguments:
- ALSA has no API to definitely distinguish softvols from other controls.
- ALSA has the snd_ctl_elem_info_is_user() API function that tells
whether this is a userspace control.
- All softvols are userspace controls.
- There are other kinds of userspace controls, but they are rare.
- If a control is named PCM Playback Volume and is a userspace control,
then it's likely a softvol. Not bulletproof, but a good-enough heuristic.
You can use snd_ctl_elem_info_is_use() to find out the name of those user space controls of the card and ignore those softvol "PCM playback volume" and "Digital Capture Volume" controls
- On finding a softvol, PulseAudio should set it to 100% (so that it
doesn't eat CPU) and don't touch from that point on.
But nobody has implemented this so far.
The relevant code can be placed in the src/modules/alsa/alsa-mixer.c file
in PulseAudio source tree. I guess that element_probe() is a good place. If you know C programming, a contribution would be welcome.||
state.Generic { control.1 { iface CARD name 'HDMI/DP,pcm=3 Jack' value false comment { access read type BOOLEAN count 1 } } control.2 { iface MIXER name 'IEC958 Playback Con Mask' value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' comment { access read type IEC958 count 1 } } control.3 { iface MIXER name 'IEC958 Playback Pro Mask' value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' comment { access read type IEC958 count 1 } } control.4 { iface MIXER name 'IEC958 Playback Default' value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' comment { access 'read write' type IEC958 count 1 } } control.5 { iface MIXER name 'IEC958 Playback Switch' value true comment { access 'read write' type BOOLEAN count 1 } } control.6 { iface PCM device 3 name ELD value '' comment { access 'read volatile' type BYTES count 0 } } control.7 { iface PCM device 3 name 'Playback Channel Map' value.0 0 value.1 0 value.2 0 value.3 0 value.4 0 value.5 0 value.6 0 value.7 0 comment { access 'read write' type INTEGER count 8 range '0 - 36' } } control.8 { iface MIXER name 'PCM Playback Volume' value.0 184 value.1 184 comment { access 'read write user' type INTEGER count 2 range '0 - 255' tlv '0000000100000008ffffec1400000014' dbmin -5100 dbmax 0 dbvalue.0 -1420 dbvalue.1 -1420 } } }
It is strange that your hdmi card have a softvol control ,
Was the softvol control created when you swap the card number by index=1,0 ?