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.
Post Reply
technic
Senior User
Posts: 47
Joined: Mon 2017-11-20 10:23

VS1053b - No luck with flac

Post by technic » Mon 2017-11-20 13:38

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: 1485
Joined: Thu 2010-07-15 16:04

Re: VS1053b - No luck with flac

Post by pasi » Mon 2017-11-20 16:07

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 » Mon 2017-11-20 16:31

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: 1485
Joined: Thu 2010-07-15 16:04

Re: VS1053b - No luck with flac

Post by pasi » Tue 2017-11-21 14:03

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 » Fri 2017-11-24 13:04

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 » Fri 2017-11-24 13:13

I can't send second file (abou 14 mb), your server reject my mails...

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

Re: VS1053b - No luck with flac

Post by pasi » Fri 2017-11-24 13:28

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 » Fri 2017-11-24 15:54

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: 1485
Joined: Thu 2010-07-15 16:04

Re: VS1053b - No luck with flac

Post by pasi » Mon 2017-11-27 13:03

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. The decoding will get stuck if the patch is not running.
Attachments
jumi10.ogg
gets the decoder stuck without the vs1053b patches
(79.06 KiB) Downloaded 35 times
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Post Reply