4 channel USB soundcard with STM32

At this point I would like to make a 4 channel sound card out of the 2 channels. I started with modifing the USB descriptors in usbd_audio.c. I more or less cloned the first part of Reloop Beatpad descriptors. So I deleted the Audio Feature descriptor. I modified everything to 4 channel and stuff like that.


I modified my #defines for 4 channel as well.

For now, I don’t care of playing back the audio correctly with the DAC. I2S is mainly for 2 channels, and now I have 4. So I have to select somehow which 2 to play. It’s not straightforward, because I only can store the 4 channels interleaved to one buffer. And the DMA cannot skip the unused channels. So now I have double the amount of data, but the same amount of data can be written to I2S. I decided I don’t care about this, I can read the data from the USB so, the software won’t recognise this problem. Later I maybe will separate the channels or use another method to convert data to analog, SPI or something else.

I had to uninstall the USB device and reinstall it, to work. But it works now. I can use Virtual DJ for example and route the two decks to my 1&2 and 3&4 outputs.

I than tried to fake Reloop Beatpad. I cloned the VID and PID and also the Manufacturer and product string. I plugged my Apple Camera Kit to the iPad and my Discovery board. Unfortunatelly Algoriddim does not recognized my device as Reloop Beatpad, but it recognised as 4 channel soundcard, so I can play the song in it.

I’m not really happy, I need to go further to find out how can I fake a Beatpad. However it is good, that Algoriddim can use 48KHz, there is a chance that I don’t have to mess with 44.1KHz later.

The next step will be to implement the MIDI part also. Which could be still difficult, because I haven’t found anybody who implemented more interfaces, or such a composite device. And there is no example application for MIDI so will see.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s