Rockbox Technical Forums

Rockbox Development => New Ports => Topic started by: Massa on June 07, 2018, 03:26:36 AM

Title: Shanling M2s
Post by: Massa on June 07, 2018, 03:26:36 AM
Hi everybody,

I did some research work at my Shanling M2s device.
Find my results at the Wiki at https://www.rockbox.org/wiki/Main/ShanlingM2sPort (https://www.rockbox.org/wiki/Main/ShanlingM2sPort)

Here some summaries:
It is possible to unpack and repack the original firmware update.upt and it's including ubifs system partition - either by some linux python tools or by some tools provided by Shanling (actually to do some theme tweaking) under Windows.

I unpacked the firmware and compared it with the one from AGPtEK Rocker - they are very very similar (although the hardware is different).
It boots a small Linux, starts a so called "System server" as abstraction layer to the hardware and then starts a "hiby_player" which communicates with this server.

I injected some special init scripts with which I'm able to continue work just by putting scripts and files on the SD card.

I used wodz rockbox fork for the AGPtEK Rocker, did some initial tweaking for the much different resolution (480x800), compiled the beast and put it on my device.
Then I tweaked another script that it loads the rb_bootloader from my SD device instead of the default hiby_player and restarted the device...
Title: Re: Shanling M2s
Post by: Massa on June 07, 2018, 03:31:20 AM
Starting with Shanling's boot logo...
(http://01Shanling_BootLogo.jpg)
Title: Re: Shanling M2s
Post by: Massa on June 07, 2018, 03:31:59 AM
Switching to Rockbox Bootloader
(http://02Rockbox_Bootloader.jpg)
Title: Re: Shanling M2s
Post by: Massa on June 07, 2018, 03:32:37 AM
Which loads Rockbox...
(http://03Rockbox_Booting.jpg)
Title: Re: Shanling M2s
Post by: Massa on June 07, 2018, 03:33:14 AM
Here's the final menu after Rockbox loaded:
(http://04Rockbox_Menu.jpg)
Title: Re: Shanling M2s
Post by: Massa on June 07, 2018, 03:40:55 AM
To make it clear: the whole thing is a big hack, based on wodz AGPTEK Rocker repository which itself is currently a (not so big) hack!

It's currently totally unusable because only the power button does work and as I can see in the log file, the headset device is also not accessible (so no "Ladies an gentlemen we have sound" atm.)

So there is still really a lot to do - but it shows, that it's possible to port Rockbox to newer devices!  ;)

Don't expect anything in near future, my spare time is very limited!

I also have the problem that I still don't have direct (shell) access to the device.
Only outputting something in a log at the SD card works - actually it is possible to start an adbd at the device - it starts and it also runs, but I'm unable to connect to it  ???
wodz told me that at the Rocker device (if you start the adbd) you can connect to it.

So if anybody wants to help - please contact me!  :)
Title: Re: Shanling M2s
Post by: artixerix on June 07, 2018, 07:20:40 AM
I can do the testing of new builds, since I own one of those. I hope that counts as help.
Title: Re: Shanling M2s
Post by: Massa on June 07, 2018, 11:05:46 AM
I can do the testing of new builds, since I own one of those. I hope that counts as help.
Thanks, but that's a later step - currently research help is needed.
I need to find out more about the device (or better: it's behaviour in Linux) - e.g. how I can get a real shell access (or how to make that adbd working).
Or maybe to disassemble the hiby_player binary to find out how the communication between the player and the system server works (which button names will be sent, which commands are available etc.).
Especially find out what are the differences to the AgpTek Rocker implementation!

I cannot provide any builds currently - it's all "handmade hacking" including the installation steps  :-X
Title: Re: Shanling M2s
Post by: Massa on June 10, 2018, 08:08:20 AM
There is some small progress about which I want inform you:

I found out why the adbd is not accessible - the reason is the started hiby_player!
This beast always overwrites the /sys entries which are needed to make the adb accessible  :(

So when I start the rockbox bootloader instead the adb is still working  :)

With that I now have shell access to the device - but not with shanling's player...

I also managed to compile an event test program and put it at the device.
With that I found out the keys to use...

All findings are written down to the above mentioned wiki page...
Title: Re: Shanling M2s
Post by: 7o9 on June 25, 2018, 09:08:18 AM
Hey Massa,

Based on the description you provided I tried similar initial steps on my Shanling m0 with some similar results.

The update.bin firmware file contains a tar (not gzip'd) named firmware_v0.tar.gz which contains a whole lot of zips (5 parts recovery, 35 parts system.ubi and 3 parts xImage). After merging the parts of system.ubi I was able to extra the contents.

The m0 also runs Linux and starts /usr/bin/shanling-play.

It might be possible to get Rockbox running the same way you did for the M2s. One caveat, the m0 is a touchscreen device with only one volume knob/button.

(The firmware update I used was: https://drive.google.com/open?id=101OpR2iCtQ5eRaUQ37-6O-BSuP9ifoV-)

Code: [Select]
Image Name:   Linux-3.10.14-svn208
Created:      Thu Jun  7 03:21:05 2018
Image Type:   MIPS Linux Kernel Image (uncompressed)
Data Size:    4624384 Bytes = 4516.00 kB = 4.41 MB
Load Address: 80f00000
Entry Point:  80f00000
Title: Re: Shanling M2s
Post by: Massa on June 30, 2018, 02:22:47 AM
Based on the description you provided I tried similar initial steps on my Shanling m0 with some similar results.
Nice!  :)
That means my assumption that more and more devices are based on a similar infrastructure is correct!

Another user made the same tests with his M1 - this one is even more similar (just another resolution)...

It might be possible to get Rockbox running the same way you did for the M2s. One caveat, the m0 is a touchscreen device with only one volume knob/button.
Yes, that means more work...

Could you please a similar Wiki page than the one for the M2s and the AGPTEK Rocker and put your findings about the M0 in?

BTW, the AGPTEK H50 looks very similar to the M0 (but without the touchscreen) - maybe this one is also made with a similar infrastructure?

I wish I would have more spare time to get rockbox things rolling for the M2s...  :'(
Title: Re: Shanling M2s
Post by: Massa on August 06, 2018, 03:38:41 AM
I just want to inform you that there's currently absolutely no progress.

It's summertime, the weather is fine and I'm currently not in the mood to "waste" spare time for the shanling port.
Sorry - but I promise, that I continue in autumn / winter when the weather is no longer as good as it is now  ;D
Title: Re: Shanling M2s
Post by: artixerix on August 06, 2018, 08:43:43 AM
I just want to inform you that there's currently absolutely no progress.

It's summertime, the weather is fine and I'm currently not in the mood to "waste" spare time for the shanling port.
Sorry - but I promise, that I continue in autumn / winter when the weather is no longer as good as it is now  ;D
Well...that's better than no information at all...not like I have mixed feelings about it or anything  :'(
Title: Re: Shanling M2s
Post by: sirsurthur on November 19, 2018, 04:36:47 AM
Hello Massa,

Thanks a lot for your work on the Shanling M2s.

Have you made any further progress for this device ?

There is no rush (I am juste curious).

Best wishes,
Title: Re: Shanling M2s
Post by: speachy on April 07, 2020, 11:38:21 AM
Massa,

Did you make more progress on this port?

As of a few days ago there are now three mainline rockbox targets that share the same Ingenic+Hibyplayer architecture, including the ability to automatically patch a bootloader into the factory firmware image, so developing a working port is now a much simpler undertaking.