-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UAC2: Implement feedback by fifo counting. #2328
Conversation
476a593
to
65225c0
Compare
Test welcomed @Protoxy22 @Lurcy38 @kf6gpe @PanRe |
Wow great work, I will have time to test this next week on an STM32H743 Eval Board with USB HS Thank you |
a48a5bd
to
db6b822
Compare
This is interesting. I'm curious where can I find audio_debug.py. Any ideas? Thanks a lot! |
Just in the PR examples/device/uac2_speaker_fb/src/audio_debug.py |
Ah, so not in main yet. Ok, thanks! |
great :) , I will be very happy to test this implementation in my app, but i cannot reach the branch rx_fb , how to do ? |
@Lurcy38 it's under my user space |
@hathach After more tests this PR is ready. |
Hi, what is the status of this PR? what is missing for it to be approved? |
Hi, great work, Could this be due to the fact that macOS does not accept this feedback method or some other reason such as incorrect descriptors for the MAC? Thanks! |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Back from holiday...
No it's not how it works... |
@Marcus2060 What do you mean crash, does the kernel panic or having popping sound or something else ? You can try to change tinyusb/src/class/audio/audio_device.h Line 196 in 2720392
From other people's experience it seems this format incompatibility issue exist.
I see there are 3 solutions:
|
Hi, I've done other experiments and I get the impression that the usbd_edpt_xfer() function on low-level stack doesn't work well when we try to send 3 bytes. MAC:
Windows:
Also: So, could the problem be on the low level of the Tinyusb stack when we try to send 3 bytes feedback via usbd_edpt_xfer() to Host ??? Thanks! |
No it can't be, you also tested 3 bytes works on MAC.
It's true.
Pico use UAC 1.0 while TUSB uses UAC 2.0, you can see their descriptors are quite different. |
Hi,
No, my previous comment is precisely because I tested that the 3 bytes don't seem to work (see my pont 1, 2 about MAC):
I highlighted the 3 bytes sent problem because: Thanks anyway for your attention. |
Sorry I've some problem understanding, you mean |
Below 4 different tests on MAC using 10.14 format:
Below the function to send feedback (feedback value is an uint32_t) : |
Last commit optimized debug interface fifo count, it's not the real count inside UAC class but a replication, it was less accurate. |
maybe someone is interested in a rebased version to the latest master |
Thank you, will rebase when free, also move #2628 into example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impressive work! Thank you all for your effort in improving the UAC2 driver!!
thank you to everyone! |
Woo love to see this finally get in! Thanks for keeping it going :D |
great! hello proper uac:) |
Nice work @HiFiPhile ! But I am not sure if the Descriptor is requested before the configuration Descriptor. Because I think it needs to change the maxPackstSize for the feedback endpoint, correct? Other than that we could force renumeration by disconnecting and connecting the USB device virtually 🤣 EDIT: LOL of course that is patented. Insane. https://patents.google.com/patent/US20120054372A1/en |
Yes the detection should be done before configuration descriptor request, that's why I put Windows' descriptor as default. I think 0xEE is requested in the same order as MsOS 2.0 descriptor.
I think I read it, many patents are just some nonsense... |
@HiFiPhile thanks a lot for your effort. I looked through this and was wondering if it's wise to use the BOS Descriptor for the quirk detection because apparently the BOS Descriptor is mandatory only for USB versions > 2.0 if I read correctly. In addition, device, config and string Descriptor order is already enough to distinguish between MacOS and not-MacOS. What do you think? |
You are right, config and string Descriptor is already enough to distinguish between MacOS and not-MacOS. It's a full detection method from #2628 which allows each OS to be treated differently. In my testing BCD 2.01 is well supported, normally it shouldn't be an issue. |
Describe the PR
Compared to other methods the only thing needed is add a callback to set sample rate, all calculations are done inside the class.
A new example
uac2_speaker_fb
has been added to show how the mechanism work with a stereo speaker. Both FS (STM32F429) and HS (LPC55S69) configs are tested and FIFO level is well maintained half filled.A HID debug interface can be enabled by setting
CFG_AUDIO_DEBUG=1
which export UAC class information and can be read byaudio_debug.py
.