Writing your own MP3 player firmware
The S1 MP3 Player (or 's1mp3' as it is commonly known as) is a generic type of MP3 that is used and branded by a number of manufacturers. It uses a chip that is firmware updatable, where the firmware is written in Z80 machine code. A number of people have written third party tools allowing writing and running their own code on the MP3 player. The S1MP3 website and wiki has lots of details about this.
A program originally announced on the mailing list called loadram is used to upload Z80 code while the player sits on the 'upload new firmware' screen. This code is run, and can return back to the player. Not much seems to be known about the MP3 players yet but it is possible to write text to the LED screen on some models.
The manufacturers firmware updates can be 'unarchived', and they contain the Z80 binary programs that are run from the firmware menu. For example, the program to run the sound recorder is called RECORDER.AP. This can be replaced by your own Z80 program, repacked into the firmware and updated to the player. From then on, selecting 'Record' from the MP3 player menu will run your new program.
What interests me about this is it gives a small portable reprogrammable device. And hopefully something I can leverage Factor's interactive development system. I wrote an 8080 emulator to play the original Space Invaders arcade game written in Factor. 8080 and Z80 are quite similar. In fact I used Z80 assembler syntax in the 8080 emulator implementation.
It wouldn't be hard to base a Z80 emulator on top of this to allow testing programs to run on the MP3 player. And to write a Z80 assembler in Factor that generated the binaries to upload to the device. 'loadram' was Linux based and has been recently ported to Windows. It uses libusb to communicate with the player. By adding libusb wrappers to Factor it would be possible to assemble and upload directly to the player from a Factor environment - and it should work on Windows, Linux and Mac OS X.
I put together a quick wrapper around libusb and added it to my repository:
This has been tested to work on Linux and Mac OS X. I'll try adding a nice Factor wrapper around the alien definitions and get 'loadram' ported.
Note that to implement the alien wrappers I had to modify Factor's alien C structure wrappers to accept arrays of characters. The patch for this is in my repository but may not necessarily be pulled by Slava into the main Factor repository. I need to tidy it up and work on it before that might happen.
Once libusb is working and loadram is ported I'll try getting the Z80 emulator and disassembler going.
If you're looking for suitable players, Dick Smith Electronics in New Zealand, has at least two models that work. The first is their DSE branded 128MB MP3 player, model number A2439. This is a very basic model and is quite cheap. It has a black and white LCD screen which can be written too using the S1MP3 open source code.
Another model they have is the AStone Samba AV MP4 player. This has a colour OLED display and can play video and pictures - on its very tiny screen. Calling it an MP4 player is a bit of a stretch. It can't actually play MP4's. You use their client software to convert videos in other formats to an AMV format which has awful quality (not that it matters on the tiny screen) but otherwise works ok. The downside of this player is it seems that there is no known way of writing to the colour OLED displays yet.
What sort of things could be written to run on the MP3 players? I'm not sure yet but it'll be an interesting 'spare time' project to play with.
Categories: factor, s1mp3
A program originally announced on the mailing list called loadram is used to upload Z80 code while the player sits on the 'upload new firmware' screen. This code is run, and can return back to the player. Not much seems to be known about the MP3 players yet but it is possible to write text to the LED screen on some models.
The manufacturers firmware updates can be 'unarchived', and they contain the Z80 binary programs that are run from the firmware menu. For example, the program to run the sound recorder is called RECORDER.AP. This can be replaced by your own Z80 program, repacked into the firmware and updated to the player. From then on, selecting 'Record' from the MP3 player menu will run your new program.
What interests me about this is it gives a small portable reprogrammable device. And hopefully something I can leverage Factor's interactive development system. I wrote an 8080 emulator to play the original Space Invaders arcade game written in Factor. 8080 and Z80 are quite similar. In fact I used Z80 assembler syntax in the 8080 emulator implementation.
It wouldn't be hard to base a Z80 emulator on top of this to allow testing programs to run on the MP3 player. And to write a Z80 assembler in Factor that generated the binaries to upload to the device. 'loadram' was Linux based and has been recently ported to Windows. It uses libusb to communicate with the player. By adding libusb wrappers to Factor it would be possible to assemble and upload directly to the player from a Factor environment - and it should work on Windows, Linux and Mac OS X.
I put together a quick wrapper around libusb and added it to my repository:
darcs get http://www.bluishcoder.co.nz/repos/factor
This has been tested to work on Linux and Mac OS X. I'll try adding a nice Factor wrapper around the alien definitions and get 'loadram' ported.
Note that to implement the alien wrappers I had to modify Factor's alien C structure wrappers to accept arrays of characters. The patch for this is in my repository but may not necessarily be pulled by Slava into the main Factor repository. I need to tidy it up and work on it before that might happen.
Once libusb is working and loadram is ported I'll try getting the Z80 emulator and disassembler going.
If you're looking for suitable players, Dick Smith Electronics in New Zealand, has at least two models that work. The first is their DSE branded 128MB MP3 player, model number A2439. This is a very basic model and is quite cheap. It has a black and white LCD screen which can be written too using the S1MP3 open source code.
Another model they have is the AStone Samba AV MP4 player. This has a colour OLED display and can play video and pictures - on its very tiny screen. Calling it an MP4 player is a bit of a stretch. It can't actually play MP4's. You use their client software to convert videos in other formats to an AMV format which has awful quality (not that it matters on the tiny screen) but otherwise works ok. The downside of this player is it seems that there is no known way of writing to the colour OLED displays yet.
What sort of things could be written to run on the MP3 players? I'm not sure yet but it'll be an interesting 'spare time' project to play with.
Categories: factor, s1mp3

