Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  New Ports
| | |-+  Fiio M3k
« previous next »
  • Print
Pages: 1 ... 5 6 [7] 8 9 ... 27

Author Topic: Fiio M3k  (Read 60974 times)

Offline speachy

  • Administrator
  • Member
  • *
  • Posts: 322
Re: Fiio M3k
« Reply #90 on: December 06, 2020, 11:07:28 AM »
Quote from: bahus on December 06, 2020, 10:51:05 AM
2) Strange shutdown behavior. In latest build you need to press shutdown button way longer. It looks like it's now two stage shutdown (first screen then backlight)
3) It looks like there is power drain when player is shut down by Idle power off or Sleep timer. Noticed few times that after full charge it's been almost dead next day when it's been shut down by idle power off after only few minutes of real use.

These are the same; the player is not getting shut down at all via software (due to the broken-ass kernel), and continuing to hold the power button eventually trips the hardware-level poweroff.

Logged

Offline vitt13

  • Member
  • *
  • Posts: 59
Re: Fiio M3k
« Reply #91 on: December 06, 2020, 02:11:14 PM »
Do we need libSDL (generally) to use rockbox port on M3K? I see that lib was discussed in IRC, but the lib file missed in M3K OF and it presents in AGPTEK Rockr OF.
If it needs, can we bring libSDL-1.2.so.0 from Shanling M2s OF (same X1000/E) since that firmware contains many of the same lib files (in binary comparison) as M3K OF?
Logged

Offline vitt13

  • Member
  • *
  • Posts: 59
Re: Fiio M3k
« Reply #92 on: December 08, 2020, 01:36:53 PM »
Quote from: speachy on November 30, 2020, 11:39:11 AM
the m3k's underlying Linux kernel and base OS is a real hacky mess
I'm not a good programmer but (even for such inexperienced in Linux kernel stuff programming person like me), Fiio's AK4376 driver seems like that developer just rewrote AXP173 driver (why?) with similar realizing all that i2c communication stuffs.
https://github.com/FiiOapp/FiiO_Kernel_M3K/blob/master/sound/soc/ingenic/ocodec/ak4376.c
BTW, same picture is here (that probably is "new" version since M5 was released later and has AK4377 DAC)
https://github.com/FiiOapp/FiiO_Kernel_M5/blob/master/sound/soc/ingenic/ocodec/ak4376.c
Why did programmer not rewrote existing GPL driver from AK? It obviously exists  :-X
https://github.com/rcstar6696/android_kernel_huawei_hi3660/blob/master/drivers/huawei_platform/audio/ak4376/ak4376.c
https://github.com/LG-SD4XX/android_kernel_lge_cv1/blob/master/sound/soc/codecs/ak4376.c

---
I've just found signing tools, splitting scripts and keys in latest Ingenic's SDK ingenic-linux-kernel3.10.14-x1000-v9.0-20191212.tar.bz2 (1.49GB)
in \development\tools\ota and \ota-nand
splitting script
Logged

Offline vitt13

  • Member
  • *
  • Posts: 59
Re: Fiio M3k
« Reply #93 on: December 22, 2020, 12:39:59 PM »
I've just got Ingenic cloner tool with suitable configs for M3K and M5 devices from FiiO's Tech.Support. The archive with tool is also contains original firmware parts (i.e. x-boot, recovery, xImage, system and data). The config is not such different that I suggested, but at least now I have complete and safe way to recover M3K. BTW, new OF has been released and new devices come with 1.4.5 OF onboard.

There is also the way to get log files form OF: just go to "System Settings"->"About M3", and quick press the hardware Play/Pause ⏯ button in the left side for several (13 for me) times until 'copy log done' notification appearing on the screen.

Then you'll find 'm3klog' folder in the root of the microSD card.
Here is mine just for reference
* kernel.txt (97.31 kB - downloaded 106 times.)
* kernel_last.txt (85.54 kB - downloaded 45 times.)
* m3klog.zip.txt (69.42 kB - downloaded 51 times.)
Logged

Offline vitt13

  • Member
  • *
  • Posts: 59
