VS1053b - No luck with flac

Designing hardware that uses VLSI Solution's devices as slave codecs such as an external MP3 decoder chip for a host microcontroller.
technic
Senior User
Posts: 47
Joined: Mon 2017-11-20 10:23

VS1053b - No luck with flac

Post by technic »

Hi!

I need some help troubleshooting my vs1053b based setup.
Hardware:
Adafruit ATSAMD21 based arduino Feather M0 + Adafruit MusicMaker (VS1053b-based) Featherwing.

Software:
Adafruit VS1053 library, feather_player example.

This "player" work well with MP3, OGG files, but can't play FLAC files.
I've asked for help on Adafruit forum, https://forums.adafruit.com/viewtopic.p ... 2&e=631832
they recommended me to ask you :)

My general question is - is my hardware combination able to play FLAC files?
And second quistion - how I cad debug what's wrong?
User avatar
pasi
VLSI Staff
Posts: 2120
Joined: Thu 2010-07-15 16:04

Re: VS1053b - No luck with flac

Post by pasi »

vs1053b does not natively play FLAC files. You need to upload the correct variant of the patch from the vs1053b patches package ( http://www.vlsi.fi/en/support/software/ ... tches.html ).

I don't know which variant of the patch, if any, the default Adafruit library uses.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
technic
Senior User
Posts: 47
Joined: Mon 2017-11-20 10:23

Re: VS1053b - No luck with flac

Post by technic »

Thanks for reply,

yes, I know about FLAC patch,

Adafruit VS1053 library have methods to load patch from file or from data array.

My post from adafruit forum:
...
When I tried to use function Adafruit_VS1053::loadPlugin(char *plugname), I use plugin from
https://bois083.wordpress.com/2014/11/1 ... oder-chip/ ( mentioned in https://forums.adafruit.com/viewtopic.php?f=22&t=73391 )

When I tried to use Adafruit_VS1053::applyPatch, I use array from
vs1053b-patches-flac.plg (from vlsi page, http://www.vlsi.fi/fileadmin/software/V ... hes240.zip )

third way - write my own function (based on code in vs1053b-patches-flac.plg).

In any case after plugin loading decoder make software reset (I hear specific sound in earphones), mp3 decoding work well, but no luck with flac..
I think that Feather is fast enough to put data to the VS1053 chip, I don't understand what's wrong.
I've checked DREQ signal activity during MP3 and FLAC "playing".
When mp3 file played oscilloscope shown ~40 Hz signal, and no signal with FLAC.
Possible that vs1053b does not decode flac-stream (yes, flac plugin is loaded)...
User avatar
pasi
VLSI Staff
Posts: 2120
Joined: Thu 2010-07-15 16:04

Re: VS1053b - No luck with flac

Post by pasi »

Does the HDAT1 register value change when you try to play a flac file? Is DREQ always high with FLAC?

Can you send us the FLAC file you are testing with (to support@vlsi.fi )?
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
technic
Senior User
Posts: 47
Joined: Mon 2017-11-20 10:23

Re: VS1053b - No luck with flac

Post by technic »

Yes, no problem, I can send files.

And yes, DREQ always high with FLAC.

About HDAT1 register - I will check, some code modification needed.
technic
Senior User
Posts: 47
Joined: Mon 2017-11-20 10:23

Re: VS1053b - No luck with flac

Post by technic »

I can't send second file (abou 14 mb), your server reject my mails...
User avatar
pasi
VLSI Staff
Posts: 2120
Joined: Thu 2010-07-15 16:04

Re: VS1053b - No luck with flac

Post by pasi »

Hi Andrej,

Both files seem to play with my C model and with vs1053b when vs1053b-patches-flac is loaded. HDAT1 should have 'fL', i.e. 0x664c.

vs1053b-patches-flac.plg seems to include the write to AIADDR (0x300), so it should start automatically. Do not give software reset after loading the code. Use the cancel procedure to cancel play instead of software reset. If you need a software reset, you can replace it by writing 0x300 to AIADDR, or reload the patch again.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
technic
Senior User
Posts: 47
Joined: Mon 2017-11-20 10:23

Re: VS1053b - No luck with flac

Post by technic »

Thank you, pasi, for information.

Did I understand correctly that I should check the state of the HDAT1 register after I started playing the file?

Is it possible to check are patch loaded correctly and work?
Is there way to test SD card transfer rate?

I think that maybe SPI bus in my setup to slow for flac...
User avatar
pasi
VLSI Staff
Posts: 2120
Joined: Thu 2010-07-15 16:04

Re: VS1053b - No luck with flac

Post by pasi »

HDAT1 gives information about the currently playing format. Most formats are detected from the first dozen bytes, so after sending the first block of data, HDAT1 should tell you something.

Even if your SPI bus were too slow, you would hear something.

If you're using a tried-and-tested plugin load routine, it should work.

You can try the attached file (edit: should be jumi.ogg and not jumi10.ogg). The decoding will get stuck if the patch is not running.
Attachments
jumi.ogg
gets the decoder stuck without the vs1053b patches
(9.9 KiB) Downloaded 281 times
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
drmoth
User
Posts: 2
Joined: Fri 2019-04-12 9:05

Re: VS1053b - No luck with flac

Post by drmoth »

Hi,
I'm in a similar position with the VS1053b and FLAC, I'm using the Adafruit Musicmaker board.
Ogg and mp3 work fine, and I appear to be loading the flac plugin correctly but I'm getting no sound and the device appears to be freezing.

I've using a particle Xenon to drive the audio, it has a 64Mhz clock.

I've tried the jumi10.ogg file linked above, and it works regardless of whether I load the patch or not. Is this normal? Is there any other way of knowing whether the plugin has correctly loaded?

I've tried reading HDAT1 and it gives me 0x4F67 for Ogg but either freezes or returns zero for flac.

Any suggestions?
Post Reply