All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hui Wang <hui.wang@canonical.com>
To: Kai Heng Feng <kai.heng.feng@canonical.com>,
	Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [alsa-devel] [PATCH] ALSA: usb-audio: set the interface format after resume on Dell WD19
Date: Thu, 19 Dec 2019 14:23:41 +0800	[thread overview]
Message-ID: <e58306bc-8a2c-dcb5-c875-0dd4a2f3a51c@canonical.com> (raw)
In-Reply-To: <EB061C4E-72BE-491B-ABAE-DFB96BEB7D7C@canonical.com>


On 2019/12/19 下午12:55, Kai Heng Feng wrote:
> Hi Hui and Takashi,
>
>> On Dec 19, 2019, at 3:06 AM, Takashi Iwai <tiwai@suse.de> wrote:
>>
>> On Wed, 18 Dec 2019 14:26:50 +0100,
>> Hui Wang wrote:
>>> Recently we found the headset-mic on the Dell Dock WD19 doesn't work
>>> anymore after s3 (s2i or deep), this problem could be workarounded by
>>> closeing (pcm_close) the app and then reopening (pcm_open) the app, so
>>> this bug is not easy to be detected by users.
>>>
>>> When problem happens, retire_capture_urb() could still be called
>>> periodically, but the size of captured data is always 0, it could be
>>> a firmware bug on the dock. Anyway I found after resuming, the
>>> snd_usb_pcm_prepare() will be called, and if we forcibly run
>>> set_format() to set the interface and its endpoint, the capture
>>> size will be normal again. This problem and workaound also apply to
>>> playback.
>>>
>>> To fix it in the kernel, add a quirk to let set_format() run
>>> forcibly once after resume.
>>>
>>> Signed-off-by: Hui Wang <hui.wang@canonical.com>
>> Thanks, the workaround looks reasonable.
>> I applied it now with Cc to stable.
> I am not entirely sure it’s a kernel bug. [1] [2] can also fix the issue.
>
> Since USB audio doesn’t have SNDRV_PCM_INFO_RESUME capability,
> userspace shouldn’t try to use snd_pcm_resume(). Commit [1] uses
> snd_pcm_drop() to make the device leave suspended state and the device
> behaves correctly with the fix.
>
> [1] https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/f7b3537bbf9a6916ee3fd72a82025519b4c346f5
> [2] https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/734a00c849815a45697970d593068c301a04ebbb

Thanks for sharing the info, [1] could workaround this bug because it 
finally called pcm_close() and pcm_open(), [2] doesn't change the 
executing path in th PA, it is a cosmetic improvement for [1].

I guess it is a firmware problem, and could be fixed in the kernel.  
Because I tested many other usb audio cards, they don't need workaroud 
of [1], they all could playback and capture after resuming, so this 
problem is specific to this hardware. And in theory a device should work 
same before and after suspend,  it should not depend on userspace to 
close it and reopen it. After adding this fix, this usb audio card could 
work after resuming even on a system without PA. And this kernel patch 
doesn't have any conflict with [1]/[2] in the PA, they could work well 
together.

Thanks,

Hui.


> Kai-Heng
>
>>
>> Takashi
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel@alsa-project.org
>> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2019-12-19  6:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18 13:26 [alsa-devel] [PATCH] ALSA: usb-audio: set the interface format after resume on Dell WD19 Hui Wang
2019-12-18 19:06 ` Takashi Iwai
2019-12-19  4:55   ` Kai Heng Feng
2019-12-19  6:23     ` Hui Wang [this message]
2019-12-19  6:37       ` Kai Heng Feng
2019-12-19  8:35         ` Takashi Iwai
2019-12-19  8:46           ` Kai Heng Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e58306bc-8a2c-dcb5-c875-0dd4a2f3a51c@canonical.com \
    --to=hui.wang@canonical.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.