Re: Fiio M3k
« Reply #94 on: December 22, 2020, 02:39:54 PM »
Here is the config (remove *.txt extension) for Ingenic cloner tool v2.5.0 for M3K/M5 devices.
I was worried about [nand] section, blindly making my own config. But it never mind now here is the original one.
* x1000_sfc_nand_lpddr_recovery.cfg.txt (1.81 kB - downloaded 71 times.)
Logged

Offline vitt13

  • Member
  • *
  • Posts: 59
Re: Fiio M3k
« Reply #95 on: January 03, 2021, 03:54:41 PM »
If someone else is looking for X1000 PM, here is it https://raw.githubusercontent.com/xyfabc/my_books/master/X1000_PM_20160113.pdf
(btw was on ftp).
Logged

Offline alexs

  • Member
  • *
  • Posts: 15
Re: Fiio M3k
« Reply #96 on: January 04, 2021, 04:15:57 AM »
Also available here: https://github.com/JaminCheung/x-loader/tree/master/documents/cpu

That's the bootloader source, and there's some other Ingenic stuff there as well.
Logged

Offline vitt13

  • Member
  • *
  • Posts: 59
Re: Fiio M3k
« Reply #97 on: January 17, 2021, 05:20:39 PM »
Quote from: alexs on January 04, 2021, 04:15:57 AM
Also available here: https://github.com/JaminCheung/x-loader/tree/master/documents/cpu

That's the bootloader source, and there's some other Ingenic stuff there as well.
Nice. There's also ota tool and keys to build/re-build M3K.fw.
I successfully unpacked M3K.fw on parts (xImage, system.ubi, x-loader-pad-with-sleep-lib.bin) and then rebuild M3K.fw with the same signed numbers of updateNNN.zip.
Here is my dirty windows standalone package I built with PyInstaller https://github.com/VitToCode/linux-recovery-ota/releases/tag/1.0
but Linux users directed to JaminCheung original repo.
Logged

Offline speachy

  • Administrator
  • Member
  • *
  • Posts: 322
Re: Fiio M3k
« Reply #98 on: January 18, 2021, 10:59:45 PM »
I just finished a little poking around the 1.4.5 m3k update, trying to get an idea what was actually changed.

1) there's an updated kernel build (no idea what actually changed, as the sources they've released (in 2018-12) don't seem to correspond to any of the binary builds.
2) Startup script recreates /data partition if it's busted  (responsible for the "welcome screen" hang)
3) New player binary

I doubt any of the general platform jankiness has been fixed.
Logged

Offline ZoRG172

  • Member
  • *
  • Posts: 10
Re: Fiio M3k
« Reply #99 on: January 21, 2021, 11:31:10 AM »
Does this mean that dev builds of Rockbox for M3K we will not see in the near future?
Logged

Offline FroggestSpirit

  • Member
  • *
  • Posts: 6
Re: Fiio M3k
« Reply #100 on: January 25, 2021, 09:32:57 PM »
I looked into building the kernel from the FiioApp github, but I wasn't able to (I think it requires a gcc 5 or lower for mipsel). I downloaded the newest version of buildroot from the official github, and was able to build this sucessfully. I believe they recently added Ingenic Xburst (X1000) in the kernel. I'm not really sure what to do with the generated images though, otherwise I was going to try injecting the newly built kernel.
Logged

Offline vitt13

  • Member
  • *
  • Posts: 59
Re: Fiio M3k
« Reply #101 on: January 26, 2021, 01:24:24 AM »
Quote from: FroggestSpirit on January 25, 2021, 09:32:57 PM
I looked into building the kernel from the FiioApp github, but I wasn't able to (I think it requires a gcc 5 or lower for mipsel).
Look at M5 kernel source https://github.com/FiiOapp/FiiO_Kernel_M5 and compare it with M3K. M5 sources is almost complete but just missing *.S files. And correct ak4376 driver is also there. Just recover needed *.S files and can build the M5 kernel. I use prebuilded mips-gcc472-glibc216 toolchain from Ingenic (also on github).
I started with it I thought it might be helpful to rebuild recovery image (xImage with glued ramdisk) with patched 'recovery' (fw update) utility to pass through the unsigned update archives. Since we found on github the correct pair of signing keys from Ingenic developer, now we can build M3K.fw like genuine ones. BTW M5 original firmware built with the different private key but same public key and I'm trying to work around bypass the signature check on M5 device for my friend.
Logged

