Skip to content

ALSA: usb-audio: Add quirks for linear volume devices and deconflict VID

Rong Zhang linux-doc linux-sound lkml stable 3 versions – Applied

Status from this message: Applied all patches now to for-next branch. Thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 1 replyApplied
  2. v28 patches 2 repliesSuperseded
  3. v19 patches 7 repliesSuperseded

Changes in v3 from the cover letter

- Adopt __free(kfree) on string buffers as it turns out to be able to handle ERR_PTR() gracefully (thanks Takashi Iwai)
- Improve readability by replacing the goto pattern with `p->usb_string_match && p->usb_string_match->*'. The compiler should generate equivalent control paths thanks to the optimizer
- Link to v2: https://lore.kernel.org/r/[email protected]/

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/8Revert "ALSA: usb: Increase volume range that triggers a warning"sound/usb/mixer.c+4 -30 replies
2/8ALSA: usb-audio: Add helper function for volume range checkssound/usb/mixer.c+27 -160 replies
3/8ALSA: usb-audio: Improve volume range checkssound/usb/mixer.c+48 -60 replies
4/8ALSA: usb-audio: Support string-descriptor-based quirk table entrysound/usb/quirks.c+78 -00 replies
5/8ALSA: usb-audio: Deconflict VID between Focusrite Novation & MV-SILICONsound/usb/quirks.c+3 -00 replies
6/8ALSA: usb-audio: Add QUIRK_FLAG_MIXER_{PLAYBACK,CAPTURE}_LINEAR_VOLDocumentation/sound/alsa-configuration.rst sound/usb/mixer_quirks.c sound/usb/quirks.c +1 more+55 -00 replies
7/8ALSA: usb-audio: Add linear volume quirk for Hotone Audio Pulze Minisound/usb/quirks.c+2 -00 replies
8/8ALSA: usb-audio: Apply linear volume quirk on MV-SILICON devicessound/usb/mixer_quirks.c+22 -00 replies

Reviews trailers per patch

1 of 8 patches has a Reviewed-by or Acked-by.

PatchArun Raghavan
1/8A-b
2/8
3/8
4/8
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/8] ALSA: usb-audio: Add quirks for linear volume devices and deconflict VID

Some quirky devices tune their volume by linearly tuning the voltage level (linear volume). In other words, such devices has a linear TLV mapping of DECLARE_TLV_DB_LINEAR(scale, TLV_DB_GAIN_MUTE, 0).

The series mainly adds quirk flags MIXER_PLAYBACK_LINEAR_VOL and MIXER_CAPTURE_LINEAR_VOL to represent this case respectively for playback and capture mixers. Afterward, apply these quirk flags on them.

Some MV-SILICON devices with these quirks also have another quirk: VID conflicts with Focusrite Novation (0x1235). Hence, add support for string-descriptor-based quirk table entries and define an entry for MV- SILICON to deconflict them.

Some improvements to the logic of volume range checks is also included in the series to help identify quirky devices with linear volume.

Changes in v3:
- Adopt __free(kfree) on string buffers as it turns out to be able to handle ERR_PTR() gracefully (thanks Takashi Iwai)
- Improve readability by replacing the goto pattern with `p->usb_string_match && p->usb_string_match->*'. The compiler should generate equivalent control paths thanks to the optimizer
- Link to v2: https://lore.kernel.org/r/[email protected]/

Changes in v2:
- Separate [PATCH v1 6/9] into https://lore.kernel.org/r/[email protected]/
- Alloc string buffers with kmalloc() instead of on stack (thanks
Takashi Iwai)
- Get string descriptors in a neater way (ditto)
- Tiny differences compared to Takashi's sugeestion:
- Use IS_ERR_OR_NULL() || strcmp()' instead of !IS_ERR_OR_NULL() && strcmp()', so failure in getting the string descriptor won't
resulting in quirk flags being applied to irrelevant devices
- Use trivial goto cleanup patterns instead of `__free(kfree)' as the latter can't handle ERR_PTR()
- Tiny differences compared to my previous reply:
- Use usb_string() as Takashi suggested instead of usb_cache_string(),
so that we can retrieve the errno and print it out on failure
- Link to v1: https://lore.kernel.org/r/[email protected]/

Rong Zhang (8):
Revert "ALSA: usb: Increase volume range that triggers a warning"
ALSA: usb-audio: Add helper function for volume range checks
ALSA: usb-audio: Improve volume range checks
ALSA: usb-audio: Support string-descriptor-based quirk table entry
ALSA: usb-audio: Deconflict VID between Focusrite Novation &
MV-SILICON
ALSA: usb-audio: Add QUIRK_FLAG_MIXER_{PLAYBACK,CAPTURE}_LINEAR_VOL
ALSA: usb-audio: Add linear volume quirk for Hotone Audio Pulze Mini
ALSA: usb-audio: Apply linear volume quirk on MV-SILICON devices

 Documentation/sound/alsa-configuration.rst |  7 ++
 sound/usb/mixer.c                          | 84 +++++++++++++++++----
 sound/usb/mixer_quirks.c                   | 56 ++++++++++++++
 sound/usb/quirks.c                         | 85 ++++++++++++++++++++++
 sound/usb/usbaudio.h                       | 12 +++
 5 files changed, 229 insertions(+), 15 deletions(-)

base-commit: 63082d085f52a3c77ef572d71d2d08c642da2a55

Signature · 1 line
2.53.0