Coder Social home page Coder Social logo

jq6500-tool's Introduction

JQ6500-tool

Tool for uploading and downloading JQ6500 MP3 module

JQ6500 This one: https://www.elecfreaks.com/wiki/index.php?title=JQ6500_Mini_MP3_Module

The device has about 1834900 bytes for MP3 data.

Install python-scsi first: (https://github.com/rosjat/python-scsi.git)

sudo pip install pyscsi[sgio]

To write tracks:

sudo python jq6500tool.py track01.mp3 track02.mp3 track03.mp3

The device may be shown as APC UPS in lsusb listing:

Bus 002 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply

But it still works. The device is identified as CD-ROM and SD card reader composite device in the kernel log:

[ 3681.857961] usb 4-2: new full-speed USB device number 6 using uhci_hcd
[ 3682.038066] usb 4-2: New USB device found, idVendor=e2b8, idProduct=0811
[ 3682.038069] usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=1
[ 3682.038071] usb 4-2: Product: CD002
[ 3682.038073] usb 4-2: Manufacturer: CD002
[ 3682.038075] usb 4-2: SerialNumber: CD002
[ 3682.040151] usb-storage 4-2:1.0: USB Mass Storage device detected
[ 3682.040648] scsi host8: usb-storage 4-2:1.0
[ 3683.066138] scsi 8:0:0:0: Direct-Access     CAI      CD002-1          1.00 PQ: 0 ANSI: 0
[ 3683.069142] scsi 8:0:0:1: CD-ROM            YULIN     PROGRAMMER      4.05 PQ: 0 ANSI: 2
[ 3683.070182] sd 8:0:0:0: Attached scsi generic sg4 type 0
[ 3683.082134] sd 8:0:0:0: [sdd] Attached SCSI removable disk
[ 3683.089179] sr 8:0:0:1: [sr1] scsi-1 drive
[ 3683.089479] sr 8:0:0:1: Attached scsi CD-ROM sr1
[ 3683.089608] sr 8:0:0:1: Attached scsi generic sg5 type 5

The module has 2MB flash memory. Memory map:

0x000000 - 0x03ffff  CD-ROM image
0x040000 - 0x1fffff  Header and MP3 data

Header: Directory structure is described in little endian 32 bit unsigned integers.

Header:
# 4 Number of subdirectories (N)
# N*4 Offset of subdir
Subdir:
# 4 Number of tracks in this dir (M)
# M*8 Directory entry
#   4 Offset of track
#   4 Size of track
#
# Example headers
# 05 00 00 00 18 00 04 00 ec 42 06 00 f0 42 06 00 f4 42 06 00 f8 42 06 00 01 00 00 00
# 05 00 00 00 18 00 04 00 62 00 04 00 66 00 04 00 6a 00 04 00 6e 00 04 00 03 00 00 00
# 05 00 00 00 18 00 04 00 57 8c 04 00 5b 8c 04 00 5f 8c 04 00 63 8c 04 00 02 00 00 00

To check the CD-ROM image

sudo python jq6500tool.py -r MusicDownload.iso -s 1024 -o 0
sudo mount -o loop MusicDownload.iso /mnt
ls -l /mnt/
total 78
-r-xr-xr-x 1 root root    37 maali 12  2013 autorun.inf
-r-xr-xr-x 1 root root    99 tammi 14  2014 config.ini
-r-xr-xr-x 1 root root 77904 tammi 14  2014 MusicDownload.exe

Thanks to rma-x for subdirectory info. See #1

jq6500-tool's People

Contributors

flameeyes avatar kasbert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

flameeyes

jq6500-tool's Issues

JQ6500 file system details

I have written a similar tool for the JQ6500, but in C and a bit earlier:
https://chiselapp.com/user/rmax/repository/jq6500

For that, I found out some more details about the "file system" header at offset 0x40000 that I want to share with you:

The meta data of the JQ6500 file system consists of little endian 32 bit unsigned integers that have the following meaning:

0 .. 3: Number of subdirectories
4 .. 7: Offset of subdir 1 (A)
...
A .. (A+3): Number of files in this dir
(A+4) .. (A+7): Offset of file 1 (B)
(A+8) .. (A+11): Size of file 1 (C)
...
(B) .. (B+C): MP3 data of file 1

So, for the first example hex dump in your readme, this means:

05000000: There are five directories in the file system
18000400: The 1st directory begins at 0x00040018
ec420600: The 2nd directory begins at 0x000642ec (after the data of dir #1)
f0420600: The 3rd directory begins at 0x000642f0
f4420600: The 4th directory begins at 0x000642f4
f8420600: The 5th directory begins at 0x000642f8
01000000: The 1st directory contains 1 file

Offsets for dirs and files can point anywhere in the flash. They don't need to be in any particular order and may also point to addresses below 0x40000.

But for using the area below 0x40000 for MP3s (at the expense of the embedded CD image) I found another trick to be more useful: The flash content wraps around at the end, so you can treat the flash as a continuous address space going from 0x40000 to 0x240000 (for the 16Mbit/2MByte model).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.