Offline FroggestSpirit

  • Member
  • *
  • Posts: 6
Re: Fiio M3k
« Reply #102 on: January 27, 2021, 10:35:36 PM »
Here's what I got so far to build the kernel:
Download the Halley2 dev stuff here: ftp://grids.be/../mirror/ftp.ingenic.cn/DevSupport/Platform/Halley2/
There's some instructions here: http://www.ingenic.com.cn/en/?newsshow/tp/228/id/108.html
Instead of using "make halley_linux_defconfig" I attached a copy of the .config file that can be used for building the kernel (Mostly from the M5 repo, but modified) rename it to .config

Build the u-boot in the platform/u-boot folder with "make halley_uImage_spinor"
copy "platform/u-boot/tools/mkimage" to the bin folder of the mips cross compiler, and rename it to "mips-linux-gnu-mkimage"
build the kernel in the platform/kernel folder with "make uImage"

I didn't test this yet, but it will build a uImage.
Keep in mind this does not include the AK4376 driver, so that will need to be adapted

EDIT: I wasn't able to get this to boot with the USBFlasher, but if anyone tries, make sure to have a backup handy first. All my attempts bricked it, so I needed to restore from a backup
* config.txt (59.31 kB - downloaded 36 times.)
« Last Edit: January 27, 2021, 10:48:47 PM by FroggestSpirit »
Logged

Offline vitt13

  • Member
  • *
  • Posts: 59
Re: Fiio M3k
« Reply #103 on: January 28, 2021, 06:38:00 AM »
Quote from: FroggestSpirit on January 27, 2021, 10:35:36 PM
Here's what I got so far to build the kernel:
...
EDIT: I wasn't able to get this to boot with the USBFlasher, but if anyone tries, make sure to have a backup handy first. All my attempts bricked it, so I needed to restore from a backup
You're going the wrong way.
Here the kernel build environment I recreated from FiiO M5 kernel sources https://github.com/VitToCode/FiiO_Kernel_M5
you just need that and the toolchain.
Rebuilded xImage and recovery has been flashed and tested on M5 device. BTW I use x-loader from original firmware.
Note: if you going to flash only specific partition (i.e. xImage) make sure you uncheck "All erase" setting on SFC tab USB Cloner Tools's.
If you are looking for latest Ingenic Halley2 kernel source, you can find it here http://www.ingenic.com.cn/en/?product/id/9/lm/4.html
Just scroll down to 'Downloads'. Latest version is 'ingenic-linux-kernel3.10.14-x1000-v9.0-20191212.tar.bz2'

* xImage.png (55.08 kB, 734x419 - viewed 109 times.)

* recovery.png (63.51 kB, 736x417 - viewed 89 times.)

* all_erase.png (10.61 kB, 776x457 - viewed 103 times.)

* settings.png (20.5 kB, 776x457 - viewed 101 times.)
Logged

Offline FroggestSpirit

  • Member
  • *
  • Posts: 6
Re: Fiio M3k
« Reply #104 on: January 31, 2021, 02:19:17 PM »
Thank you for pointing me in the right direction. I created a repo with a working M3K kernel build, which built off of your repo (thank you!).
This one should be all self contained, the toolchain is included, and all that should need to be done (assuming you have the needed dependancies), is to run build.sh (I did testing in x64 Linux)
https://github.com/froggestspirit/FiiO_M3K_Kernel
I removed a few things from the build that shouldn't be needed, like other archetectures and wireless stuff. From my tests, the kernel worked as normal while using XVortex's rockbox build, although there were a couple SD card issues on the OFW, though I'm not sure if that was user error.
Logged

  • Print
Pages: 1 ... 5 6 [7] 8 9 ... 27
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  New Ports
| | |-+  Fiio M3k
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.03 seconds with 16 queries.