Linux USB
 help / color / mirror / Atom feed
* RFC: usb: gadget: u_audio: Notifying gadget that host started playback/capture?
@ 2021-09-08  8:21 Pavel Hofman
  2021-10-01 12:38 ` Pavel Hofman
  0 siblings, 1 reply; 8+ messages in thread
From: Pavel Hofman @ 2021-09-08  8:21 UTC (permalink / raw)
  To: linux-usb@vger.kernel.org, Ruslan Bilovol, Jerome Brunet,
	Julian Scheel

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-10-30 16:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-08  8:21 RFC: usb: gadget: u_audio: Notifying gadget that host started playback/capture? Pavel Hofman
2021-10-01 12:38 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox