All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 0/3] UAC2 Gadget: feedback endpoint support
@ 2020-11-12 20:42 Glenn Schmottlach
  0 siblings, 0 replies; 20+ messages in thread
From: Glenn Schmottlach @ 2020-11-12 20:42 UTC (permalink / raw)
  To: linux-usb, Ruslan Bilovol, peter.chen

Hi Ruslan -

> I applied your patches, but WIN10 still can't recognize it well.
> The UAC1 is OK for WIN10 with the below same configuration.
> Any debug information you would like to know to check it?

> if [ "$FUNC" =3D=3D "uac2" ]; then
> mkdir functions/$FUNC".0"
> echo 2 > functions/$FUNC".0"/p_ssize
> echo 48000 > functions/$FUNC".0"/p_srate
> echo 3 > functions/$FUNC".0"/p_chmask
>
> echo 2 > functions/$FUNC".0"/c_ssize
> echo 48000 > functions/$FUNC".0"/c_srate
> echo 3 > functions/$FUNC".0"/c_chmask
> #echo 4 > functions/$FUNC".0"/req_number
> ln -s functions/$FUNC".0" configs/c.1
> echo high-speed > /sys/kernel/config/usb_gadget/g1/max_speed

I too applied your patch and configured my UAC2 gadget with the
following pertinent parameters:

mkdir -p "/sys/kernel/config/usb_gadget/g_multi/functions/uac2.usb0"
echo "${req_number:-4}" >
"/sys/kernel/config/usb_gadget/g_multi/functions/uac2.usb0/req_number"
echo "${c_ssize:-4}" >
"/sys/kernel/config/usb_gadget/g_multi/functions/uac2.usb0/c_ssize"
echo "${c_srate:-48000}" >
"/sys/kernel/config/usb_gadget/g_multi/functions/uac2.usb0/c_srate"
echo "${c_chmask:-0xFFFFFFFF}" >
"/sys/kernel/config/usb_gadget/g_multi/functions/uac2.usb0/c_chmask"
echo "${c_sync:-adaptive}" >
"/sys/kernel/config/usb_gadget/g_multi/functions/uac2.usb0/c_sync"
echo "${p_ssize:-4}" >
"/sys/kernel/config/usb_gadget/g_multi/functions/uac2.usb0/p_ssize"
echo "${p_srate:-48000}" >
"/sys/kernel/config/usb_gadget/g_multi/functions/uac2.usb0/p_srate"
echo "${p_chmask:-0xFFFFFFFF}" >
"/sys/kernel/config/usb_gadget/g_multi/functions/uac2.usb0/p_chmask"

Unfortunately, under Windows 10 I get the following error loading the driver:

This device cannot start. ( Problem Code 10)
Problem Status: C0440022

So the generic Windows (Thesycon) UAC2 driver appears to fail loading
the Linux UAC2 gadget device. Can you share with us your configuration
or how you tested this with Windows 10? I tested audio capture with
another Linux PC running Audacity and it was correctly detected and
seemed to work. I'm hoping it's a simple misconfiguration issue. Can
you offer suggestions?

Thanks,

Glenn

^ permalink raw reply	[flat|nested] 20+ messages in thread
* [PATCH 0/3] UAC2 Gadget: feedback endpoint support
@ 2020-11-08  0:18 Ruslan Bilovol
  2020-11-11  9:30 ` Peter Chen
  0 siblings, 1 reply; 20+ messages in thread
From: Ruslan Bilovol @ 2020-11-08  0:18 UTC (permalink / raw)
  To: balbi; +Cc: linux-usb, gschmottlach

Current UAC2 gadget implements capture/sync paths
as two USB ISO ASYNC endpoints (IN and OUT).

This violates USB spec which says that ISO ASYNC OUT endpoint
should have feedback companion endpoint.
See USB2.0 spec  "5.12.4.1 Synchronization Type": asynchronous
sink provides explicit feedback (isochronous pipe).
Interesting that for ISO ASYNC *IN* endpoint respective
feedback isn't required since source provides implicit
feedforward (data stream).

While it's not an issue if UAC2 Gadget is connected to
Linux host (Linux ignores missing feedback endpoint),
with other hosts like Windows or MacOS the UAC2 Gadget
isn't enumerated due to missing feedback endpoint.

This patch series adds feedback endpoint support to
UAC2 function, new control to UAC2 mixer which can
be used by userspace tools (like alsaloop from alsa-utils)
for updating feedback frequency reported to the host.
This is useful for usecases when UAC2 Gadget's audio
samples are played to another codec or audio card
with its own internal freerunning clock so host can
be notified that more/less samples are required.

The alsaloop tool requires some (relatively small)
modifications in order to start support driving
feedback frequency through UAC2 mixer control.
That change will be sent as a separate patch
to ALSA community.

Also added ability to switch ISO ASYNC OUT endpoint into
adaptive endpoint which doesn't require feedback endpoint
(as per USB spec).

Ruslan Bilovol (3):
  usb: gadget: f_uac2/u_audio: add feedback endpoint support
  usb: gadget: f_uac2: add adaptive sync support for capture
  usb: gadget: u_audio: add real feedback implementation

 Documentation/ABI/testing/configfs-usb-gadget-uac2 |   1 +
 Documentation/usb/gadget-testing.rst               |   1 +
 drivers/usb/gadget/function/f_uac2.c               | 118 ++++++++++-
 drivers/usb/gadget/function/u_audio.c              | 217 ++++++++++++++++++++-
 drivers/usb/gadget/function/u_audio.h              |  10 +
 drivers/usb/gadget/function/u_uac2.h               |   2 +
 6 files changed, 345 insertions(+), 4 deletions(-)

-- 
1.9.1


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

end of thread, other threads:[~2020-12-11  7:24 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 20:42 [PATCH 0/3] UAC2 Gadget: feedback endpoint support Glenn Schmottlach
  -- strict thread matches above, loose matches on Subject: below --
2020-11-08  0:18 Ruslan Bilovol
2020-11-11  9:30 ` Peter Chen
2020-11-12 23:20   ` Ruslan Bilovol
2020-11-13 15:35     ` Glenn Schmottlach
2020-11-22 19:51       ` Ruslan Bilovol
2020-11-25 19:28         ` Glenn Schmottlach
2020-11-28 23:26           ` Ruslan Bilovol
2020-12-01 21:43             ` Glenn Schmottlach
2020-12-02 22:04               ` Glenn Schmottlach
2020-12-03 10:09                 ` Peter Chen
2020-12-03 22:07                   ` Glenn Schmottlach
2020-12-10 12:59                   ` Ruslan Bilovol
2020-12-11  7:22                     ` Peter Chen
2020-12-10 12:46               ` Ruslan Bilovol
2020-11-26 13:16         ` Jerome Brunet
2020-11-26 13:44           ` Pavel Hofman
2020-12-04 14:39             ` Ruslan Bilovol
2020-12-04 18:08               ` Pavel Hofman
2020-12-04 14:35           ` Ruslan Bilovol

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.