h743
I found error - problem was in size of fifo buffer, now it's working.
was
HAL_PCDEx_SetTxFiFoInBytes(hpcd_USB_OTG_PTR, (AUDIO_MIC_EP & 0x7F), 128);
edited to
HAL_PCDEx_SetTxFiFoInBytes(hpcd_USB_OTG_PTR, (AUDIO_MIC_EP & 0x7F), 512);
I found error - problem was in size of fifo buffer, now it's working.
was
HAL_PCDEx_SetTxFiFoInBytes(hpcd_USB_OTG_PTR, (AUDIO_MIC_EP & 0x7F), 128);
edited to
HAL_PCDEx_SetTxFiFoInBytes(hpcd_USB_OTG_PTR, (AUDIO_MIC_EP & 0x7F), 512);
1) How is IN Endpoint initialized? If you are using STM libs there is something like "USBD_LL_OpenEP" functionAdditional info : stereo, 24bit 48kHz, packet length = (48000 /1000 ) * 2 *3 = 288 (0x120)
So offsets in packet are right, but length 4 instead 288
USBD_LL_OpenEP(pdev, AUDIO_IN_EPNUM, USBD_EP_TYPE_ISOC, AUDIO_IN_PACKET_MAX);
where AUDIO_IN_PACKET_MAX is the max packet size, check this value.
2) In USB descriptor check max endpoint size
//Standard AS Isochronous Audio Data Endpoint Descriptor
AUDIO_DESC_STD_AS_ISO_EP_LEN, // bLength
USB_DESC_TYPE_ENDPOINT, // bDescriptorType
AUDIO_IN_EPNUM, // IN endpoint
USBD_EP_TYPE_ISOC | ISO_EP_ATT_ASYNCHRONOUS, // attributes
LOBYTE(max endpoint size), // max endpoint size
HIBYTE(max endpoint size),
EP_BINTERVAL_VALUE, // bInterval
Your descriptor seems to be a mix of UAC1 and UAC2. E.g. You have Interface Association Descriptor which came with UAC2 but your Class-specific AC Interface Descriptor is from UAC1. Windows UAC2 logs should show if enumeration is successful.My device is detects, requests come from host.
Hi! I am very new to this. For the longest time I ran simple speakers, but recently I've got a not bad pair of headphones (KZ ZSN proXs), and they eclipse anything I've had before. Just running off a laptop. I am very much looking forward to building a proper USB DAC/AMP to go higher end. I've looked at some dac pcbs, and all of them require I2S. I am not aware of the STM32's limits regarding I2S. I want to try 32bit 384khz (or even 768khz but that's a stretch). I will pair it with a PCM5102A Dac (AK4493SEQ in a Final iteration).
Questions -
1.Which STM32 should I get for this?
2.Can it match (at least for the price) an XMOS’s XU208?
3. Does anyone have example code, or even complete code?
Thanks a lot for any help given and best of luck with your own projects!
Questions -
1.Which STM32 should I get for this?
2.Can it match (at least for the price) an XMOS’s XU208?
3. Does anyone have example code, or even complete code?
Thanks a lot for any help given and best of luck with your own projects!
Do you want to try DSD when you get to AK4493? Reason I ask is IME the AKM dacs I have tried sound better in DSD mode, rather than PCM. However, don't know if STM32 solutions support DSD at this point. OTOH, Amanero and or I2SoverUSB can work quite well with it.I want to try 32bit 384khz...
Hi, you could start from there: https://www.diyaudio.com/community/threads/open-sourced-uac2-bridge-based-on-stm32.404656/
There are other UAC 2.0 stm32 projects on Github.
Be prepared to spend some time there. This is feasible and demontrasted to work well, but not copy/paste stuff.
There are other UAC 2.0 stm32 projects on Github.
Be prepared to spend some time there. This is feasible and demontrasted to work well, but not copy/paste stuff.
I can't say the same about AKM, but Rohm definitely plays DSD perfectly, and better than PCM (and this is not just my opinion).? Reason I ask is IME the AKM dacs I have tried sound better in DSD mode, rather than PCM.
Alex.
I would like to, yes. My preferred music is metal, clarity, dynamics means everything there. For now I wish to build a very very well sounding yet still cheap dac amp. Hence why I did not go for the XMOS. For now I wish to put more money into the dac and the amp part of this, so keeping the usb to i2s bridge cheap is key for price/performance. I also think that if the implementation is good, DSD and PCM should sound about the same. Any idea which STM32 to go for?Do you want to try DSD when you get to AK4493? Reason I ask is IME the AKM dacs I have tried sound better in DSD mode, rather than PCM. However, don't know if STM32 solutions support DSD at this point. OTOH, Amanero and or I2SoverUSB can work quite well with it.
Thanks for helping out, much appreciated. Best regards.
Interesting, thank you! I will take a look as soon as I got time. While I have not done much coding in years, I was working with micro-controllers extensively in the past, I hope I can manage here as well.Hi, you could start from there: https://www.diyaudio.com/community/threads/open-sourced-uac2-bridge-based-on-stm32.404656/
There are other UAC 2.0 stm32 projects on Github.
Be prepared to spend some time there. This is feasible and demontrasted to work well, but not copy/paste stuff.
DSD can be supported just as well as with XMOS or Atmel. Also TDM if multi-channel is output is required.However, don't know if STM32 solutions support DSD at this point.
If you want something cheap you should look at Chinese Amanero clones. MCU is only part of the total cost and STM32 is not cheaper than the alternatives. The benefits of STM32 lie elsewhere.so keeping the usb to i2s bridge cheap is key for price/performance
That would make sense of the I2S bridge were only being used for data. However it many cases it is also clock source for the dac, which is a critical analog (not digital!) time reference that the dac requires for good operation. Similarly all dacs need an analog voltage reference which is also critical to dac performance.For now I wish to put more money into the dac and the amp part of this, so keeping the usb to i2s bridge cheap is key for price/performance.
Got it, i will look into the Amanero clones. In case you know, how do they compare to the STM32 solution?If you want something cheap you should look at Chinese Amanero clones. MCU is only part of the total cost and STM32 is not cheaper than the alternatives. The benefits of STM32 lie elsewhere.
If all goes well and this project works out I will use a FIFO reclock. Also I will make sure to make good linear psus for low noise.That would make sense of the I2S bridge were only being used for data. However it many cases it is also clock source for the dac, which is a critical analog (not digital!) time reference that the dac requires for good operation. Similarly all dacs need a voltage reference which is also critical to dac performance.
Do you think it will be cheaper?cheap dac amp. Hence why I did not go for the XMOS.
XMOS XUF208 Digikey price is ~$15 (for 1pc).
One of the most suitable for UAC2 operation STM32F723 - $11-15 (for 1pc).
Yes, the power supply for STM will be a little simpler and cheaper, but is the difference so big?
P.S. Why I choose XUF208 and F723 for comparison?
Because XUF208 have internal flash and because F723 have internal USB PHY.
For XU208 you will need external flash chip and for many other STM - external PHY chip ( which is no so easy to make good PCB layout, because of a 60MHz parallel bus)
Alex.
By the way, besides STM32, try to find projects with PIC32 as well.
There were some on this forum.
Also you can see it at Vegalab , hope you are able to read this.
Alex.
There were some on this forum.
Also you can see it at Vegalab , hope you are able to read this.
Alex.
There is no "standard" or ready-made STM32 implementation. But Amanero is not the best USB-I2S bridge so implementing a better solution with STM32 is possible.In case you know, how do they compare to the STM32 solution?
You do not need FIFO for good USB interface!If all goes well and this project works out I will use a FIFO reclock.
"Good", I mean working in asynchronous mode, i.e. - receive the external MCLK from the oscillator (usually dual frequency for 44x/48x). All XMOS, Amanero, most PIC32 and STM32 solutions works like this.
Also it is highly recommended, that these oscillators physically located close to the DAC chip, because only DAC clock jitter is important, and not MCLK going to the USB chip.
Alex.
So far I was thinking of this pcb If I do go XMOS.Do you think it will be cheaper?
XMOS XUF208 Digikey price is ~$15 (for 1pc).
One of the most suitable for UAC2 operation STM32F723 - $11-15 (for 1pc).
https://www.diyinhk.com/shop/audio-...oa_cable/153-optical_spdif_output_socket-null
I assumed that the STM32 solution will be as good or simply alike and can be done on a simple dev board with some modifications. Such as this for example.
https://aliexpress.ru/item/10050066...x.productlist.search_results.0.53d95b32M37Aqu
Do forgive in case I am missing things. I really wish to make a cheap dac/amp that's worth it.
Regarding the psu situation - I will make use of a computer psu, 3.3v, 5v, and 12v. For the output stage which requires differential supply use a rail Splitter ic TPS65130 (4 in parallel) to create Positive and negative rails just a volt above target, and linearly stabilize it with LT3045 (or comparable) chips. Use different LT3045s to make the voltage spat out by the pcu clean for the dac and the I2s device.
Assuming an average implementation, would that be good enough?
Thank you! Would you by any chance know what's the easiest starting point, so I try that myself? (Hardware wise) I am thinking an STM32H743 and a USB3300?There is no "standard" or ready-made STM32 implementation. But Amanero is not the best USB-I2S bridge so implementing a better solution with STM32 is possible.
- Home
- Source & Line
- Digital Line Level
- UAC2.0 on STM32