[PATCH 0/4] usb-audio: fix mixer write failure handling

Cássio Gabriel posted 4 patches 1 month, 3 weeks ago
sound/usb/mixer.c          |  17 ++++--
sound/usb/mixer_scarlett.c |   4 +-
sound/usb/mixer_us16x08.c  | 127 +++++++++++++++++++++++++++------------------
3 files changed, 92 insertions(+), 56 deletions(-)
[PATCH 0/4] usb-audio: fix mixer write failure handling
Posted by Cássio Gabriel 1 month, 3 weeks ago
This series fixes usb-audio mixer put() paths that currently report
success even when the underlying device write fails.

The issue exists in the generic mixer core callbacks, the Scarlett
Gen1 enum path, and several Tascam US-16x08 put() callbacks.

The US-16x08 EQ and compressor callbacks have an additional bug: they
update their software shadow state before sending the USB write, so a
failed transfer can leave later get() results out of sync with the
hardware state.

The series is split into four patches:
- propagate write failures in the generic mixer core callbacks
- fix the Scarlett Gen1 enum callback
- propagate write failures in the simple US-16x08 put() callbacks
- commit the US-16x08 EQ and compressor shadow state only after a
successful write

Successful writes are unchanged. Failed writes are now reported
correctly, and the US-16x08 shadow state remains coherent with the
hardware after write errors.

Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
---
Cássio Gabriel (4):
      ALSA: usb-audio: Propagate write errors in generic mixer put callbacks
      ALSA: usb-audio: Propagate errors in scarlett_ctl_enum_put()
      ALSA: usb-audio: Propagate US-16x08 write errors in route/mix EQ-switch put callbacks
      ALSA: usb-audio: Update US-16x08 EQ/comp shadow state after successful writes

 sound/usb/mixer.c          |  17 ++++--
 sound/usb/mixer_scarlett.c |   4 +-
 sound/usb/mixer_us16x08.c  | 127 +++++++++++++++++++++++++++------------------
 3 files changed, 92 insertions(+), 56 deletions(-)
---
base-commit: 99c71f13f9841f8c67fa7595bf0834d3045f5d24
change-id: 20260416-usb-write-error-propagation-20c69e2c5cab

Best regards,
--  
Cássio Gabriel <cassiogabrielcontato@gmail.com>

Re: [PATCH 0/4] usb-audio: fix mixer write failure handling
Posted by Takashi Iwai 1 month, 2 weeks ago
On Sun, 19 Apr 2026 22:30:28 +0200,
Cássio Gabriel wrote:
> 
> This series fixes usb-audio mixer put() paths that currently report
> success even when the underlying device write fails.
> 
> The issue exists in the generic mixer core callbacks, the Scarlett
> Gen1 enum path, and several Tascam US-16x08 put() callbacks.
> 
> The US-16x08 EQ and compressor callbacks have an additional bug: they
> update their software shadow state before sending the USB write, so a
> failed transfer can leave later get() results out of sync with the
> hardware state.
> 
> The series is split into four patches:
> - propagate write failures in the generic mixer core callbacks
> - fix the Scarlett Gen1 enum callback
> - propagate write failures in the simple US-16x08 put() callbacks
> - commit the US-16x08 EQ and compressor shadow state only after a
> successful write
> 
> Successful writes are unchanged. Failed writes are now reported
> correctly, and the US-16x08 shadow state remains coherent with the
> hardware after write errors.
> 
> Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
> ---
> Cássio Gabriel (4):
>       ALSA: usb-audio: Propagate write errors in generic mixer put callbacks
>       ALSA: usb-audio: Propagate errors in scarlett_ctl_enum_put()
>       ALSA: usb-audio: Propagate US-16x08 write errors in route/mix EQ-switch put callbacks
>       ALSA: usb-audio: Update US-16x08 EQ/comp shadow state after successful writes

Applied all to for-next branch.  Thanks.


Takashi
Re: [PATCH 0/4] usb-audio: fix mixer write failure handling
Posted by Takashi Iwai 1 month, 3 weeks ago
On Sun, 19 Apr 2026 22:30:28 +0200,
Cássio Gabriel wrote:
> 
> This series fixes usb-audio mixer put() paths that currently report
> success even when the underlying device write fails.
> 
> The issue exists in the generic mixer core callbacks, the Scarlett
> Gen1 enum path, and several Tascam US-16x08 put() callbacks.
> 
> The US-16x08 EQ and compressor callbacks have an additional bug: they
> update their software shadow state before sending the USB write, so a
> failed transfer can leave later get() results out of sync with the
> hardware state.
> 
> The series is split into four patches:
> - propagate write failures in the generic mixer core callbacks
> - fix the Scarlett Gen1 enum callback
> - propagate write failures in the simple US-16x08 put() callbacks
> - commit the US-16x08 EQ and compressor shadow state only after a
> successful write
> 
> Successful writes are unchanged. Failed writes are now reported
> correctly, and the US-16x08 shadow state remains coherent with the
> hardware after write errors.
> 
> Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>

As this might influence on the actual device behavior significantly,
and it's in a merge window, I postpone the series for 7.2.


thanks,

Takashi
Re: [PATCH 0/4] usb-audio: fix mixer write failure handling
Posted by Cássio Gabriel Monteiro Pires 1 month, 3 weeks ago
On 4/21/26 05:09, Takashi Iwai wrote:
> On Sun, 19 Apr 2026 22:30:28 +0200,
> Cássio Gabriel wrote:
>>
>> This series fixes usb-audio mixer put() paths that currently report
>> success even when the underlying device write fails.
>>
>> The issue exists in the generic mixer core callbacks, the Scarlett
>> Gen1 enum path, and several Tascam US-16x08 put() callbacks.
>>
>> The US-16x08 EQ and compressor callbacks have an additional bug: they
>> update their software shadow state before sending the USB write, so a
>> failed transfer can leave later get() results out of sync with the
>> hardware state.
>>
>> The series is split into four patches:
>> - propagate write failures in the generic mixer core callbacks
>> - fix the Scarlett Gen1 enum callback
>> - propagate write failures in the simple US-16x08 put() callbacks
>> - commit the US-16x08 EQ and compressor shadow state only after a
>> successful write
>>
>> Successful writes are unchanged. Failed writes are now reported
>> correctly, and the US-16x08 shadow state remains coherent with the
>> hardware after write errors.
>>
>> Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
> 
> As this might influence on the actual device behavior significantly,
> and it's in a merge window, I postpone the series for 7.2.

Thanks for the feedback.
 
> thanks,
> 
> Takashi

-- 
Thanks,
Cássio