Page 1 of 1

Audacity OGG encoder not working with VS1000

Posted: Tue 2018-10-02 21:34
by joe6486
We've been trying to help out a customer with a problem, and it appears that the VS1000 module does not properly decode ogg files that were encoded with audacity. The files play perfectly on a computer, but there are all kinds of awful artifacts when playing the same files on the VS1000.

We can use another encoder, of course, but anyone know the cause or a workaround within audacity?

Re: Audacity OGG encoder not working with VS1000

Posted: Wed 2018-10-03 13:43
by pasi
What are the encoding parameters, i.e. samplerate and quality? Can you include a portion, or send an example file to support@vlsi.fi ?

A high quality setting creates a high bitrate, which requires more CPU for transfer from uSD card leaving less for decoding, and may also need more CPU to decode.

The default clock the audio module firmware uses is 3.0x (36MHz). It can be increased to 3.5x from uartctrl.c. If GAPLESS is defined, the clock is also set to 3.5x.

Re: Audacity OGG encoder not working with VS1000

Posted: Fri 2018-10-05 19:28
by joe6486
Thanks. I'll email a link. The bitrate is about 500kbps, so maybe that's too high?

Are there any definitive specifications for what type of .ogg file is acceptable? (WAV also, while we're at it.) This is all for microSD playing.

Re: Audacity OGG encoder not working with VS1000

Posted: Fri 2018-10-05 19:44
by joe6486
Looks like there is a nominal setting for bitrate in audacity, but I'm not sure what the VS1000 can support:

https://wiki.audacityteam.org/wiki/OGG

Re: Audacity OGG encoder not working with VS1000

Posted: Mon 2018-10-08 12:07
by pasi
It seems 500kbit/sec needs 3.5x clock to play without hiccups in the vs1000 audio module. The default is 3.0x clock. (Due to UART control the firmware needs to use a fixed clock.)

Usually Ogg Vorbis quality 6 gives around 192kbit/sec, which is generally enough for music in Ogg Vorbis format. Quality settings 7 and 8 probably work, and 10 and probably 9 should not be used due to generating unnecessarily high bitrates.

There's some applicable information in "How to encode Ogg Vorbis files from MP3 or WAV format" application note from http://www.vlsi.fi/en/support/applicationnotes.html . It also gives hints on how to reduce the file size of voice files.

Re: Audacity OGG encoder not working with VS1000

Posted: Mon 2018-10-08 15:06
by joe6486
Thanks! I can tell them to limit OGG bitrate to, say, 320kbps or so.

What about WAV file formats, are there any definitive specifications I can offer to users?

We'll change the clock if we have to but we haven't looked at our custom code in a while. I think we're ok just instructing customers accordingly.

Re: Audacity OGG encoder not working with VS1000

Posted: Mon 2018-10-08 17:29
by pasi
Wav doesn't take any CPU to decode, and I have played 44.1kHz stereo 16-bit WAV's without issue.

Another thing to note is that with 12MHz clock, the maximum playback rate is 46875Hz, so 48kHz rate will play 2.4% slower than it should. If this bothers the customer, recommending to use 44.1kHz is a good idea.