From: Pavel Hofman <pavel.hofman@ivitera.com>
To: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
Ruslan Bilovol <ruslan.bilovol@gmail.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Julian Scheel <julian@jusst.de>
Subject: RFC: usb: gadget: u_audio: Notifying gadget that host started playback/capture?
Date: Wed, 8 Sep 2021 10:21:39 +0200 [thread overview]
Message-ID: <6ebc2456-a46b-bc47-da76-7a341414c1fb@ivitera.com> (raw)
Hi,
The current audio gadget has no way to inform the gadget side that the
host side has started playback/capture and that gadget-side alsa
processes should be started.
Playback/capture processes on the host side do not get stuck without the
gadget side consuming/producing data (OUT requests are ignored in
u_audio_iso_complete, IN ones send initial zeros in their req->buf).
However, playback/capture processes on the gadget side get stuck without
the host side sending playback OUT packets or capture IN requests and
time out with error. If there was a way to inform the gadget side that
playback/capture has started on the host side, the gadget clients could
react accordingly.
I have been trying to investigate the packet flow/behavior in
u_audio:u_audio_iso_complete, u_audio_start_capture/playback,
u_audio_stop_capture/playback but could not find a pattern which would
recognize that playback or capture has started. I see incoming OUT and
IN requests shortly after gadget enumeration. Also before starting
playback/capture both _start_ and _stop_ method are called. I guess the
actual sequence will be specific for every UAC2, maybe even for every
player/capture app on the host.
Technically a boolean alsa ctrl could be used for each direction
(Capture Running/Playback Running, resp. specific rate or zero in
Capture Rate/Playback Rate in Julian's multiple rates patches I am
preparing), with the gadget client registering for notifications.But
detecting when to set the ctrl value is the key.
Thanks a lot for ideas and recommendations.
Pavel.
next reply other threads:[~2021-09-08 8:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-08 8:21 Pavel Hofman [this message]
2021-10-01 12:38 ` RFC: usb: gadget: u_audio: Notifying gadget that host started playback/capture? Pavel Hofman
2023-09-21 1:30 ` Arun Raghavan
2023-09-22 7:09 ` Pavel Hofman
2023-10-04 23:15 ` Arun Raghavan
2023-10-05 14:30 ` Pavel Hofman
2023-10-25 16:33 ` Arun Raghavan
2023-10-30 16:19 ` Arun Raghavan
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=6ebc2456-a46b-bc47-da76-7a341414c1fb@ivitera.com \
--to=pavel.hofman@ivitera.com \
--cc=jbrunet@baylibre.com \
--cc=julian@jusst.de \
--cc=linux-usb@vger.kernel.org \
--cc=ruslan.bilovol@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox