VSIDE DSP Library for VS1010D

Designing hardware and software for systems that use the VS1010 MP3 Audio DSP Microcontroller.
Post Reply
Aleksi
User
Posts: 7
Joined: Wed 2019-06-12 10:03

VSIDE DSP Library for VS1010D

Post by Aleksi » Wed 2019-06-12 14:47

Greetings!

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:
viewtopic.php?f=15&t=2419&hilit=align.

More general information about VSIDE DSP Library, digital signals and designing filters is provided in this topic:
viewtopic.php?f=7&t=1593

Feedback and questions are welcome!


Kind regards,

VLSI Solution's trainee
Aleksi
Attachments
VSIDE_DSP_Lib_VS1010D.zip
Complete package which includes instructions and files needed for using example solution.
(1.36 MiB) Downloaded 28 times
VSIDE_DSP_Lib_VS1010D.pdf
Instructions as a separate file. You do not need this if you download the whole package.
(1.44 MiB) Downloaded 39 times

Arek
Senior User
Posts: 108
Joined: Thu 2016-09-01 10:58

Re: VSIDE DSP Library for VS1010D

Post by Arek » Mon 2019-07-01 10:15

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

am

User avatar
Panu
VLSI Staff. Currently on holiday.
Posts: 2711
Joined: Tue 2010-06-22 13:43

Re: VSIDE DSP Library for VS1010D

Post by Panu » Mon 2019-07-01 13:37

Hi!

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 {
		StereoCopy(buf,bytes/4);
	}
	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-) )

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

Arek
Senior User
Posts: 108
Joined: Thu 2016-09-01 10:58

Re: VSIDE DSP Library for VS1010D

Post by Arek » Mon 2019-07-01 15:09

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
am

User avatar
Panu
VLSI Staff. Currently on holiday.
Posts: 2711
Joined: Tue 2010-06-22 13:43

Re: VSIDE DSP Library for VS1010D

Post by Panu » Wed 2019-07-03 16:30

Hi!

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.

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

Post Reply