-
Notifications
You must be signed in to change notification settings - Fork 46
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
Audio class #10
Comments
While it would be certainly nice to have, I don't have any projects planned at the moment that would require an Audio class interface, so there is no timeline for it. Of course there are incentives that could change this, and I don't just mean financial ones, if you are developing a fascinating project I might help you out just for the fun of it. |
I am developing a open-source project of DDC/SDR Radio, and I plan to make sound output through USB. Also, now the project has 2 virtual COM ports for debugging output and control from a computer. I tried to make an audio class by analogy with the CDC, but my knowledge is clearly not enough for this. |
As far as I have seen, there are two important Audio class documents on the USB implementers forum: the latest official full-blown audio class spec and a simplified spec for the most common use-cases. I'd recommend that you check the latter. You can also get inspiration from other open-source projects, such as Mbed. As a starting point I recommend that you check how the NCM implementation initializes the endpoints, as the audio class has the same mechanism, namely that the interface-specific endpoints are only opened once the alternate setting is set to the non-default 1. Another thing to bear in mind is that isochronous transfers aren't tested yet, so you might run into problems on the driver level. If that happens, document as much as you can from the circumstances, and open an issue. |
Thank you for the information provided! class file https://github.com/XGudron/UA3REO-DDC-Transceiver/blob/master/STM32/USBDevice/Class/AUDIO/usbd_audio.c errors on usb sniffer (device to host): https://yadi.sk/i/8UNzux8ygufiig |
Can you provide a permanent link to the source code? The current links are broken. |
https://github.com/XGudron/UA3REO-DDC-Transceiver/blob/1.4/STM32/USBDevice/Class/AUDIO/usbd_audio.c https://github.com/XGudron/UA3REO-DDC-Transceiver/blob/1.4/STM32/USBDevice/Include/usbd_audio.h I could not make isochronous transfers, I had to rewrite the standard solution from stm32cube to the composite structure (CDC+CDC+Audio). |
So, the biggest issue with the code is these lines: USBD_ReturnType ret=USBD_EpReceive(pdev->Base.Device, pdev->Config.InEpNum, haudio->buffer, AUDIO_OUT_PACKET); The directions in the USB context are observed from the Host point of view, so the IN direction means from Device to Host. To receive data on the device side, you have to use the OUT endpoints. These calls should use the OutEpNum parameter, which should be in the 1..15 range (which is further limited by hardware). |
Exactly, thank you! my mistake... |
I would definitely be interested in using this library if an audio class was added - I'm working on some open-source audio hardware (equalizer, DAC, etc) where having several interfaces would be very useful for debugging. |
Is audio class support planned?
The text was updated successfully, but these errors were encountered: