I'm starting this thread as a blog.
I'm trying to get low latency multi-voice playback from files stored on an SSD drive connected to a USB host port. For now, I'm working with a T3.6 with headphones connected to the DAC pins through through 1uF ceramic caps. Sounds like crap, but it'll do for testing. I have a custom T4.1 in the works with an integrated audioboard circuit, but until the parts arrive, I'll settle for the T3.6.
There's an example project with a module (AudioPlayUSBWav) for playing back wave files from USB Host port. The code is spaghetti, but it got me started. I reworked it to read the wave header and prebuffer some data, so that when I want to play the track, it plays immediately. This dropped the time required to start playing the data down from 900ms to 70us. Huge improvement. Using this method, I could play back a max of 4 files simultaneously without any dropouts.
But I could still hear a significant amount of latency, so I changed the Audio buffers down to 16. This is extremely aggressive, and resulted in massive amount of dropouts. In fact I could only manage a playback of a single file without glitches, but at least the sound was immediate. I figure the T4 might get 4, but clearly this is not going to be good enough. I want at least 24 voices--the more the merrier.
Tomorrow I will try to rework my single AudioPlayUSBWav object to handle reading, buffering and mixing multiple audio files instead of using one AudiPlayUSBWav module for each file. Based on my SSD read performance tests through the host port, I should be able to comfortably read over 50 stereo files simultaneously, although I didn't do those tests with audio playing.
I'm trying to get low latency multi-voice playback from files stored on an SSD drive connected to a USB host port. For now, I'm working with a T3.6 with headphones connected to the DAC pins through through 1uF ceramic caps. Sounds like crap, but it'll do for testing. I have a custom T4.1 in the works with an integrated audioboard circuit, but until the parts arrive, I'll settle for the T3.6.
There's an example project with a module (AudioPlayUSBWav) for playing back wave files from USB Host port. The code is spaghetti, but it got me started. I reworked it to read the wave header and prebuffer some data, so that when I want to play the track, it plays immediately. This dropped the time required to start playing the data down from 900ms to 70us. Huge improvement. Using this method, I could play back a max of 4 files simultaneously without any dropouts.
But I could still hear a significant amount of latency, so I changed the Audio buffers down to 16. This is extremely aggressive, and resulted in massive amount of dropouts. In fact I could only manage a playback of a single file without glitches, but at least the sound was immediate. I figure the T4 might get 4, but clearly this is not going to be good enough. I want at least 24 voices--the more the merrier.
Tomorrow I will try to rework my single AudioPlayUSBWav object to handle reading, buffering and mixing multiple audio files instead of using one AudiPlayUSBWav module for each file. Based on my SSD read performance tests through the host port, I should be able to comfortably read over 50 stereo files simultaneously, although I didn't do those tests with audio playing.