NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
kern/59712: hdaudio driver exposes nonexistent volume controls
>Number: 59712
>Category: kern
>Synopsis: hdaudio driver exposes nonexistent volume controls
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Oct 19 13:15:00 +0000 2025
>Originator: nia
>Release: any with hdaudio
>Organization:
The SliderBSD Foundation
>Environment:
>Description:
My audio chipset (and indeed any realtek chipset that i've seen)
has mute-only output amplifier controls:
[ 1.044129] hdaudio1 at pci7 dev 0 function 4: HD Audio Controller
[ 1.044129] hdaudio1: interrupting at msi6 vec 0
[ 1.044129] hdaudio1: HDA ver. 1.0, OSS 4, ISS 4, BSS 0, SDO 1, 64-bit
[ 1.044129] hdafg1 at hdaudio1: Realtek ALC897
[ 1.044129] add ctrl outamp mute=0 step=87 size=2 offset=87
[ 1.044129] add ctrl outamp mute=0 step=87 size=2 offset=87
[ 1.044129] add ctrl outamp mute=0 step=87 size=2 offset=87
[ 1.044129] add ctrl outamp mute=0 step=87 size=2 offset=87
[ 1.044129] add ctrl outamp mute=1 step=0 size=0 offset=0
[ 1.044129] add ctrl outamp mute=1 step=0 size=0 offset=0
[ 1.044129] add ctrl outamp mute=1 step=0 size=0 offset=0
[ 1.044129] add ctrl outamp mute=1 step=0 size=0 offset=0
[ 1.044129] add ctrl outamp mute=1 step=0 size=0 offset=0
[ 1.044129] add ctrl outamp mute=1 step=0 size=0 offset=0
[ 1.044129] add ctrl outamp mute=1 step=0 size=0 offset=0
[ 1.044129] add ctrl outamp mute=1 step=0 size=0 offset=0
[ 1.044129] add ctrl outamp mute=0 step=87 size=2 offset=87
These are the ones with step=0 and size=0.
Currently the way the driver tries to handle these is quite odd.
It creates a normal mute control, but also creates a volume control
with delta=256 (i.e. not possible to modify). This clutters up
mixer interfaces and i've had to put a workaround for this in aiomixer.
The code contains some hacky workarounds for these fake controls,
e.g.:
if (ctl->ctl_step == 0)
divisor = 128; /* ??? - just avoid div by 0 */
else
divisor = 255 / ctl->ctl_step;
hdafg_control_amp_set(ctl, HDAUDIO_AMP_MUTE_NONE,
mc->un.value.level[AUDIO_MIXER_LEVEL_LEFT] / divisor,
mc->un.value.level[AUDIO_MIXER_LEVEL_RIGHT] / divisor);
>How-To-Repeat:
run mixerctl -la on a machine with realtek audio hardware
>Fix:
The way that `hdafg_build_mixers` is written means that volume-only
controls (with no mute) are possible, but mute-only controls with
no volume are not possible. This restriction does not come from any
particular API or specification, it's just a quirk of the driver.
The driver should be modified to build only mute enums for those
mute-only controls.
I should get around to this.
Home |
Main Index |
Thread Index |
Old Index