9 Comments:
hi do you know if a program could be written or is already available safe to use for the Diablotek "MP4 Player"? that could allow a user to input text? It has 16 chars per row and 7 rows... there are 5 buttons (menu, volume, left/rewind, right/ff, and play/pause/select)... so once you're in ebook mode there is a list of options: local folder, play set (of txt files), delete file, and exit... for instance could we add another option like "compose"? ... then when you're in compose mode, you would see your cursor on rows 1-3 with a-p on one line q-z and some chars like @,.- on 2nd line, 0-9 and some chars like space, delete, caps lock <- on 3rd line. then on lines 5-6 you could view the txt your typing and the volume key could be used to skip to next row, the left and right keys could scroll through a row, and play key would select a character. . . also would like to know if there is a program to change font size like i had on my wrist pda (the screeen was smaller, but you can change the font size and weight). Thanks!
Unfortunately not much is known about accessing all the features of the MP3 players, and even less is known about the MP4 players. I hope things like this will be possible eventually though.
Hmm i was thinking about modifying firmware in my MP4 player so you can select songs within a list of five of them [when you select "delete file" you see a list - it is more easier to find the song you want this way, only if i could change delete function with play]. This way you can only see one song per screen. Very retarded. I just want to see it like on ipods for example. Five songs, scrool down, scrool up, select song, play. Simple as that. Thnx ahead. ;]
Hello, I`m Fabio
I have a MP3 and this doesnt work...
Maybe the firmware...
Can you help me?
Do you know about firmware Kenwood HD20GA7?
Can you write the MP3 player firmware?
Where I can download it?
Do compatible firmware exist?
Well, I hope your reply...
Thanks you
Fabian
aetherae@gmail.com
i have a mp4 of board MD-075-V2
Atj2085 H
samsung memory chip
written as ipod with apple logo
i updated with wrong firmware
can u tell me where can i find this F/W.
or can u design it for me.
contact at:
frank_hug_619@yahoo.com
You may be able to find firmware at http://etronicsland.com/page.html?chapter=0&id=8
hi, my dad DELETED all the firmware off this ipod knock off mp3 player thing i have, and it has no manufacturing information at all, there is absolutely nothing on this thing. i was wondering if i could reprogram it, im not good with programming though, i am only a 15 year old girl, lol. and they havent anyclasses like this at my school. i want to put completely new firmware on it, but without know anything of the device, i thought this completely imposible. can you help me please? my email is
rie_vanity@live.com
i hope someone can help me -.-
♥RIE♥
Good Day !
I would like to ask for your assistance on how to reprogram my mp4 player. My mp4 player doesn't play anymore. After I 'reboot' my player, my mp4 doesn't back to normal at all. The display in the will appear but I can't scroll it anymore. All the buttons are malfunctioning except the reset button. What should I do? Please help me for this.
best regards,
_nashty_
After I "reboot" my mp4 player, my player doesn't back to normal anymore. If you press the switch "ON" the menu icons will appear but all the buttons doesn't work anymore, the scroll button, etc. except the "reset" button. What should I do? you send your reply at my yahoo mail.
nash_suave2000@yahoo.com
Thank you!
_nashty_
Post a Comment
<< Home