Emulating Reloop Beatpad to Algoriddim Djay

Now it’s time to connect my hardware to the Djay.

IMG_0862

And it works! 🙂

Continue reading

Advertisements

Adding MIDI interface

The next step is to add MIDI interface. Algoriddim Djay did not recognized my device as Reloop Beatpad after cloning VID and PID. Maybe after cloning the MIDI interface it will.

I cloned the MIDI descriptor part from Beatpad. I added EP1 IN and EP2 OUT Bulk endpoints. The addresses are different from the Beatpad endpoint addresses, but as I mentioned earlier I cannot set the endpoint addresses in the FS USB core. I hope the software is not too picky about addresses.

Continue reading

Rewrite data handling

I introduced some new definitions in usbd_conf.h file, because I have to modify the whole project from stereo to 4 channels later.
——————————————————————
/* AUDIO Class Config */
#define USBD_AUDIO_FREQ                       48000
#define USBD_AUDIO_CHANNELS                   2
#define USBD_AUDIO_BYTES              2
———————————————————————

Continue reading

Something is wrong with the STM32 USB Audio Class driver

After I had a working demo, I studied the code, to understand how does it work in details. Here is a simplified description:

1) Initialize EP 1 OUT which is the ISO endpoint, and preapare it for receiving.

2) When it receives something in Data_Out, It starts to Play it in the DAC by sending the data to I2S interface with DMA.

3) During the DMA transfer, we have a HalfComlete and a Complete interrupt. They invoke a simple audio synchronization part, which compensates the clock difference between the USB clock and I2S clock. Here I read a bunch of standards and literature about the clock syncronization possibilities of USB Audio Class.

4) While DMA is sending the data to I2S, the USB still receives the packets and stores them in a buffer.

Continue reading