[PATCH v3 0/2] ALSA: usb-audio: the Topping M62's vendor controls

Mikhail Gavrilov <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,org.kernel.vger.linux-input,org.kernel.vger.linux-sound
Message-ID <[email protected]>
v3 answers the automated review of v2. Four of its five findings were
real, and one of them was a bug a user would have met on every boot.

  - The enum refused "Unknown", which is the value it reports until a
    hand has chosen. alsactl stores and restores that value like any
    other, so the refusal failed a restore of the driver's own report
    -- observed here as "Cannot write control ... Invalid argument"
    from alsactl. Writing "Unknown" is now a quiet no-op rather than an
    error, since it is a report and not a choice either way.

  - The hardware is reached under snd_usb_lock_shutdown(), the way the
    rest of this directory reaches it. Without it nothing made the
    teardown wait for a control callback already in flight.

  - Suspend and resume are handled rather than survived: the URB does
    not outlive a system sleep, so notifications stopped for good after
    the first one. The resume path resubmits, subscribes again and asks
    for the state, which also refreshes a cache that may have gone
    stale while the panel was reachable and the driver was not.

  - The claimed interface is released, on the error path and at
    teardown, so unbind and bind again works instead of failing at the
    claim. That needed a release helper beside snd_usb_claim_iface(),
    for the same reason the claim needed one.

  - A mutex spans each write from the comparison to the cache update.
    The review called two writers reaching the device in one order and
    the cache in the other a race, and it is one, though a narrow one.

Nothing else changed since v2; the questions in that cover letter about
the third form of the driver and about a control that can be written
but not read still stand.

Tested on the hardware as before: values arrive by themselves after
probe, a front panel knob still reaches the driver ten minutes later, a
write reaches the analogue stage -- one source recorded at gain 30 and
at gain 60 differs by 29.7 dB against the 30.0 dB the taper table
predicts -- and for 2/2 the audible test, where pointing an output away
from the bus being played silences it and pointing it back returns the
sound. On a KASAN and lockdep kernel, including unplug while a stream
was running, and now also across a suspend and resume cycle; no
reports.

Mikhail Gavrilov (2):
  ALSA: usb-audio: expose the Topping M62's analogue gains as mixer
    controls
  ALSA: usb-audio: let the M62's outputs say what they listen to

 MAINTAINERS               |   6 +
 drivers/hid/hid-ids.h     |   3 +
 drivers/hid/hid-quirks.c  |   2 +
 sound/usb/Makefile        |   1 +
 sound/usb/card.c          |  19 +
 sound/usb/mixer_quirks.c  |   5 +
 sound/usb/mixer_topping.c | 709 ++++++++++++++++++++++++++++++++++++++
 sound/usb/mixer_topping.h |   7 +
 sound/usb/usbaudio.h      |   4 +
 9 files changed, 756 insertions(+)
 create mode 100644 sound/usb/mixer_topping.c
 create mode 100644 sound/usb/mixer_topping.h


base-commit: 2709dd5ae32f0828f386327c76bba9f39f63a1c6
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.