Rockbox Technical Forums

Installation / Removal => Manual Installation => Other - Installation/Removal => Topic started by: amachronic on May 15, 2021, 01:16:40 PM

Title: FiiO M3K Install (Native port)
Post by: amachronic on May 15, 2021, 01:16:40 PM
Official FiiO M3K Native installation instructions
The installation instructions and bootloader download links can now be found on the Rockbox wiki at https://www.rockbox.org/wiki/JztoolInstall.

As always if you encounter any issues, spot mistakes, or have suggestions for improvements don't hesitate to point them out.

Update April 06 2022
A new version of the bootloader has been released, bf3e67204c-20220402, which includes a number of dual-boot related bugfixes and adds support for multiboot. Usage instructions for multiboot can also be found on the wiki, at https://www.rockbox.org/wiki/MultibootBootloader.

Update March 27, 2022
The M3K install instructions have now moved to the wiki: https://www.rockbox.org/wiki/JztoolInstall

There are no changes to the installation process.

I'll remove the instructions from this post in favor of the wiki at some point, but I'm leaving them up here for a little while since they're not actually out of date.

Update June 14, 2021
Dual boot support was added! You can now boot the original FiiO firmware alongside Rockbox, useful if you want to use the USB DAC feature or the microphone for recording. If you've already installed an earlier version of the Rockbox bootloader, you can update to the latest version using the recovery menu, accessed by holding Vol+ while booting. Just copy bootloader.m3k to the root of your SD card, and pick "Install/update bootloader" from the recovery menu.

To access the FiiO firmware, hold the Play button while booting. You can access the FiiO recovery mode by holding Play and Vol+ while booting, in case you need to update the FiiO firmware. Be warned that updating with the FiiO recovery mode will erase the Rockbox bootloader and you will need to install it again using jztool.

Installing the bootloader
Download the Rockbox bootloader bootloader.m3k and the installation utility jztool for your platform. You will need to refer to the bootloader file later on the command line so it's recommended to put both files in the same folder.

Next, connect the M3K in USB boot mode: plug in one end of the USB cable, and then plug in the other end while holding down the Volume Down button. If you did it correctly then the button light will turn on and the LCD will remain off. Since the USB boot mode is very low level, you might not see any indication on your computer that a USB device was plugged in.

Windows users should now follow the USB driver installation instructions below, before running jztool.

To load the Rockbox bootloader, open a terminal / command prompt in the folder where you downloaded jztool and run the command below. If you have put bootloader.m3k in different folder, you will have to adjust the path accordingly.

Windows:
Code: [Select]
jztool.exe fiiom3k load bootloader.m3k

Linux and Mac: (Linux users will need to run jztool as root, eg. with sudo or su -c)
Code: [Select]
./jztool fiiom3k load bootloader.m3k

You should see the Rockbox recovery menu appear on your M3K. If this doesn't happen, check the terminal window for errors. Should you encounter repeated problems loading the bootloader please post here so we can be aware of the problem.

It is highly recommended that you take a backup of the original firmware's bootloader using the "Backup bootloader" option before installing, just in case anything goes wrong or you need to restore the old bootloader for any reason. The backup file fiiom3k-boot.bin will be placed on the root of your SD card, make sure to copy it to your computer and keep it safe somewhere. If you need to restore the bootloader, copy the backup file to your SD card and repeat the steps above to re-load the Rockbox bootloader. Then pick "Restore bootloader" from the menu.

To install the Rockbox bootloader, copy bootloader.m3k to the root of a FAT32-formatted SD card and plug it into your M3K, and choose "Install/update bootloader" from the recovery menu. Once the bootloader is installed, you can access the recovery menu by holding Volume Up while powering on the M3K.

Assuming everything went smoothly, you need to install Rockbox itself to complete the installation.

Installing Rockbox
Once the bootloader is installed, you will need to extract a copy of Rockbox to your SD card.

1. Download a development build of Rockbox from https://www.rockbox.org/daily.shtml.
2. Use your player or another SD card reader to mount the drive on your computer. If you use the M3K, select "USB mode" from the bootloader menu. It's necessary to select USB mode before plugging the cable in.
3. Take the .zip file that you downloaded and use the “Extract all” command of your unzip program to extract the files onto your player.

Note: The entire contents of the .zip file should be extracted directly to the root of your player’s drive. Do not try to create a separate directory on your player for the Rockbox files! The .zip file already contains the internal structure that Rockbox needs.

If the contents of the .zip file are extracted correctly, you will have a directory called .rockbox, which contains all the files needed by Rockbox, in the main directory of your player’s drive.

You can perform the above steps again whenever you want to update Rockbox to the latest development build, to take advantage of bugfixes and new features.

Windows USB driver installation
jztool uses a library called libusb to access the M3K in its USB boot mode, and on Windows you need to enable the WinUSB driver for the M3K to make it accessible by libusb. WinUSB is a Microsoft driver and comes bundled with Windows, but unfortunately it's not easy to enable it directly, as it's intended to be "installed" by 3rd party applications as needed.

The recommended way to install the driver is using Zadig, a tool dedicated to installing various USB drivers on Windows for libusb-based applications (download link is at the end of the post). Zadig will require administrator access on the machine you're using. Also note that Zadig is not supported or maintained by the Rockbox developers, so we generally cannot provide support for any Zadig-specific issues you might encounter.

After connecting the M3K to your computer in USB boot mode, open Zadig and select the M3K from the drop down menu. Note the name may end up displaying strangely (just an "X" and a hollow square), the important thing is that the USB IDs are the correct ones (A108 1000).

