VS1053 Mp3 Module

1968neil

Senior Member
Hi Folks,

Has anyone managed to control the VS1053 with a picaxe ? (SPI) - Datasheet attached.
Specifically, i need an mp3 module that can be controlled by the picaxe and display the track info (not just the number) for displaying on an lcd.

The Df Player i have currently is ok , but there is no way i can see of extracting the track name info. (except the number of tracks)

Or can anyone suggest an alternative module or chip ?

Regards
Neil
 

Attachments

tmfkam

Senior Member
I did some development on using this module before switching to the SPE035. I was attempting to control it in parallel mode though as I didn't (still don't) need track names. I wasn't aware that track names could be extracted. The version I used required the tracks to be arranged on the uSD by a specific program in order to ensure the required track order was maintained. I re-wrote the firmware to suit our project and got as far as starting a PCB design with a USB port on it for external storage before I found the SPE035. The cost difference and the fact that the SPE035 supports USB natively (if slightly buggy when both uSD and USB are present) made the SPE035 a vastly better proposition. It is now used in a number of our units.
 

1968neil

Senior Member
Thanks for the reply,
I've used the SPE035 Extensively in both domestic and commercial applications, Great little module.
Unfortunately in my current project I need to be able to display the file name being played, this is the main requirement before i can go any further,
If the DF Player would allow that id be using one for this project.

I've done some research and most of the serial controlled boards have the same issue, track number only........
Will have to continue searching....... Unless anyone has any other ideas that i could investigate further.

Kind Regards
Neil
 
Last edited:

Buzby

Senior Member
If you have generated the sound files, and have saved them in a known track order, then the simplest idea would be to store the track names in the PICAXE.

Then a simple lookup of 'track name' using 'track number' as the pointer could provide any text you want for each track.

Or am I missing something ?.

Cheers,

Buzby
 

1968neil

Senior Member
I need the track names displayed, there will be and external usb socket where the stick will be swapped for another containing different tracks.
the module I’m building is for a musician friend that uses backing tracks live and the tracks are stored on usb drive, they currently use a mini disc player but it’s becoming unreliable with life on the road
 

Buzby

Senior Member
I see now what your problem is. The track music and names are unknown to you, so the PICAXE can't hold any relevant data about the current USB.

If this was my project, the first thing I would do is investigate what data about the tracks is stored on the USB, maybe using a computer to view the files on the stick. Then I'd find out if the player module can actually read this data. If that's the case, then writing code to display it would just be a case of following the datasheet.

Does the datasheet mention anything about 'metadata', such as track and artist names ?.
 

AllyCat

Senior Member
Hi,

