Page 1 of 1

VSIDE DSP Library for VS1010D

Posted: Wed 2019-06-12 14:47
by Aleksi

Here is an instructions and example for designing filters using Octave (free mathematics tool) and VSIDE DSP Library and using them in DSP application on VS1010D device.

To use and compile this example you also need aligned memory support driver (align.dlx) which is provided in package below and also in this topic:

More general information about VSIDE DSP Library, digital signals and designing filters is provided in this topic:

Feedback and questions are welcome!

Kind regards,

VLSI Solution's trainee

Re: VSIDE DSP Library for VS1010D

Posted: Mon 2019-07-01 10:15
by Arek
Hi Alexi,

great work! Thank you.

As i understand, your solution works with analog input data.
How can i switch it (if possible?) to a file (mp3, ogg etc.) played from sd memory with "PlayerPlayFile()"?

With best regards


Re: VSIDE DSP Library for VS1010D

Posted: Mon 2019-07-01 13:37
by Panu

What would you like to do, exactly?

The audio output from codec is handled by stdaudioout->op->Write, which points to AudioWrite:

Code: Select all

u_int16  AudioWrite (register __i0 VO_FILE *self, void *buf, u_int16 sourceIndex, u_int16 bytes) {
	while (AudioBufFree() <= bytes/2) { AudioIdleHook(); } //Wait for free space in the audio buffer
	if (audioOutChannels == 1 || (bitsPerSample == 16  && audioPtr.wideAudio)) { 
		MonoCopyWiden(buf,bytes/2); //StereoCopy hook -> -> OldStereoCopy					
	} else {
	return bytes;
This function takes the sample data, waits that there is free space in the audio buffer and then calls either SteroCopy or MonoCopyWiden to copy the audio data to the DAC. You could make your own audioout device whose Write method does signal processing in between.

Another alternative is to overwrite CodecServices::Output for the same purpose, but if you do that, you'll have to go deep into the inner structure of creating and disposing codec entities and replace the Output function always after creating a new codec, that is: always after starting the playback of a new file. (Hmm, Well, that's perhaps easier than you might think as player.auDec.cs is always at a fixed location in VS1010 memory (unlike VS1005) so you could just poke player.auDec.cs.Output in your idle hook 8-) )


Re: VSIDE DSP Library for VS1010D

Posted: Mon 2019-07-01 15:09
by Arek
Hi Panu,

many thanks.
I'd like to spent to my Player nice future - a kind of equalizer - to make the sound played from one speaker only a little bit better.
(planned from start but not implemented yet)
Now I see a possibility to do it.
My question. Has the VS1010D enough power to play files with soft decoder (ogg etc.) and at the same time use a digital filter?
Can you estimate the restrictions?

With best regards

Re: VSIDE DSP Library for VS1010D

Posted: Wed 2019-07-03 16:30
by Panu

For simple codec like MP3, playing from a simple and fast storage like SD card, it should be ok. I'm not sure about restrictions if you want to play 32-bit files or really high bitrate files like DXD or if you want to play from complex storage like USB flash... I'm not sure. There could be problems. But for something simple like MP3 from SD card, it should be possible.