Re: [RFC PATCH 04/14] sound: usb: card: Introduce USB SND vendor op callbacks

From: Takashi Iwai
Date: Tue Jan 03 2023 - 07:50:07 EST


On Tue, 03 Jan 2023 13:20:48 +0100,
Oliver Neukum wrote:
>
>
>
> On 30.12.22 08:10, Wesley Cheng wrote:
>
> > It may depend on how the offloading is implemented, but we do have a mechanism to force the audio stream off from the qc_usb_audio_offload. Regardless of if the UDEV is suspended first, or the USB backend, as long as we ensure that the offloading is disabled before entering suspend, I think that should be sufficient.
>
> You would presumably output garbage, if the UDEV is asleep but the backend is not.
>
>
> > The reset_resume() path is fine.  Bus reset is going to cause a disconnect() callback in the offload driver, in which we already have the proper handling for ensuring the offload path is halted, and we reject any incoming stream start requests.
>
> How? If we go the reset_resume() code path, we find that usb-audio does not make
> a difference between regular resume() and reset_resume()

Note that, for USB audio, there is no much difference between resume()
and reset_resume(), especially about the PCM stream handling that is
the main target for the offload (the mixer isn't handled there).
And for the PCM, we just set the power state for UAC3, and that's
all. All the rest is handled by the PCM core handler as usual.


Takashi