Can the VS1053 supply the Metadata either? With a quick scan of the Data Sheet I couldn't see any reference, except for the two bytes of "Stream header data". As others have implied above, my inclination would be to "stay with the devil you know" (SPE035), but the emphasis has to be on the "you" as I've never used either of them. :(

My first thought was whether it would be possible to create and store a "Text" file on the USB drive, containing the header string(s) required by the PICaxe. But, with a quick scan of both data sheets, I can't see that either gives any direct access into the file system.

So my second (maybe daft) thought was whether one could return to the days of the Sinclair ZX81/Spectrum or BBC Computer and store the Text Data in an Audio file, as done with Audio Compact Cassettes of the day? Of course MP3 coding will corrupt any pulse/timing data, so you'd need to use some form of tone (DTMF?) encoding, or I see that the SPE035 supports .WAV files which I believe contain a more conventional real-time signal waveform? My thoughts were towards a short "Advert" style file which would be played just before its associated MP3 Audio file. I note that the SPE035 has Speaker and stereo Line Outputs, but are both controlled in tandem by the volume control commands? It seems that your requirement is probably for a stereo output, so you may need an external mute for the line outputs. Otherwise you might use a trick of storing the data in antiphase on the two channels for a reasonable (mono) silence of the data ?

Cheers, Alan.
 

Buzby

Senior Member
A quick read of Wikipedia about the MP3 format shows that the artist, cover art, release date, etc can be stored ( or at least it's address is stored ) in the 'header' or 'tail' of the MP3 file in a format called ID3 ( See here : https://en.wikipedia.org/wiki/ID3 )

I couldn't find any mention of ID3 in the VS1053 datsheet, so I think you are on a road to nowhere with this chip alone.

More likely is that you could find an MP3 module which has on onboard microcontroller configured to provide the metadata via a serial interface. Looking on 'other' forums seems to show these are available, but I haven't got time to find a specific answer.

( Extracting and decoding the ID3 data yourself would need access to the MP3 file contents at the byte level, not easy with a PICAXE )

Cheers,

Buzby

EDIT : Just buy a car radio that displays the MP3 data, or use a mobile phone app. Unfortunately none of these solutions need a PICAXE :)
 
Last edited:

tmfkam

Senior Member
As I said in my earlier reply, I wasn't aware of the VS1053 supplying track info. I might have missed it, but did a fair amount of work before switching to the SPE035.

There was a forum for developers of the VS1053 which was fairly informative. You can download a 'C' like development toolset for the device so could perhaps add or modify the features needed yourself? They also have example firmwares for various applications. The firmware I 'used' started as one of these, modified to provide the features I needed such as priority inputs, inactivity timers and the like.

Failing that, if I had to do something myself I might start with a Pi Zero running a simple non-gui Linux OS and control that with a PicAxe.
 

1968neil

Senior Member
The VS1053 appears to be able (for arduino at least) but can find no examples of Picaxe versions.
Will have to continue looking, was hoping for a simple solution but alas nothing comes to mind.
Thanks for the help thus far
Kind Regards
Neil
 

AllyCat

Senior Member
Hi,
.... the tracks are [will be?] stored on usb drive, they currently use a mini disc player but it’s becoming unreliable with life on the road. ...
A MiniDisc player can be anything from a pocket-sized "cigarette packet" running from a single AA NiMH cell, up to a full-sized, mains-powered "Rack" with external PS2-connected Keyboard for editing the "Title" data. I don't recall where my Title data originated, but as most material was recorded from the Radio, I suspect it was mainly via the PC keyboard. :)

As Buzby has said, for use "On the Road" you're unlikely to be able to do better than an off-the-shelf Car (Radio) Player with a USB input socket. However, if you want a tiny, simple, low-cost, PICaxe solution then I think my "Audio Text File" idea in #7 probably is viable. PICaxe's RFOUT/RFIN packets should go through a .WAV file at its low(est) bandwidth, giving more than 128 bytes/second, error-protected. Or "roll your own", perhaps using HSEROUT with (modified) ASCII bytes for a higher data rate.

A single "Audio/Text" file could be created by a PICaxe from Tabular data and recorded via "Audacity" on a PC. Then the Text file would be read by the PICaxe when the USB Stick is inserted, and the data transferred to an external I2C Serial (8-pin) EEPROM. Alternatively, separate "Advert" files could be clipped and created by Audacity, then read immediately before each appropriate track is played.

Potentially, just an AXE171, a 1.3" SD1106 (or 1602/2004) OLED display and a single Lithium battery pack could compete with a Pocket-sized MD Player. ;)

Cheers, Alan.
 

1968neil

Senior Member
Thanks Alan,

I think i have stumbled upon a solution....... see attached pdf
The BY8001 is from memory a DF player compatible player that supports the file names.. (according to the datasheet)
Looks like it will give me 8 characters which is just enough for my purposes.
I have one somewhere I bought in error a few years back, will give it a try.
It seems that the Picaxe SPE035 Mp3 Board can also take this module (pinouts different) ?, which is very handy as that's a module i'm very familiar with.
Happy days, thanks for the help, ill let you know when I have a working prototype and share as its probably quite a step forward for those that want to display the track info in particular with the Picaxe set up.

Regards
Neil
 

Attachments

AllyCat

Senior Member
Hi,

Yes, that device appears to return the 8-byte File Name in response to a command ... $1E.... . However, the DFPlayer/SPE035 appears to require that the Files are named 0001 , .0002 etc, so the name wouldn't be very useful ? But presumably your particular device will accept "arbitrary" file names, so you will need to ascertain how the files are related to their Track numbers (position) on the USB stick.

I've realised that the USB stick probably requires a 5 volt supply, but perhaps the PICaxe could boost that from a (3.7v) Lithium cell? But it's a pity that the 14M2 Port.pin numbers on the AXE171 aren't arranged rather more conveniently (e.g. for I2C connections). :(

Cheers, Alan.
 

Buzby

Senior Member
It does look to me that the BY8001 returns 8 chars of the file name, not of the metadata stored in the .mp3 This would mean saving each .mp3 with a distinct and meaningful 8 char name.

This means you would need to 'silently' play each track and query the file name, maybe during a 'Please wait ...' when a new USB is inserted, so you could build the 'Track number to Track name' table.

I do not think saving .mp3s to USB with specific names is what your customer will want. He is most likely wanting to just copy .mp3s from the web, or from specialist backing CD/DVDs.

There do seem to be many solutions to this problem if you can access the files directly, lots of A*****o and R** code is out there to do this. One of these platforms could be used to build a module that the PICAXE could use as a peripheral. However, these devices are way more powerful than PICAXEs, so you could do the whole job on one of them for very little extra effort !.

But a car radio would be even simpler !

EDIT again : I wrote WAV when I should have written .mp3.

All changed now.
 
Last edited:

AllyCat

Senior Member
Hi,

From the User Manual (table) :

(Hex Command) "0x41 | Play track by index number (1-65535) | (Index is prescribed by FAT file system. Index order is generally in order that files were copied to flash drive, but not guaranteed. A FAT file sorter software program (such as “DriveSort” or “FAT32 Sorter”) should be used if specific file index order for playback is required.)"

But just 8 characters of CAPITALS (yes that word is 8 chars) seems too restrictive, whilst 64 - 128 characters (for the "basic" metadata) perhaps overkill? And if these are "backing tracks", will they actually have any "real" Metadata attached? IIRC the Compact Disc specification didn't include any metadata, so it was necessary to consult a gigantic "global index" file, which attempted to correlate the "Disc Title" against the available recording information.

Yes, this project does appear to be "reinventing the wheel" (car/mp3 player); I think a PICaxe might offer the potential of an ultra-small, low-power, low-cost project, but IMHO a "hybrid" (controllers) solution makes no sense at all.

Cheers, Alan.
 

Buzby

Senior Member
CDs don't have metadata for 'normal' tracks, but on a CD full of .mp3 files each file will likely have metadata.

The only .mp3 files I've ever seen with no metadata were ones I ripped from CD years ago. Nowadays ripping software will let you add your own metadata, or it will suck it off the web and put in the file automagically.

The more I look at this project the less a PICAXE solution seems feasible, unless somewhere there is a player module with full metadata support.

I think the only sensible options are to climb the learning curve for another platform, or use a car radio or phone app.
 

1968neil

Senior Member
The music to be used (backing tracks) are created in his own studio so adding the Meta data would be done at source to fit whatever format i can come up with.
No CD ripping will be required so pulling data should be simple ........?

Regards
Neil
 
Top