(https://www.rockbox.org/wiki/pub/Main/FiioM3K/zadig.png)

Ensure you select the WinUSB driver and click "Install Driver". This can take a couple of minutes to complete. Assuming the driver installs successfully you can continue with the installation instructions above.

Note: if WinUSB does not work for you, you can try installing the libusbk driver instead. It might also be necessary to unplug the M3K, power it off, and reconnect it in USB boot mode to ensure the new driver is used.

Links
Title: Re: FiiO M3K Install (Native port)
Post by: GSV3MiaC on June 04, 2021, 12:52:48 PM
After I used the recovery tool to save a copy of the original boot loader, Windows (10, 64 bit) decided my micro SD card was corrupted and insisted on checking it for errors (which, being a large card full of music, took an age). I guess the 'backup the original boot loader' option may write to the card in some fashion windows does not approve of (at least the card did not provoke the error before I did that step).

Needless to say after the check 'no errors were found'. Gates Lives!!

Apart from that the install was a success, although I struggled to find a set of font files (the link takes me to a page where the FIIO M3K doesn't have any download items), nor is there yet any documentation (beyond how to install), but I am sure I can figure out what the various buttons  and touchscreens do. The wiki is desperately dated - go look at 'hardware you can buy which supports RB' and marvel over how none of it actually exists in the wild anymore (heck some of the makers have vanished too).
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on June 04, 2021, 06:25:57 PM
Happy you got it working! From the sounds of it you may have already found it, but the font pack can be downloaded from the Extras (https://www.rockbox.org/wiki//RockboxExtras) page (it's also a link on the sidebar). Though I can't find where that bit of info is actually documented. I'm not sure what other link you're referring to?

I'm not sure why the filesystem is being interpreted as "corrupted". After a little investigation none of the likely culprits that came to mind seem like they should be the issue, so let me know if it reoccurs in normal usage.
Title: Re: FiiO M3K Install (Native port)
Post by: GSV3MiaC on June 05, 2021, 03:38:53 PM
Yes, it is working.

.. the extras page says "A link to the latest font-pack can be found here.", but 'here' takes me to where there is a list of ancient players, none of which are the FIIO.

The alleged file corruption has not shown up again (but I haven't backed up the original boot loader using the recovery system again, so I doubt it would). I did have one more wrinkle - the new SD card showed up exfat formatted (being 128GB .. well 116GB in real money), and of course no way would RB mount that file system, and Win10 declines to reformat it as FAT32 (although it will sit for hours doing it before telling you it failed, if you force Powershell to try). Downloaded a suitable utility, reformatted the card, and was back in business (RB loaded fine). The original card I was using WAS fat32, stolen from my phone .. I guess I could have tried a reformat with the phone, or a camera or something .. can't reformat with the FIIO as I can't boot RB (the OF would presumably have done it, but that would involve re-undoing the boot loader etc). Not sure if RB has a format facility anyway, never needed it.
Title: Re: FiiO M3K Install (Native port)
Post by: bluebrother on June 05, 2021, 04:15:20 PM
.. the extras page says "A link to the latest font-pack can be found here.", but 'here' takes me to where there is a list of ancient players, none of which are the FIIO.

If you closely look at the links for the fonts pack you'll notice it's the same file for all players ... So take your pick.

(In other words, the fonts pack is independent of the actual player model)
Title: Re: FiiO M3K Install (Native port)
Post by: GSV3MiaC on June 06, 2021, 03:27:02 PM
In which case why doesn't the 'here' just take me to the font pack download, instead of a page with a selection of identical font packs downloads masquerading as separate for different player?  :D

As it happens I already downloaded the X3 version, which works fine, but I still think it could be less confusing! Actually I'm not sure why the font pack isn't just rolled into the release .zip, since practically everyone/every theme is going to need some of it. We are talking GByte (going on TB) memory players these days, not 'gosh I don't have 64k for some extra fonts, what can I leave out'.
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 07, 2021, 07:47:07 PM
I'm Following the install instructions. I have the bootloader and the jztool.exe in a folder on my desktop. Used zadig to install driver. I'm soon to be 70 years and not very computer savy. How do I put a terminal/command prompt in that folder?
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 07, 2021, 08:22:44 PM
Figured that out but got message device not found
Title: Re: FiiO M3K Install (Native port)
Post by: dconrad on June 07, 2021, 08:43:37 PM
Figured that out but got message device not found

Oh whoops, sorry I typed out a response but I thought you said "command not found". Sorry!
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 07, 2021, 09:03:11 PM
it says username\Desktop\Rockbox M3K install>cd Desktop
The System cannot find the path specified
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 07, 2021, 09:06:42 PM
The files in my folder on the desktop are:
bootloader m3k
jztool.exe
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 07, 2021, 09:39:03 PM
Tried again Got to the recovery menu. back up was succesful. went to install or update got error: -1102
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 07, 2021, 09:54:23 PM
Am I just supposed to start Rockbock after doing backup?
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on June 08, 2021, 04:43:35 AM
Tried again Got to the recovery menu. back up was succesful. went to install or update got error: -1102
That error is indicating that bootloader.m3k cannot be opened. (Guess I should've added proper error messages...)

You probably just forgot to copy bootloader.m3k to your SD card:
Quote
To install the Rockbox bootloader, copy bootloader.m3k to the root of a FAT32-formatted SD card and plug it into your M3K, and choose "Install/update bootloader" from the recovery menu.
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 08, 2021, 09:12:22 AM
Tried starting over. when trying to install zadig could not find device. could not get to recovery screen. The good news is original firmware 1.4.5 still works!
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on June 08, 2021, 09:57:15 AM
You need to reconnect the M3K in USB boot mode -- turn off the player, and hold Volume Down button while plugging in the USB. Then run jztool again, in order to get to the recovery screen. All that jztool does is load the bootloader into the M3K's RAM temporarily, and since the permanent bootloader installation failed due to a missing file, nothing was modified on your player during your first attempt. So no surprise everything is working as it did before  :)

In short, just follow the instructions again, in full, from the beginning, and you should be fine.
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 08, 2021, 05:49:29 PM
I get to the part of installing the driver and zadig shows nothing in the drop down menu. is ths because it was already installed on my first try?
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 08, 2021, 06:02:54 PM
Do I drag the bootloader and jztool.exe to the sd card and then run the command prompt?
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on June 08, 2021, 07:00:42 PM
There is no need to install the USB driver a second time. Sorry if this wasn't clear.

You should be doing this:

1. Move bootloader.m3k and jztool into a folder on your desktop, or anywhere else that's convenient for you.
2. Copy bootloader.m3k to your SD card.
3. Safely remove the SD card, and insert the SD card into your M3K.
4. Connect the M3K in USB boot mode (power it off, hold volume down button, insert the USB cable to M3K and computer, and then let go of volume down button)
5. Open a command prompt in the folder containing jztool, and run the command jztool.exe fiiom3k load bootloader.m3k
6. Choose "Install/update bootloader" in the recovery menu.
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 08, 2021, 07:41:52 PM
did all that still get failed error-1102
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 08, 2021, 07:58:20 PM
Did it again after redownloading the boot loader file it says sucess. Do I scroll up to "Start Rockbox or do I safely eject  first and then stat up?
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 08, 2021, 08:01:23 PM
Before doing anything, should I do a backup from the recovery menu ?
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 08, 2021, 08:10:07 PM
This is not my first experience with Rockbox. I have rockboxed A Fuze,Fuze v2, Fuse+, Clip+ and clip zip.
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on June 08, 2021, 08:32:36 PM
Did it again after redownloading the boot loader file it says sucess. Do I scroll up to "Start Rockbox or do I safely eject  first and then stat up?

sounds like your download was corrupted, but I'm not sure how since that should've made jztool barf an error at you...

Anyway "success" means it all worked. Just reboot the player and enjoy.
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 08, 2021, 09:00:02 PM
"error loading Rockbox File not found" Now what
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on June 08, 2021, 09:12:54 PM
did you unzip Rockbox to the SD card?
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 08, 2021, 09:17:29 PM
No What is the best way to unzip
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 08, 2021, 09:23:50 PM
Nevermind unzipped it Going to try again
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 08, 2021, 09:33:22 PM
in CMD got these errors
[error] cannot open file bootloader.m3k (tar error: -2)
[error] Boot failed: -2
The un zipped bootloader file I unzipped and transfered was named "bootloader]
Should it be renamed?
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 08, 2021, 09:36:38 PM
Inside the bootloader file are these 3 files
bootloader.ucl
bootloader-info.txt
spl.m3k
Title: Re: FiiO M3K Install (Native port)
Post by: 7o9 on June 09, 2021, 12:25:27 AM
Njones, the link to bootloader.m3k is in the first post: https://download.rockbox.org/bootloader/fiio/m3k/bootloader.m3k

You do not extract this bootloader.m3k file, you just copy it to the sd card.
Title: Re: FiiO M3K Install (Native port)
Post by: bahus on June 09, 2021, 12:25:53 AM
Inside the bootloader file are these 3 files
It's not bootloader you need to unzip. You should unzip rockbox archive https://build.rockbox.org/data/rockbox-fiiom3k.zip.  So your SD card must contain .rockbox folder in the end (be sure it's in the root not in some subfolder)
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on June 09, 2021, 05:00:09 AM
Njones, from what you've told me, you already installed the bootloader successfully. From this point on there is no difference between the M3K and any other rockbox player. You don't need to use jztool or bootloader.m3k anymore.
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 09, 2021, 08:59:59 AM
It's working! How do you add themes and font pack?Is there any way to adjust the responsiveness of the slide bar? are you able to swap sd cards?
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 09, 2021, 09:01:45 AM
P.S. Thanks for everybodies help!!!
Title: Re: FiiO M3K Install (Native port)
Post by: 7o9 on June 09, 2021, 11:20:08 AM
Fonts and themes can be extracted just like the main rockbox package.

You can swap sd cards, but all need to have a copy of the .rockbox folder.
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 09, 2021, 11:48:02 AM
Downloaded and unzipped the theme I wanted and font package and put them in the unzipped rockbox folder. New theme does not show up in theme settings
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on June 09, 2021, 12:11:54 PM
The font and theme zip files also contain a .rockbox folder when you unzip them. The theme's .rockbox folder should be merged with the .rockbox folder already on the SD card.

If you are asked to skip/overwrite files because they already exist at the destination, it should be safe to skip. Any file conflicts are usually from unnecessary files like READMEs, or due to two themes bundling the same font.

The scrollbar sensitivity can be adjusted in Settings > General Settings > System > Touchpad sensitivity. If it is too sensitive and hard to navigate the menus, you can tap on the top or bottom of the scrollbar to navigate up or down in the menus.

Glad you finally have it working.  ;D
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 09, 2021, 01:39:45 PM
All is good! Thanks again for putting up with an old retired music lover!
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 10, 2021, 01:07:08 PM
Is it a good idea to use the development builds as they change?
Title: Re: FiiO M3K Install (Native port)
Post by: 7o9 on June 10, 2021, 01:45:03 PM
It is safe to use development builds and for the M3K you have to anyway.

There is still active development making Rockbox on the M3K better.
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 10, 2021, 08:59:54 PM
OK Thanks
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 16, 2021, 10:59:20 PM
Tried to update to the latest developmental build. Downloaded the M3K build, unzipped it. put it on the Sd card. Rebooted unit still shows the previous version. What am I doing wrong? Idon't need the dual boot so I'm not doing anything with that.
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on June 17, 2021, 05:18:22 PM
Did you check the version in System > Rockbox Info, or the version on the recovery screen? The recovery screen shows the bootloader version, not the version of Rockbox on your SD card.

Otherwise, all I can think of is maybe the new .rockbox accidentally ended up inside a subfolder? You only need to unzip the new version, and copy the new .rockbox folder to the root of the SD card.
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 17, 2021, 06:33:16 PM
Do I skip files or replace files when asked? System info was same as on screen
Title: Re: FiiO M3K Install (Native port)
Post by: Njones on June 17, 2021, 09:17:06 PM
I chose Replace and that worked. On another note, The car play mode turns on and starts playing when the ignition is turned on but doesn't turn off when the ignition is turned off.
Title: Re: FiiO M3K Install (Native port)
Post by: 7o9 on June 18, 2021, 12:30:19 AM
Replace, otherwise you keep your old version files.
Title: Re: FiiO M3K Install (Native port)
Post by: 7o9 on July 08, 2021, 04:12:41 PM
amachronic: does it make sense to reinstall the bootloader after all recent nand/spl changes?
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on July 09, 2021, 05:35:05 AM
amachronic: does it make sense to reinstall the bootloader after all recent nand/spl changes?
Updating isn't necessary, there's no new features or bugfixes. Generally speaking, I don't advise using development bootloaders; they may be broken for some reason because I don't test them regularly.
Title: Re: FiiO M3K Install (Native port)
Post by: doomsquirrel on August 25, 2021, 01:08:54 PM
Excellent work. Thank you very much to the author(s) for making this M3K RockBox port. It is literally the main reason I got one of these players.

I notices a minor issue. I like setting the "Enable EQ" to the Top Quickscreen. When toggled on/off from the Quickscreen, it does not always work, and there's a seemingly random length delay when it does work. Sometimes it changes in a couple of seconds, sometimes it takes over 15 seconds - if it changes at all.

As said, it is a minor issue, and I can live with it as is. Just letting the dev(s) know, should this be important enough to be worked on.
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on August 26, 2021, 03:39:58 PM
Thanks for reporting, it turned out that setting was totally broken in the quickscreen. Should be fixed now in the latest dev build.
Title: Re: FiiO M3K Install (Native port)
Post by: doomsquirrel on August 27, 2021, 06:23:07 AM
Thanks for reporting, it turned out that setting was totally broken in the quickscreen. Should be fixed now in the latest dev build.

Works great now. Thank you for addressing this, and with such speed too.
Title: Re: FiiO M3K Install (Native port)
Post by: praashek on September 09, 2021, 11:15:46 AM
Is it possible to add the link for the latest .rockbox build to the TOP post //also I recommend to add the info about the step that you HAVE TO copy the .rockobox folder to the SD-card as this is not mentioned there ;)

Also there is many times mentioned "hold the Play button (while booting)", but there is no "play button" on the M3K. Do You mean the upper "Power/lock button", or is there any other button reffered as "play"?
Title: Re: FiiO M3K Install (Native port)
Post by: vitt13 on September 09, 2021, 12:12:48 PM
Also there is many time mentioned "hold the Play button (while booting)", but there is no "play button" on the M3K. Do You mean the upper "Power/lock button", or is there any other button reffered as "play"?
Take a look at the attached picture
Title: Re: FiiO M3K Install (Native port)
Post by: praashek on September 09, 2021, 12:19:29 PM
Also there is many time mentioned "hold the Play button (while booting)", but there is no "play button" on the M3K. Do You mean the upper "Power/lock button", or is there any other button reffered as "play"?
Take a look at the attached picture

OK, so officially //refering to english manual here// it is the "Confirm button".

(https://i.postimg.cc/vTqMM28G/image.png)
Title: Re: FiiO M3K Install (Native port)
Post by: vitt13 on September 09, 2021, 12:27:04 PM
Play/Pause toggle symbol is right under button
Title: Re: FiiO M3K Install (Native port)
Post by: praashek on September 09, 2021, 12:34:57 PM
Play/Pause toggle symbol is right under button

That is true, but the official manual is reffering to it as "Confirm button" :] And to be honest I havent seen that symbol just because I have the player in the rubber case all the time.
Title: Re: FiiO M3K Install (Native port)
Post by: projeKct on October 04, 2021, 11:33:08 PM
You can access the FiiO recovery mode by holding Play and Vol+ while booting, in case you need to update the FiiO firmware. Be warned that updating with the FiiO recovery mode will erase the Rockbox bootloader and you will need to install it again using jztool.
Hi, first post here. Thanks for all your work with Rockbox and the M3K.

I followed all instructions, and I can boot in Rockbox by pressing Power, or I can boot in FiiO mode by pressing Play+Power.

But when I press Play+VolUp+Power, I doesn't boot in FiiO recovery mode. I only see the button light but the LCD remains off.

Is my player bricked? ???

Thanks for you help!
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on October 05, 2021, 08:16:23 AM
I followed all instructions, and I can boot in Rockbox by pressing Power, or I can boot in FiiO mode by pressing Play+Power.

But when I press Play+VolUp+Power, I doesn't boot in FiiO recovery mode. I only see the button light but the LCD remains off.

Is my player bricked? ???

Thanks for you help!

The first and simplest thing I would suggest is make sure you're pressing Play+VolUp together, and keep holding them down, until the Fiio recovery screen shows. And make sure you are NOT holding down VolDown by accident because that will override any other keys. If it's truly not working, then read on.

If for some reason some part of your flash got corrupted/wiped, I have a full flash dump you could recover with. Unfortunately I don't have anything rigged up to easily dump or restore bits & pieces of the flash. I can spin up something but it may take a couple of weeks.

If you really need to use the Fiio recovery, and you took a bootloader backup (fiiom3k-boot.bin), then you can restore it using the RB bootloader. That will restore the Fiio bootloader and should let you access the recovery. But this will only work if the rest of the flash is intact, which you can't easily determine yet.
Title: Re: FiiO M3K Install (Native port)
Post by: 7o9 on October 05, 2021, 02:56:41 PM
Is my player bricked? ???

It sounds like you might be touching volume down and end up in USB boot mode. Then the button light is on and the LCD remains off.

But if you hold down power again to turn it off at this time until the button lights turn off, and then power again to turn it on again normally it still works?

I might be reading your post wrong, but it sounds like you can get in Rockbox (power) and the original firmware (power+play) but just not in the original firmware recovery.
Title: Re: FiiO M3K Install (Native port)
Post by: projeKct on October 05, 2021, 04:13:13 PM
The first and simplest thing I would suggest is make sure you're pressing Play+VolUp together, and keep holding them down, until the Fiio recovery screen shows. And make sure you are NOT holding down VolDown by accident because that will override any other keys. If it's truly not working, then read on.

OK, I've done exactly that, I still have the black LCD screen but button lights on. As other user 7o9 said, I think I get to USB boot mode. So when I press VolDown+Power or Play+VolUp+Power, it gets to the same place: USB boot mode. But I want to be able to get to FiiO recovery mode.

If for some reason some part of your flash got corrupted/wiped, I have a full flash dump you could recover with. Unfortunately I don't have anything rigged up to easily dump or restore bits & pieces of the flash. I can spin up something but it may take a couple of weeks.

I think that could help, even if I don't understand exactly what you mean by "anything rigged up to easily dump or restore bits & pieces of the flash". But if you can help, even if I wait several weeks, I would be very glad and grateful.  :)

If you really need to use the Fiio recovery, and you took a bootloader backup (fiiom3k-boot.bin), then you can restore it using the RB bootloader. That will restore the Fiio bootloader and should let you access the recovery. But this will only work if the rest of the flash is intact, which you can't easily determine yet.

Sadly, I think I made a mistake... I didn't make a backup before flashing my M3K, only after. So when I choose the Restore option, it says "Success" but changes nothing.  :(
Title: Re: FiiO M3K Install (Native port)
Post by: projeKct on October 05, 2021, 04:19:34 PM
Is my player bricked? ???

I might be reading your post wrong, but it sounds like you can get in Rockbox (power) and the original firmware (power+play) but just not in the original firmware recovery.

That's exactly it! And you're right, I misused the word "bricked", because I can still use my player with Rockbox (version 75524a7eec-211002) and with FiiO (FW 1.4.5) but I can't reach the original firmware recovery mode. So it's not the end of the world, but I find it kind of stressful anyway.  ::)
Title: Re: FiiO M3K Install (Native port)
Post by: 7o9 on October 06, 2021, 12:33:05 AM
Is my player bricked? ???

I might be reading your post wrong, but it sounds like you can get in Rockbox (power) and the original firmware (power+play) but just not in the original firmware recovery.

That's exactly it! And you're right, I misused the word "bricked", because I can still use my player with Rockbox (version 75524a7eec-211002) and with FiiO (FW 1.4.5) but I can't reach the original firmware recovery mode. So it's not the end of the world, but I find it kind of stressful anyway.  ::)

I understand your stress, but that is great news. First of all you can still actually use your player but it will also make support much easier.

Your device is pretty much still working. I think if you were to put the original FiiO firmware update file on your sd card and boot the original firmware (play+power), it will flash your M3K back to original (removing Rockbox in the process).

There is very little need to ever get to the FiiO recovery. I do not know how you intend to use your player but for straight music playback Rockbox is so much more versatile. If you want to use the USB DAC or bluetooth fucntionality, you still need the original firmware but you can get to that. I also doubt there will be any FiiO firmware updates as the player seems end-of-life.
Title: Re: FiiO M3K Install (Native port)
Post by: projeKct on October 06, 2021, 12:47:21 AM
Is my player bricked? ???

I might be reading your post wrong, but it sounds like you can get in Rockbox (power) and the original firmware (power+play) but just not in the original firmware recovery.

That's exactly it! And you're right, I misused the word "bricked", because I can still use my player with Rockbox (version 75524a7eec-211002) and with FiiO (FW 1.4.5) but I can't reach the original firmware recovery mode. So it's not the end of the world, but I find it kind of stressful anyway.  ::)

I think if you were to put the original FiiO firmware update file on your sd card and boot the original firmware (play+power), it will flash your M3K back to original (removing Rockbox in the process).

But when I (or even you) press on Play+Power, it does not flash the player, it only starts the player in FiiO mode (and this is the way it's supposed to be). For me it's the Play+VolUp+Power combination that does not work. That should, in theory (I never seen it worked, so I guess) leads to the FiiO firmware update screen.
Title: Re: FiiO M3K Install (Native port)
Post by: 7o9 on October 06, 2021, 02:27:11 AM
Ok, I was not entirely sure about that.

For me the FiiO recovery does work after installing Rockbox.

I hold play and volume and then press and hold power until the 'Welcome' text shows on the lcd. Initially the button light is on, then the button light gets even brighter and then finally the lcd turns on. This takes about 4 to 5 seconds total.
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on October 06, 2021, 03:53:16 AM
If for some reason some part of your flash got corrupted/wiped, I have a full flash dump you could recover with. Unfortunately I don't have anything rigged up to easily dump or restore bits & pieces of the flash. I can spin up something but it may take a couple of weeks.

I think that could help, even if I don't understand exactly what you mean by "anything rigged up to easily dump or restore bits & pieces of the flash". But if you can help, even if I wait several weeks, I would be very glad and grateful.  :)
Sorry if that was unclear, I mean there's no easy, user friendly way for you to dump and restore bits and pieces of the flash so we can see what's going on.

If you really need to use the Fiio recovery, and you took a bootloader backup (fiiom3k-boot.bin), then you can restore it using the RB bootloader. That will restore the Fiio bootloader and should let you access the recovery. But this will only work if the rest of the flash is intact, which you can't easily determine yet.

Sadly, I think I made a mistake... I didn't make a backup before flashing my M3K, only after. So when I choose the Restore option, it says "Success" but changes nothing.  :(
No worries, at least your player is otherwise usable.

I think if you were to put the original FiiO firmware update file on your sd card and boot the original firmware (play+power), it will flash your M3K back to original (removing Rockbox in the process).

But when I (or even you) press on Play+Power, it does not flash the player, it only starts the player in FiiO mode (and this is the way it's supposed to be).
I think what 7o9 is referring to is a menu option within the Fiio firmware to start a firmware upgrade. You can try this, but I don't believe it will work if the Rockbox bootloader is installed (but it won't harm your player so feel free to try it -- I may be wrong about how it works).
Title: Re: FiiO M3K Install (Native port)
Post by: projeKct on October 06, 2021, 06:47:14 AM

I think what 7o9 is referring to is a menu option within the Fiio firmware to start a firmware upgrade.

Oh, I didn't know that such an option exists. Where is it? I don't see it under "System settings".

By the way, would it be possible for me to do something with jztool.exe? Can I use it with other parameters and/or files to restore the standard FiiO firmware? Just asking...
Title: Re: FiiO M3K Install (Native port)
Post by: dconrad on October 06, 2021, 09:29:20 AM
Just out of curiosity, I just tried to get into FiiO Recovery mode (PWR+play+vol_up) on my own M3K and it also shows a black screen with just the keypad light on. I wonder if some units will do that and some units work fine? I don't think it needs the firmware file there in order to do the initial boot.

I mean, it's not like I'm ever going to need that mode, but just for a data point...
Title: Re: FiiO M3K Install (Native port)
Post by: 7o9 on October 06, 2021, 11:02:29 AM
When it finds a firmware file I think it will start flashing without prompt so even if the lcd does not show what is going on, it might flash the original firmware just fine. I should really try that but I like my Rockbox too much.
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on October 06, 2021, 05:07:04 PM
Just out of curiosity, I just tried to get into FiiO Recovery mode (PWR+play+vol_up) on my own M3K and it also shows a black screen with just the keypad light on. I wonder if some units will do that and some units work fine? I don't think it needs the firmware file there in order to do the initial boot.

I mean, it's not like I'm ever going to need that mode, but just for a data point...
Maybe there's two slight hardware variants and this has something to do with it? There was definitely that clocking problem which caused the early bootloaders to hang on your unit (and others) but not mine.
Title: Re: FiiO M3K Install (Native port)
Post by: projeKct on October 06, 2021, 11:02:15 PM
When it finds a firmware file I think it will start flashing without prompt so even if the lcd does not show what is going on, it might flash the original firmware just fine. I should really try that but I like my Rockbox too much.

Nice idea! I tried it, and wait for a very long time, but nothing happened (besides the button lights staying on). I really think that, for an unknown reason, it goes to USB boot mode instead of FiiO recovery mode. Maybe more people can test (like dconrad just did) the Play+VolUp+Power combination and see what it does? I think you can do it without flashing the player: just remove the SD card.
Title: Re: FiiO M3K Install (Native port)
Post by: globalc on October 21, 2021, 07:47:16 AM
Thanks a lot for the port, been using it since months!

I just wanted to updated to a daily build from yesterday, and that one does not boot. Going back: I see this: until 2021-10-15, things are good. 2021-10-17 and 18 report after boot that the battery needs to be charged and shut down. 2021-10-21 is not booting, drops into the bootloader. Maybe the guide on the first page should hint at a known-to-be-good build?
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on October 21, 2021, 10:35:17 AM
globalc,

When the bootloader can't boot Rockbox, it should say "Error loading Rockbox" followed by an error message. What error message do you get? And what bootloader version do you have installed? it's shown at the bottom of the screen in the recovery menu.

The low battery shutdown bug is a separate issue, that was introduced by commit 7a5130a277 (https://git.rockbox.org/cgit/rockbox.git/commit/?id=7a5130a27722b95f0de965e99e1fd7cb322cafcf) and should be fixed in builds from the 19th onward. If you're still getting that (once Rockbox is actually booting) you can try this build and let me know if it fixes it --

The two issues should be unrelated, BTW, since I haven't updated the bootloader since the shutdown bug was introduced.
Title: Re: FiiO M3K Install (Native port)
Post by: baka_toroi on November 10, 2021, 11:25:08 PM
Another successful installation completed.
I absolutely love that I can boot to the stock firmware!
Title: Re: FiiO M3K Install (Native port)
Post by: sourex on December 30, 2021, 03:46:16 PM
Hey. Good Work !!
I installed it using the old method (M3 file on the root directory where the boot looder was included) everything worked out so far. Unfortunately I have a problem, I can't fast forward or rewind :( Have someone Else that Problem ??
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on December 30, 2021, 04:42:50 PM
You need to hold down the rewind / fast forward buttons in the WPS. There's no problem with it as far as I'm aware. You can use the touchpad debug menu in System > Debug > View HW Info > Touchpad to verify the touchpad is working properly. You should see button: 00000040 when holding rewind and button: 00000080 when holding fast forward.
Title: Re: FiiO M3K Install (Native port)
Post by: 7o9 on December 31, 2021, 07:40:55 AM
On build 025f780685-211229, I get the following panic when I plug in a USB cable connected to a PC while the M3K is off:

*PANIC*
Exception occurred: Trap Instruction [0xffff8be5] at 0x800683d0 (stack at 0x80002814)

If I turn it on first and then connect the USB, it is fine. The value in square brackets is not always the same, I have also seen 0xffbf8ae5. The other two address are always the same.

I have seen the same on the Q1 once, with this message:

*PANIC*
Exception occurred: Trap Instruction [0x3f77bff7] at 0x8006b83c (stack at 0x80002814)

On both the M3K and the Shanling Q1, the behavior is also very odd when 'USB Mode' is set to 'Ask'. On the M3K, when you unplug the USB cable it will ask if you want to enter mass storage mode. If you answer 'no', you will end up with a blank screen (apart from bar at the top) and can only shutdown the player. If you answer yes, you will end up in the menus and can still use the player. On the Q1 you keep getting the same prompt and seem to stay in 3x3 mode until you manage to start something else that resets the touchscreen mode. If you manage to click something that the yes/no prompt sees as 'no', you end up with the same blank screen as on the M3K.

I have also gotten the following panic (M3K) when answering yes or no on the 'enter mass storage' prompt when plugging in the USB cable while the player was turned on and running Rockbox:

*PANIC*
TLB refill handler at 0x8007f14c! [0x0]

A similar panic can be achieved on the Q1 the same way:

*PANIC*
TLB refill handler at 0x80082324! [0x0]

Both do not always happen but seem a result of attempting to exit the yes/no screen by a combination of touching the screen/touchstrip and pressing buttons.
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on December 31, 2021, 11:23:09 AM
Thanks for the detailed report! It's a division by zero error caused by a mistake on my part when I added the improved time estimation (96cfe329a6 (https://git.rockbox.org/cgit/rockbox.git/commit/?id=96cfe329a612a8da5878f7bc20f2d645b30553a3)). Gerrit still seems to be down so I'm unable to merge any fixes right now, but I'll fix it as soon as I can.

Quote
On both the M3K and the Shanling Q1, the behavior is also very odd when 'USB Mode' is set to 'Ask'
I know. Ask mode is completely broken on native ports since the yes/no screen prevents Rockbox from responding to any USB requests, so the host computer thinks the USB device is broken. Crashes on the Rockbox side are another matter, but hardly worth dealing with when the feature is so badly broken.

It's probably best to disable the 'ask' feature on native ports until it can be fixed properly -- you're not the first person to report this.
Title: Re: FiiO M3K Install (Native port)
Post by: sourex on January 12, 2022, 05:47:49 PM
You need to hold down the rewind / fast forward buttons in the WPS. There's no problem with it as far as I'm aware. You can use the touchpad debug menu in System > Debug > View HW Info > Touchpad to verify the touchpad is working properly. You should see button: 00000040 when holding rewind and button: 00000080 when holding fast forward.

i have not any things in debug with HW ? but i have a workaround for me with 2 min steps at every push.
Next an last and biggest problem. The Button for lock doesnt work. Do u have a solution for this ?
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on January 13, 2022, 09:55:00 AM
sourex, are you using the old XVortex port - with the graphical boot menu to pick between rockbox and the fiio player? The problems you're talking about sound like complaints I have seen about the xvortex builds. They do not happen for me on the native port (nor should they happen).

There's been a native port for a while now - the first post in this thread explains how to install it. Basically, the native port replaces FiiO's buggy Linux  kernel and uses Rockbox as the kernel, just like sansas or ipods do. Admittedly installing the bootloader is a pain on Windows, so if you don't want to go through the 'official' install process, another user on the forums (vitt13) made a package which includes the Rockbox native bootloader, which you can install like a normal M3K firmware update:
https://www.mediafire.com/folder/p2l3a22u3d7kk/M3K_fw_1.4.5_dualboot_rb
(original forum post) (https://forums.rockbox.org/index.php/topic,52917.msg248796.html#msg248796)

(Mind you - I've never tested his update, but it should work.)
Title: Re: FiiO M3K Install (Native port)
Post by: projeKct on January 13, 2022, 01:49:49 PM
I followed all instructions, and I can boot in Rockbox by pressing Power, or I can boot in FiiO mode by pressing Play+Power.

But when I press Play+VolUp+Power, I doesn't boot in FiiO recovery mode. I only see the button light but the LCD remains off.

If for some reason some part of your flash got corrupted/wiped, I have a full flash dump you could recover with. Unfortunately I don't have anything rigged up to easily dump or restore bits & pieces of the flash. I can spin up something but it may take a couple of weeks.

If you really need to use the Fiio recovery, and you took a bootloader backup (fiiom3k-boot.bin), then you can restore it using the RB bootloader. That will restore the Fiio bootloader and should let you access the recovery. But this will only work if the rest of the flash is intact, which you can't easily determine yet.

Hi amachronic,

Does your full flash dump is still available? How can you transfer it to me? How do it "install" it?

I'm still not able to boot my rockboxed M3K in FiiO recovery mode, and sadly I don't have a bootloader backup (fiiom3k-boot.bin)

Thank you, or anybody else that want to help!
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on January 14, 2022, 08:20:54 AM
I'm still working on the bootloader, slowly. It's been a fairly big overhaul, not just adding flash dump/restore but other fixes, improvements, and a test suite to weed out the inevitable bugs. I've still got to turn the mess into something sensible to commit. I added the dump/restore part in the last 2 weeks, so it's technically working - just not very well tested. So sorry about the delay... I made the mistake of giving a time frame, which I've blown way past. It'll be ready eventually.

I can't believe I forgot to mention this -- but there is a pristine backup on the wiki which I posted ages ago. https://www.rockbox.org/wiki/pub/Main/FiioM3K/nand.bin. Rename this file to fiiom3k-boot.bin, and use the bootloader restore option. This gets you back to the original firmware, so you will be able to use its updater if you want to upgrade/downgrade the OF, but if you reinstall Rockbox you'll run into the same issue again.

Restoring from that backup will only work if your flashed recovery kernel is intact, but I think that is highly likely. At any rate, I don't think the restore should cause any further damage. I think it's more likely that the dual boot configuration in Rockbox is wrong (for some reason) and the recovery kernel can't boot up properly, rather than the flash getting damaged.
Title: Re: FiiO M3K Install (Native port)
Post by: projeKct on January 14, 2022, 10:24:10 AM
I can't believe I forgot to mention this -- but there is a pristine backup on the wiki which I posted ages ago. https://www.rockbox.org/wiki/pub/Main/FiioM3K/nand.bin. Rename this file to fiiom3k-boot.bin, and use the bootloader restore option. This gets you back to the original firmware, so you will be able to use its updater if you want to upgrade/downgrade the OF, but if you reinstall Rockbox you'll run into the same issue again.

Wow! :) My problem is now solved, thank you very much! It went smoothly. And as you said, when I reinstall Rockbox, the problem is back, but now it really is a minor problem, as I can return my M3K to its original state anytime!

So thanks again, and keep us updated with new versions when you have some time.
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on January 14, 2022, 12:22:13 PM
Glad to hear it worked -- and that confirms the problem is with Rockbox's dual boot support.
Title: Re: FiiO M3K Install (Native port)
Post by: HelgenX on January 14, 2022, 10:47:09 PM
in CMD got these errors
[error] cannot open file bootloader.m3k (tar error: -2)
[error] Boot failed: -2
The un zipped bootloader file I unzipped and transfered was named "bootloader]
Should it be renamed?

I'm getting this error as well. I have the .rockbox folder extracted to the SD card, I have the m3k file on the root of my SD too, the m3k file and the exe file on my C drive. Installed the driver with Zadig for boot mode.

Edit: So I changed to libusbk driver, it now says "notice: rockbox bootloader version (version number)

Doesn't do anything else from here, I just turn off the device, the rockbox menu doesn't show up.
Title: Re: FiiO M3K Install (Native port)
Post by: vitt13 on January 15, 2022, 05:07:42 AM
I'm getting this error as well. I have the .rockbox folder extracted to the SD card, I have the m3k file on the root of my SD too
Make sure that your SD card is formatted in FAT32.
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on January 15, 2022, 10:30:49 AM
in CMD got these errors
[error] cannot open file bootloader.m3k (tar error: -2)
[error] Boot failed: -2
The un zipped bootloader file I unzipped and transfered was named "bootloader]
Should it be renamed?

I'm getting this error as well. I have the .rockbox folder extracted to the SD card, I have the m3k file on the root of my SD too, the m3k file and the exe file on my C drive. Installed the driver with Zadig for boot mode.

Edit: So I changed to libusbk driver, it now says "notice: rockbox bootloader version (version number)

Doesn't do anything else from here, I just turn off the device, the rockbox menu doesn't show up.

The 'cannot open file' error means that jztool could not find the file on your computer. To clarify you should have this folder structure on your computer:
Code: [Select]
Rockbox/
  jztool.exe
  bootloader.m3k
And you should open the command prompt in the "Rockbox" folder. It does not have to be named "Rockbox", I just use that as an example; the important thing is to put both files next to each other in the same folder.

If the bootloader version is being displayed, it means jztool did open the file, and the bootloader should have loaded. The Rockbox menu will appear on your player, not the computer. If this isn't happening, try again with this command:
Code: [Select]
jztool.exe -l debug load fiiom3k bootloader.m3k
and post the output here.
Title: Re: FiiO M3K Install (Native port)
Post by: sourex on January 15, 2022, 01:46:22 PM
sourex, are you using the old XVortex port - with the graphical boot menu to pick between rockbox and the fiio player?

Yes, thats right. I will try your port . Thanks for your work and information !!

Edit:
not so good with the m3k file :(
Rockbox not found and i can not flash again. I will write in the post u link.
Title: Re: FiiO M3K Install (Native port)
Post by: juupi on February 10, 2022, 08:03:12 AM
Hi,
thanks for this great port to F3K.

Is there a way to use the volume buttons for skip tracks with long press when the screen is off (original FW do so)? Perfectly display stays off, so skipping and volume control is possible with hard buttons, even the player stays in the pocket.

I already searched in the manual. I only found 8.5.7. Advanced Key Lock. It looks like the function to control with locked screen should work with it. But on one hand I could not toggle Exempt Play and Exempt Volume on my device and I found no way to use volume button with long press for skipping.
Title: Re: FiiO M3K Install (Native port)
Post by: bahus on February 11, 2022, 06:21:05 AM
Is there a way to use the volume buttons for skip tracks with long press when the screen is off (original FW do so)?

It's 2 keys combination in rockbox: Play + Vol Up and Play + Vol Down
Title: Re: FiiO M3K Install (Native port)
Post by: juupi on February 11, 2022, 07:06:52 AM
It's 2 keys combination in rockbox: Play + Vol Up and Play + Vol Down

Thanks, but that doesn't work on my device. Do I have to enable it anywhere?
Title: Re: FiiO M3K Install (Native port)
Post by: bahus on February 11, 2022, 07:30:52 AM
Thanks, but that doesn't work on my device. Do I have to enable it anywhere?

It should work when device is locked.  Also make sure you have
Settings -> General Settings -> System -> Advanced key lock

Enabled - Yes
And Exempt Seek, Exempt Skip and  Disable Touch should be enabled (other options can also be enabled, it's just minimal set to make skip and seek work by Play + Volume keys combination)
Title: Re: FiiO M3K Install (Native port)
Post by: juupi on February 11, 2022, 09:05:56 AM
And Exempt Seek, Exempt Skip and  Disable Touch should be enabled (other options can also be enabled, it's just minimal set to make skip and seek work by Play + Volume keys combination)

Settings -> General Settings -> System -> Advanced key lock -> Settings
Here I can't do / change anything. Additional confusing: the names depends to language settings:
English:
German
When device is locked only volume control is possible (as german settings)  ???
Title: Re: FiiO M3K Install (Native port)
Post by: xuzo on February 15, 2022, 09:18:23 PM
*PANIC*
TLB refill handler at 0x8007f14c! [0x0]

Just wanted to call out for folks receiving errors like these from the firmware and who have SD cards larger than 32GB:
Double-check that your SD card is still FAT32, not exFAT. I broke my original install somehow, formatted the drive (exFAT), and got each of the above errors depending on the action I was trying to take (boot, restore firmware backups, etc.). Smelled like filesystem errors so I checked for a dying card, but a full read/write scan reported OK.

FAT32 is the answer, as vitt13 mentioned above. Easiest way to get back to it is to boot the M3K into the stock OS (hold play before/while powering on) and format it from Settings there. No need to fight with your PC to allow you to format a large drive FAT32.

Copy .rockbox back over (even while booted into the stock OS) and you should be fine from there. :)
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on March 17, 2022, 11:05:42 AM
projeKct and dconrad would either of you be able to test a new bootloader on your M3Ks? I fixed a couple of bugs yesterday and I think it might fix the recovery kernel hang on your units. If you can also confirm the new bootloader still works to boot Rockbox and the Fiio player, I'll put this up as the next 'official' release.

The new bootloader is here (FYI this corresponds to the series g#4348 (https://gerrit.rockbox.org/r/c/rockbox/+/4348)):
https://drive.google.com/file/d/1qDEjWguKyza9W6ZYBzTNjqq35cnGcu6s/view?usp=sharing

You can install it from the rockbox bootloader menu or by jztool, just be prepared to re-install the old bootloader using jztool in case the new one is broken.
Title: Re: FiiO M3K Install (Native port)
Post by: dconrad on March 17, 2022, 07:10:04 PM
Amachronic, just flashed that bootloader build onto my m3k, which has not seen a new build of either bootloader or rockbox in quite some time. I flashed it via the existing bootloader and it seemed to work without any issue. I have build dbb7371065-211128 (!!) on my player - you can see I don't use it much at the moment, lol. It also boots fine with build b309fae2bc-220317, the latest and greatest.

Booting RB works, booting OF works, getting into the bootloader menu works, USB mode appears to work fine, bootloader area backup appears to work fine.

Any other tests you would like me to do?
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on March 17, 2022, 09:05:50 PM
Did it boot the OF recovery as well? (I recall it didn't work on your unit with the old bootloader)
Title: Re: FiiO M3K Install (Native port)
Post by: dconrad on March 17, 2022, 09:55:11 PM
Ah, I didn't try that one. I do get "uImage load failed" trying to launch Fiio recovery. I assume it doesn't need the recovery image actually on the SD card, right?
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on March 18, 2022, 10:00:35 AM
The error is referring to the flashed recovery kernel uimage, so I guess it's corrupted or maybe an unsupported option. I'll put together a new build this weekend so we can figure out what's going wrong.
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on March 19, 2022, 11:07:34 AM
Here is that build:
https://drive.google.com/file/d/1P3LO-epVAgr8aO7sJTxqVnzwRoCehs_5/view?usp=sharing

dconrad can you please try loading the fiio recovery with that and tell me the error code it gives? I'll need you to post the recovery kernel image too, which can now be dumped via the debug tools menu. Thanks!

This is the recovery kernel I dumped from my unit (for comparison):
https://drive.google.com/file/d/1MpOk-2FxQsXPvbC2bjG9MoRxxphaUbBr/view?usp=sharing
Title: Re: FiiO M3K Install (Native port)
Post by: AACC on March 19, 2022, 09:27:18 PM
While waiting for dconrad's feedback, I'd like to report that the 220319 bootloader works fine. When loading the FIIO recovery there is no error, it only displays "No Update File". I had FW v1.4.5 before and my recovery kernel image has identical hash as amachronic's.

I am new to Rockbox so please excuse my ignorance but I can not get bookmarks to work. I selected:
Quote
"Bookmarking only works when tracks are launched from the file browser, and does not work for tracks launched via the database. In addition, they do not work with dynamic playlists."

I do not use playlists, in file browser mode I start/stop audiobook files but no bookmark is registered. Why?
Title: Re: FiiO M3K Install (Native port)
Post by: dconrad on March 21, 2022, 03:49:37 PM
After a change to ignore bad nand blocks, the bootloader is fully functional on my player.

AACC, with those bookmark settings you'll need to go into the context menu of the While Playing screen and manually create a bookmark, then it should update the bookmark for that playlist whenever playback is stopped after that. If you want it to always make bookmarks for any file, you can use "Bookmark on Stop" set to either Yes or Ask.

The way you've got it set up, it will update bookmarks after you manually create them once, but it will not create them where they don't already exist.

The way rockbox works, you always have a playlist even when you just play a particular file. I think by default this "dynamic" playlist includes all files in the same folder.

I hope all that makes sense.
Title: Re: FiiO M3K Install (Native port)
Post by: AACC on March 21, 2022, 07:42:09 PM
In WPS context menu there is nothing about bookmarks, I only see 'shuffle' and 'repeat' options. I did change "Bookmark on Stop" to Ask but there is no asking when I stop. Perhaps the rockbox-fiiom3k-20220318 version is buggy?
Title: Re: FiiO M3K Install (Native port)
Post by: dconrad on March 21, 2022, 11:25:19 PM
If you only see shuffle and repeat, are you sure you're getting into the context menu? It sounds like you're in the quickscreen, which is accessed by pressing the top left button (menu, I guess I would call it?). The context menu is accessed by a long press on the scroll strip. The Bookmarks entry should be between Playback Settings and Open Plugin.

If it's not between those two entries, that means that the dynamic playlist I mentioned earlier has been modified and it needs to be saved, but it sounds like that's not the problem you're running into.

I'm pretty sure the Ask option for Bookmark on Stop works fine, I just tested it on my player with a build just one day older than yours. Just to be sure, are you sure you're actually stopping playback? You need to hold the power button for about a second or so, but not long enough to power off the device. It should ask you to save or not then.
Title: Re: FiiO M3K Install (Native port)
Post by: AACC on March 22, 2022, 05:27:08 AM
dconrad you are right on all points, thank you for your explanation. Bookmarks are essential for my audiobook collection and Rockbox truly ROCKS. I am installing it on my spare M3K too and never going back to original firmware. Oh wait, not sure about battery performance yet, just started using it. What are your observations about battery life?
Title: Re: FiiO M3K Install (Native port)
Post by: Thew on March 22, 2022, 07:09:56 AM
My experience of the battery life is that it is much the same as the Fiio UI which is really good. It’s certainly no worse and perhaps even a bit better. It drops of course if you use processor intensive features like some of the Sound adjustments. I have the “DAC’s power mode” set to “Save battery” in the “Sound Settings”.

The old XVortex version of Rockbox was slightly worse for battery life so this more recent, native, version is even more welcome.
Title: Re: FiiO M3K Install (Native port)
Post by: vitt13 on March 24, 2022, 09:43:07 AM
dconrad can you please try loading the fiio recovery with that and tell me the error code it gives? I'll need you to post the recovery kernel image too, which can now be dumped via the debug tools menu. Thanks!
This is the recovery kernel I dumped from my unit (for comparison):
I've also successfully loaded the fiio recovery from new bootloader. BTW my dumped recovery kernel image is different (I compared it with yours).
https://www.mediafire.com/file/xiuabtppl5fhqb6/of_recovery.img/file
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on March 24, 2022, 07:47:27 PM
Thanks for testing the new bootloader, everyone. I'm preparing to release an updated bootloader soon, along with updated documentation.

I've also revived the web-based installer (jztool.js) contributed by astrolabe a while back, which I unfortunately had to put aside till now for lack of time and motivation. I've brought it up to speed with the recent bootloader changes and uploaded it to a GitHub repository, https://github.com/amachronic/jztooljs. I plan on hosting it using github pages. It needs a bit more polish, but it should make the installation go much smoother for a lot of users, especially on Windows. (No more need for Zadig!)
Title: Re: FiiO M3K Install (Native port)
Post by: AACC on March 25, 2022, 01:35:19 AM
Re documentation, is there still any use for the following power on options?
# voldn + power
# volup + play + power
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on March 26, 2022, 12:50:49 PM
Yes, voldn+power is the USB boot key -- that's baked into the hardware and unchangeable -- and volup+play+power starts the original Fiio recovery.
Title: Re: FiiO M3K Install (Native port)
Post by: AACC on March 26, 2022, 11:26:03 PM
So the install's
"Make sure your player is fully powered off and connect the M3K in USB boot mode: plug in one end of the USB cable, and then plug in the other end while holding down the Volume Down button"
is equivalent to something like
"when off press voldn + power and then connect USB cable"?
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on March 27, 2022, 08:45:44 AM
It's not quite equivalent - I word it that way because in my experience it sometimes doesn't connect properly if you power on and then plug in the USB cable. The way I suggest ensures the cable is present at power on.
Title: Re: FiiO M3K Install (Native port)
Post by: SteveDave on April 03, 2022, 06:28:01 AM
Just realised I had not thanked all involved for working on this port.
I've found Rockbox's bookmarking features essential for audiobooks and downloaded radio shows and I've come to rely on the unique auto resume on start feature of the sleep function to get to sleep and get back to sleep.
After the batteries on my various Sansa Clips started to fail I thought I was screwed until you guys made the M3K port happen.
I can't thank you enough, especially Amachronic for continuing to work on it, just installed your latest build and it fixed the graphical glitch I had with the theme I'm using. 8)
Really appreciate it.
Cheers.
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on April 06, 2022, 12:22:35 PM
There's a new version of the M3K bootloader available today, bf3e67204c-20220402. This version should fix any dual boot problems encountered with earlier bootloaders, and there's a new multiboot (https://www.rockbox.org/wiki/MultibootBootloader) feature which is mainly interesting for people who want to use the same SD card with multiple players.

Download links are in the top post.
Title: Re: FiiO M3K Install (Native port)
Post by: AACC on April 07, 2022, 07:59:52 PM
Thank you again, excellent development!
Title: Re: FiiO M3K Install (Native port)
Post by: demon_slayer on May 16, 2022, 11:13:17 AM
Hi all,

I have just purchased a Fiio M3K and have successfully installed Rockbox using this guide. Thank you for the guide, its great.

I've noticed a bug/issue. I still have the bootloader.m3k file in the root of my SD card, when I go to delete the file (since I don't want it to appear in my Files list) then eject and unplug my M3K then I get the following error:

*PANIC*
TLB refill handler at 0x800272fc! [0x4]


This error text appears on a white screen. I'm able to turn the device off then back on and the device then boots back into Rockbox. For now I've added the bootloader.m3k file back but don't really want the file there since it appears in my songs list.

Has anyone else experience this, or is this an unrelated issue. Not sure if it's relevant but I'm using a Samsung EVO Select 256GB microSDXC UHS-I U3 microSD card. I have also checked that the SD card is still FAT32 by right-clicking the fiio drive and looking at the drive properties.

Just to note that when I re-add the bootloader.m3k file and connect via USB then eject then I don't see the error text.

Any help is greatly appreciated. Thanks!

I also have some suggestions to make the guide clearer:
- On Step 5 there is a sentence that reads "Use the buttons on your to select Backup under the Bootloader menu.". There is a missing word between "your" and "to". Also should this specify that the volume buttons must be used to navigate?
- Personally I didn't know what to do after I completed Step 5, I didn't know what option to chose in the bootloader screen. Perhaps a sentence can be added to tell users to pick [Boot Select]->Rockbox if they wish to load into Rockbox.

Update

I think I've fixed the issue however I'm not sure why it worked. I deleted the bootloader file from the FIIO m3k itself using the context menu on the file. I haven't encountered the issue after that. Hopefully it's a permanent fix  ;) We shall see.

On a side note, does anyone have tips for removing the micro SD card from the m3k? I don't need to remove it but upon trying to it seems really stuck in there. I don't want to damage the thing if I ever need to remove it.
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on May 17, 2022, 06:55:56 AM
*PANIC*
TLB refill handler at 0x800272fc! [0x4]
You'll need to post the RB version (System > Rockbox Info) for that message to be useful.  Also, did it occur in Rockbox or the bootloader USB mode?

Quote
I also have some suggestions to make the guide clearer:
- On Step 5 there is a sentence that reads "Use the buttons on your to select Backup under the Bootloader menu.". There is a missing word between "your" and "to". Also should this specify that the volume buttons must be used to navigate?
- Personally I didn't know what to do after I completed Step 5, I didn't know what option to chose in the bootloader screen. Perhaps a sentence can be added to tell users to pick [Boot Select]->Rockbox if they wish to load into Rockbox.
Thanks! I'll update the wiki page.

Quote
On a side note, does anyone have tips for removing the micro SD card from the m3k? I don't need to remove it but upon trying to it seems really stuck in there. I don't want to damage the thing if I ever need to remove it.
On mine the SD slot is spring loaded so I haven't had any problems removing it. If anything, it has a tendency to fly halfway across the room... :)
Title: Re: FiiO M3K Install (Native port)
Post by: Thew on May 17, 2022, 08:55:41 AM
On a side note, does anyone have tips for removing the micro SD card from the m3k? I don't need to remove it but upon trying to it seems really stuck in there. I don't want to damage the thing if I ever need to remove it.

I have two M3Ks and the SD cards on both spring out with no problem after a slight push inwards. However, I remember when the player first came out there were a couple of reviews that mentioned cards getting stuck so perhaps some have a fault.
Title: Re: FiiO M3K Install (Native port)
Post by: demon_slayer on May 17, 2022, 09:19:56 AM
Code: [Select]
You'll need to post the RB version (System > Rockbox Info) for that message to be useful.  Also, did it occur in Rockbox or the bootloader USB mode?
It appeared straight after I removed the micro USB cable from the M3K.

Code: [Select]
I have two M3Ks and the SD cards on both spring out with no problem after a slight push inwards. However, I remember when the player first came out there were a couple of reviews that mentioned cards getting stuck so perhaps some have a fault.Mine isn't budging at all :( Might shoot the manufacturer/Amazon a message and see what they say
Title: Re: FiiO M3K Install (Native port)
Post by: demon_slayer on May 18, 2022, 02:00:03 AM
Not sure if this is related to Rockbox but when I go to eject my M3K I see the following prompt even though there is no file explorer open.

Only when I eject using the Windows toolbar shortcut I see the prompt. If I right click the FIIO drive whilst in File Explorer then it ejects without the prompt.

Anyone know what's going on?
Title: Re: FiiO M3K Install (Native port)
Post by: Frankenpod on May 18, 2022, 11:19:35 AM
I find windows does that a lot.  I don't _think_ it has anything to do specifically with Rockbox.

Windows seems to have a habit of insisting that a device, or occasionally a file, is 'in use' when it isn't.
Title: Re: FiiO M3K Install (Native port)
Post by: demon_slayer on May 20, 2022, 02:05:57 PM
I just got the following white screen with the following error message again :(

*PANIC*
TLB refill handler at 0x800272fc! [0x4]


My rockbox version is 2f71571c0a-220515. It doesn't happen all the time but seems to happen when I eject and remove the USB from the M3K. I am able to turn off the device then reboot back into Rockbox.

I could try reinstalling Rockbox from scratch. What the best method for clean installing Rockbox (including reformatting the SD card) ?

Update
It happened again but with a slightly different message

*PANIC*
TLB refill handler at 0x8007c970! [0x720065]




Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on May 22, 2022, 07:42:01 AM
I just got the following white screen with the following error message again :(

*PANIC*
TLB refill handler at 0x800272fc! [0x4]


My rockbox version is 2f71571c0a-220515. It doesn't happen all the time but seems to happen when I eject and remove the USB from the M3K. I am able to turn off the device then reboot back into Rockbox.

I could try reinstalling Rockbox from scratch. What the best method for clean installing Rockbox (including reformatting the SD card) ?

Update
It happened again but with a slightly different message

*PANIC*
TLB refill handler at 0x8007c970! [0x720065]


I can reproduce the first crash by plugging in USB from the file browser and then clicking a file after unplugging. The second crash is probably caused by the same underlying bug. I opened an issue for it on the bug tracker, FS#13352 (https://www.rockbox.org/tracker/task/13352).

Reinstalling rockbox won't help, but you should be able to work around the bug by exiting the file browser and going back to the main menu before you plug in USB.

Just for reference, if you want to do a clean re-install of rockbox for any reason: you only need to delete the entire .rockbox folder and unzip a new build. You don't need to reformat the SD card unless you suspect filesystem corruption.
Title: Re: FiiO M3K Install (Native port)
Post by: demon_slayer on May 26, 2022, 09:55:16 AM
Thanks for raising a bug! For now I've reverted back to the original FIIO 1.4.5 firmware for now since I like some of it's behaviours and UI experience but it lacks themes which rockbox was awesome for. Hoping to come back to rockbox in the near future :)
Title: Re: FiiO M3K Install (Native port)
Post by: 7o9 on May 26, 2022, 03:12:57 PM
Thanks for raising a bug! For now I've reverted back to the original FIIO 1.4.5 firmware for now since I like some of it's behaviours and UI experience but it lacks themes which rockbox was awesome for. Hoping to come back to rockbox in the near future :)

What kind of behavioirs of the FiiO firmware do you like? I have never actually used their firmware and went straight to Rockbox.
Title: Re: FiiO M3K Install (Native port)
Post by: demon_slayer on May 27, 2022, 06:47:39 AM
What kind of behavioirs of the FiiO firmware do you like? I have never actually used their firmware and went straight to Rockbox.

What I like about the FIIO firmware that I didn't see in Rockbox:
- The ability to use the Fast Forward/Rewind buttons to scroll through lists, I found this to be better than relying solely on the scroll touch pad to select songs. It allows much fine grained control when choosing songs. However I noticed that using the fast-forward buttons in Rockbox is great too since it is used to scroll past multiples songs in a large list. From what I've seen the FIIO firmware isn't great for traversing large lists since you have to long press the fast-forward button which scrolls past each song individually. What I would perhaps like to see from Rockbox (if possible) is a toggle in settings to be able to switch between using the fast-forward buttons to either traverse 1 song or traverse multiple when scrolling.
- The ability to use the player as a DAC (granted if you don't use this feature then it's not a biggie, I don't think I'll use it much but it's nice to have the option to use it, I tried using it with listening to SoundCloud songs on my Linux PC and it sounded awesome)
- Visual indicators to distinguish between folders and files (perhaps this is possible in Rockbox but I didn't see it, I mainly use file browsers in the player rather than creating a database so I prefer to see a distinction between files and folders)
- The FIIO firmware gives the user a dialog box when the power button is long-pressed if they want to power off or not (again I'm neither here nor there on this but I think it's nice to have)

What I don't like about the FIIO firmware:
- Album art isn't rendered instantly, it takes a few seconds to appear.
- When viewing files in the file browser list, the file extensions are shown. It would be nice to be able to hide the file extensions (again this may be possible but I haven't played around enough with the settings). I do like how Rockbox shows songs though.
- Not the best for traversing up and down long lists of songs (this goes back to my point about being able to use the fast-forward buttons to either traverse 1 or multiple songs)

As I use the player more I will add to this list.
Title: Re: FiiO M3K Install (Native port)
Post by: chris_s on May 27, 2022, 09:43:26 AM
The ability to use the Fast Forward/Rewind buttons to scroll through lists, I found this to be better than relying solely on the scroll touch pad to select songs. It allows much fine grained control when choosing songs. However I noticed that using the fast-forward buttons in Rockbox is great too since it is used to scroll past multiples songs in a large list. From what I've seen the FIIO firmware isn't great for traversing large lists since you have to long press the fast-forward button which scrolls past each song individually. What I would perhaps like to see from Rockbox (if possible) is a toggle in settings to be able to switch between using the fast-forward buttons to either traverse 1 song or traverse multiple when scrolling.
In case you weren't aware of this, you can also tap the top and bottom of the scroll strip (instead of sliding your finger over it) to move to the next or previous list item.
Title: Re: FiiO M3K Install (Native port)
Post by: 7o9 on May 27, 2022, 12:44:03 PM
Thanks for sharing, demon_slayer.

Some of the hardware features like DAC-support you will likely always need the original firmware for.
Title: Re: FiiO M3K Install (Native port)
Post by: Frankenpod on May 27, 2022, 01:42:08 PM
- Visual indicators to distinguish between folders and files (perhaps this is possible in Rockbox but I didn't see it, I mainly use file browsers in the player rather than creating a database so I prefer to see a distinction between files and folders)

Don't the icons show that?  Assuming you are using a theme that has "show icons" turned on (though you can just turn that on from the themes menu anyway, I think).
Title: Re: FiiO M3K Install (Native port)
Post by: demon_slayer on May 29, 2022, 12:59:29 PM
In case you weren't aware of this, you can also tap the top and bottom of the scroll strip (instead of sliding your finger over it) to move to the next or previous list item.
Oh no way! Very cool, I didn't know this was possible when trying out rockbox

Don't the icons show that?  Assuming you are using a theme that has "show icons" turned on (though you can just turn that on from the themes menu anyway, I think).
I was using the NightPod theme and I didn't see a folder icon out of the box, didn't know there was a 'show icons' setting so it probably is possible. Ignore that point in my original post in that case
Title: Re: FiiO M3K Install (Native port)
Post by: chris_s on May 29, 2022, 01:14:16 PM
I was using the NightPod theme and I didn't see a folder icon out of the box, didn't know there was a 'show icons' setting so it probably is possible. Ignore that point in my original post in that case
You can blame me for that... :D I deliberately blanked out the icons in that particular theme to create whitespace to the left side of list items – which is actually kind of hack that should probably rather be a Rockbox UI option. Maybe I'll put up another version with yuuiko's icon set from the InfoMatrix-v2 theme – the ones that are also used in the redux m3k theme. You can also choose your own icon sets by editing a theme's cfg file, although there doesn't appear to be a UI option for that.
Title: Re: FiiO M3K Install (Native port)
Post by: demon_slayer on June 20, 2022, 07:22:19 AM
Since reverting back to the original FIIO firmware from Rockbox I tried to follow the steps in this guide to reinstall Rockbox to give it another try and noticed that when I restart my player it would keep booting into the FIIO firmware and not the rockbox firmware. I'm not sure what I'm doing wrong, has anyone else experienced this ?
Title: Re: FiiO M3K Install (Native port)
Post by: 7o9 on June 20, 2022, 01:20:56 PM
Could it be the bootloader is not actually installed?
Title: Re: FiiO M3K Install (Native port)
Post by: demon_slayer on June 20, 2022, 03:32:01 PM
Could it be the bootloader is not actually installed?

I can get to Step 5 of the instructions so I can see the bootloader screen and am able to select Rockbox. It is only when I reboot is when it boots into the FIIO software. 
The first time I installed Rockbox it worked fine. Perhaps because I've reverted back to FIIO firmware and am now trying to reinstall rockbox that is causing issues  ???
Title: Re: FiiO M3K Install (Native port)
Post by: amachronic on June 20, 2022, 04:10:49 PM
You're probably forgetting to select Install or update bootloader. When you hit step 5 the bootloader is only temporarily in RAM, it isn't flashed to the device until you hit install. And remember to take a bootloader backup before the install as well.
Title: Re: FiiO M3K Install (Native port)
Post by: demon_slayer on June 21, 2022, 02:48:01 AM
You're probably forgetting to select Install or update bootloader. When you hit step 5 the bootloader is only temporarily in RAM, it isn't flashed to the device until you hit install. And remember to take a bootloader backup before the install as well.

Silly me, you were right! I've got it re-installed properly now, thanks!