From: Pavel Hofman <pavel.hofman@ivitera.com>
To: ALSA development <alsa-devel@alsa-project.org>
Subject: Re: [PATCH] ALSA: pcm: accept the OPEN state for snd_pcm_stop()
Date: Mon, 14 Feb 2022 13:23:20 +0100 [thread overview]
Message-ID: <d358cda1-d1d6-ac70-7c18-e57cc97b72ed@ivitera.com> (raw)
In-Reply-To: <1794d3b3-9838-ae90-bb54-79e2b4d14197@perex.cz>
Dne 13. 01. 22 v 16:08 Jaroslav Kysela napsal(a):
> On 13. 01. 22 14:45, Takashi Iwai wrote:
>
>>> Also ideally, there may be a check in hw_params, if parameters
>>> (buffers) are changed, but the implementation is not so easy. Maybe we
>>> can allow OPEN ->
>>> PREPARE transition for this case, so the applications may just restart
>>> the streaming in the most light way.
>>
>> Hmm. Reading more about those restrictions and requirements, I feel
>> that this might be better implemented in the gadget driver side
>> locally at first. Basically we can handle similarly: add a new local
>> flag, set it at the stream stop, and return an error at prepare until
>> hw_params gets reconfigured. This might be even smaller changes?
>
> Pavel reported that stop to SETUP is not enough for sox, but it's true
> that the driver may fail in the prepare() callback until the standard
> stream operation is not recovered. I think that sox is trying to recover
> and it succeeds - then the I/O timeout occurs.
>
> Ref:
> https://lore.kernel.org/alsa-devel/9635d70f-dc12-f9ed-29f5-ce34a1d4b112@ivitera.com/
>
>
> The gadget driver (drivers/usb/gadget/function/u_audio.c) has empty
> prepare callback at the moment.
>
> Pavel, could you try to add the no-stream flag management to the gadget
> driver and return an error in the prepare callback in this case?
My apology for the delay. I can make the changes to the gadget to be
prepared for the alsa change. Let me recap to see if I understand your
plan correctly:
* Currently the stopped stream is indicated by unsetting prm->active
https://kernel.googlesource.com/pub/scm/linux/kernel/git/gregkh/usb/+/554237f2bb62c4fcf01372e4c63d3e0062f27bac/drivers/usb/gadget/function/u_audio.c#502
.
* A hw_params_set flag indicating that hw params have been configured
should be set at
https://kernel.googlesource.com/pub/scm/linux/kernel/git/gregkh/usb/+/554237f2bb62c4fcf01372e4c63d3e0062f27bac/drivers/usb/gadget/function/u_audio.c#423
. Where should it be unset? At snd_pcm_ops.stop (currently empty), at
https://kernel.googlesource.com/pub/scm/linux/kernel/git/gregkh/usb/+/554237f2bb62c4fcf01372e4c63d3e0062f27bac/drivers/usb/gadget/function/u_audio.c#494
for active = false, or somewhere else?
* A check should be added to snd_pcm_ops.prepare which fails if the
hw_params_set flag is unset. What error type should the fail return?
Thanks a lot for help.
Best regards,
Pavel.
next prev parent reply other threads:[~2022-02-14 12:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-13 11:31 [PATCH] ALSA: pcm: accept the OPEN state for snd_pcm_stop() Jaroslav Kysela
2022-01-13 12:56 ` Takashi Iwai
2022-01-13 13:32 ` Jaroslav Kysela
2022-01-13 13:45 ` Takashi Iwai
2022-01-13 15:08 ` Jaroslav Kysela
2022-02-14 12:23 ` Pavel Hofman [this message]
2022-01-13 17:10 ` kernel test robot
2022-01-13 17:10 ` kernel test robot
2022-01-13 17:10 ` kernel test robot
2022-01-13 17:18 ` Nathan Chancellor
2022-01-13 17:18 ` Nathan Chancellor
2022-01-13 17:18 ` Nathan Chancellor
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=d358cda1-d1d6-ac70-7c18-e57cc97b72ed@ivitera.com \
--to=pavel.hofman@ivitera.com \
--cc=alsa-devel@alsa-project.org \
/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.