Audio Fade In

Writing software that controls the system and peripherals such as displays, SD cards, Buttons, LEDs, Serial Ports etc.
Post Reply
Nan000
User
Posts: 3
Joined: Tue 2016-08-30 17:51
Location: Germany

Audio Fade In

Post by Nan000 » Tue 2016-08-30 18:32

Hi to all,

I'm currently developing an audio player based on a VS1003 audio codec that will be used in a x-mass pyramid controller system. For that I I would like to add the feature to fade in / fade out the audio using the SCI_VOL register.

My VS1003 is connected to a Cortex M4 uC using SPI (SCLK 10 MHz) as well as the DREQ signal connected to an interrupt capable pin. For that I've implemented a driver in C that is able to communicate with the VS1003 and play/pause/stop audio in the background using an interrupt service routine based scheme.

My problem now is that I want to add fade in / fade out functionality by changing the SCI_VOL register while audio is playing. I've tried to use a timer that frequently calls my SciWrite() function with an increasing volume value. I can hear the fade in but it doesn't sound smooth at all. It seams like not all volume value get set probably after each other and some of the get skipped. Also in seams like that the left and the right volume is being set differently now and then.

I would appreciate if someone could give me advice on how to set the volume using the SCI_VOL register properly while audio is playing.

Many Thanks!
Mathias

User avatar
pasi
VLSI Staff
Posts: 1416
Joined: Thu 2010-07-15 16:04

Re: Audio Fade In

Post by pasi » Wed 2016-08-31 12:59

0.5dB steps are probably too coarse for a good fade out / fade in, and it does not help that the adjustment happens only a certain number of times per second.

Which audio format are you using? I have a 'tags' plugin, in which you can insert short commands between the mp3 frames to specify fade in and fade out. It would need to be adapted to use SCI registers to work with other formats.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Nan000
User
Posts: 3
Joined: Tue 2016-08-30 17:51
Location: Germany

Re: Audio Fade In

Post by Nan000 » Tue 2016-11-22 21:29

Hi,

thanks for the replay. I got my problem solved. The reason for the was in incorrect SPI clock frequency (10 MHz) setting in my Cortex. For some reason, the audio playback could handle it but in conjunction with SCI register access it got confused. I've set the SPI clock to a vaild value as specified in the VS1003 datasheet and now everything is just working wonderful.

Post Reply