All of lore.kernel.org
 help / color / mirror / Atom feed
* [alsa-devel] Options for u_audio.c behavior when UAC2 host is disconnected/idle
@ 2020-02-10  7:58 Pavel Hofman
  0 siblings, 0 replies; only message in thread
From: Pavel Hofman @ 2020-02-10  7:58 UTC (permalink / raw)
  To: alsa-devel

Hi,

I would like to discuss options to make the g_audio device more usable.
Currently if the USB UAC2 function does not supply/consume any audio
data (USB disconnected or the host side is not using the UAC2 gadget,
the g_audio devices (both capture and playback) are waiting, leading
eventually to an error. This makes using the feature rather inconvenient.

Possible options (certainly more are available)

1) The alsa devices will be openable at any time and when the UAC2 is
not producing/consuming, the alsa devices will be generating
zeros/dropping samples. Dropping samples would be similar to the
snd-aloop behavior.

2) Opening the alsa devices will fail when the UAC2 is not actively
running, and the pcm stream will be closed when UAC2 stops being active.
This is similar to how SPDIF receivers are coded in alsa drivers - if
change in the incoming SPDIF stream is detected (no samples, different
sample rate), the pcm stream is closed
https://github.com/torvalds/linux/blob/master/sound/i2c/other/ak4117.c#L504
It is up to the application to handle the error/close.

The behavior could be configurable via some params, if needed.

Thanks a lot for any suggestions and recommendations.

Best regards,


Pavel.

P.S.: I posted the same message to linux-usb mailing list, with no
response. I think this issue is more alsa-related, hence re-posting to
alsa-devel. Or should I keep both mailing lists posted? Thanks for
understanding.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-10  7:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10  7:58 [alsa-devel] Options for u_audio.c behavior when UAC2 host is disconnected/idle Pavel Hofman

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.