lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 04 Mar 2024 09:15:18 +0100
From: Takashi Iwai <tiwai@...e.de>
To: Kenny Levinsen <kl@...wtf>
Cc: Jaroslav Kysela <perex@...ex.cz>,
	Takashi Iwai <tiwai@...e.com>,
	linux-sound@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ALSA: usb-audio: Name feature ctl using output if input is PCM

On Sat, 02 Mar 2024 00:11:07 +0100,
Kenny Levinsen wrote:
> 
> When building feature controls from a unit without a name, we try to
> derive a name first from the feature unit's input, then fall back to the
> output terminal.
> 
> If a feature unit connects directly to a "USB Streaming" input terminal
> rather than a mixer or other virtual type, the control receives the
> somewhat meaningless name "PCM", even if the output had a descriptive
> type such as "Headset" or "Speaker".
> 
> Here is an example of such AudioControl descriptor from a USB headset
> which ends up named "PCM Playback" and is therefore not recognized as
> headphones by userspace:
> 
>       AudioControl Interface Descriptor:
>         bLength                12
>         bDescriptorType        36
>         bDescriptorSubtype      2 (INPUT_TERMINAL)
>         bTerminalID             4
>         wTerminalType      0x0101 USB Streaming
>         bAssocTerminal          5
>         bNrChannels             2
>         wChannelConfig     0x0003
>           Left Front (L)
>           Right Front (R)
>         iChannelNames           0
>         iTerminal               0
>       AudioControl Interface Descriptor:
>         bLength                 9
>         bDescriptorType        36
>         bDescriptorSubtype      3 (OUTPUT_TERMINAL)
>         bTerminalID             5
>         wTerminalType      0x0402 Headset
>         bAssocTerminal          4
>         bSourceID               6
>         iTerminal               0
>       AudioControl Interface Descriptor:
>         bLength                13
>         bDescriptorType        36
>         bDescriptorSubtype      6 (FEATURE_UNIT)
>         bUnitID                 6
>         bSourceID               4
>         bControlSize            2
>         bmaControls(0)     0x0002
>           Volume Control
>         bmaControls(1)     0x0000
>         bmaControls(2)     0x0000
>         iFeature                0
> 
> Other headsets and DACs I tried that used their output terminal for
> naming only did so due to their input being an unnamed sidetone mixer.
> 
> Instead of always starting with the input terminal, check the type of it
> first. If it seems uninteresting, invert the order and use the output
> terminal first for naming.
> 
> This makes userspace recognize headsets with simple controls as
> headphones, and leads to more consistent naming of playback devices
> based on their outputs irrespective of sidetone mixers.
> 
> Signed-off-by: Kenny Levinsen <kl@...wtf>

Thanks, applied now to for-next branch.


Takashi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