FiiO X1 II (2nd Gen) w/ Bluetooth!
Jan 20, 2017 at 5:43 PM Post #2,011 of 3,121
DISCLAIMER: Following this procedure could brick your X1ii and probably void your warranty. So do it at your own risk.
 
Hi everybody:
 
I've been playing a little with the Fiio X1ii FW since I got it (mid november)
 
It is really simple to create your own firmware.
 
I'm on a Linux (ubuntu 16.10) machine, so my instructions are for that.
 
For packing I'm using mkyaffs2 from yaffs2utils 0.2.9_20120815
(latest.tar.gz from
https://code.google.com/archive/p/yaffs2utils/downloads).
 
For unpacking, unyaffs2 from yaffs2utils is not working, so I'm using ubuntu's unyaffs 0.9.6-1 (apt-get install unyaffs)

So, to install dependencies:
 
sudo apt-get install build-essential
sudo apt-get install unyaffs
wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/yaffs2utils/latest.tar.gz
tar zxvf latest.tar.gz
cd latest
make 

 
Then create a folder with Fiio's FW and mkyaffs2:
 
mkdir ~/x1ii
cp mkyaffs2  ~/x1ii
cd ~/x1ii
wget "https://www.dropbox.com/s/81dwz6k5apflq0i/X1_2nd_gen_FW1.5.6_X1II.fw?dl=1" -O X1II.fw

 
Now, proceed to unpack the FW:
 
mkdir -p myfw
tar zxvf X1II.fw -C myfw
sudo unyaffs myfw/fifo_rootfs.yaffs2 myfw/fifo_rootfs

 
Now, you can browse the filesystem in myfw/fifo_rootfs, modify it as you wish and repack it:
 
cd ~/x1ii/myfw
sudo ../mkyaffs2 fifo_rootfs fifo_rootfs.yaffs2
echo -n `md5sum fifo_rootfs.yaffs2 | cut -c1-32` > fifo_rootfs.yaffs2.md5
tar zcvf ../X1II.repacked.fw fifo_uimage fifo_uimage.md5 fifo_uimageesmt fifo_uimageesmt.md5 fifo_rootfs.yaffs2 fifo_rootfs.yaffs2.md5

 
And that's it, you can flash ~/x1ii/X1II.repacked.fw as usual (rename it to X1II.fw and copy it to sdcard).
 
I have two scripts to pack and repack the fw. You can find them in:
 
x1ii_fw_unpack.sh: https://gist.github.com/rogeliodh/2134fc19152e36ba7ffd34b3136d3635
x1ii_fw_pack.sh: https://gist.github.com/rogeliodh/b9585bab3153aa031cc0030f4d7b8c38
 
You have to put them next to mkyaffs2 (in ~/x1ii).
 
My first/only modification has been to edit ~/x1ii/myfw/fifo_rootfs/etc/udev/scripts/mmc.sh to run at boot a shell script stored in sdcard with:
 
--- mmc.sh      2016-11-28 19:16:06.000000000 -0600
+++ /home/rogelio/x1ii/mmc.sh   2017-01-20 08:29:18.548904641 -0600
@@ -13,6 +13,7 @@
        then
                ntfs-3g /dev/$1 /mnt/mmc
        fi
+       sh /mnt/mmc/custom.sh &
 elif [ "$ACTION" == "remove" ]
 then
     rm /tmp/mmc_add -f
 

 
You can find the replacement mmc.sh in https://gist.github.com/rogeliodh/0d2b7850b801bb619f59c99af139fac1
 
And putting some custom commands in custom.sh in the sdcard. You can see my custom.sh in https://gist.github.com/rogeliodh/5d70a6cf2a9db99828b3a393340821d3
 
I'm sharing this information so we can create custom FW from now on. I don't have enough time to play with this, but I can help anybody who wants to.
 
UPDATE: I've just tried running all this under "Windows Subsystem for Linux" on a Windows 10 machine (follow http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/) and it works partially. The problem is that when running unyaffs it can't create some special files (device files /dev/null for example), so the regenerated FW will be missing those essential files and, surely, the custom FW won't work properly. So, you can use "Windows Subsystem for Linux" to play a little but not to create the FW (at least not for now).
 
Jan 20, 2017 at 8:20 PM Post #2,014 of 3,121
New firmware - just ran a full media update.  64Gb card - all my tracks are aac256 (its completely transparent to me so that's why I use it).  Card was formatted in a FiiO device - FAT32.  I'll retry exfat at a later date.  All artwork has been removed from tags and exists as single jpeg in each folder.
 
Still scanned every file (6511) - but scan took 23 minutes.  An improvement on last time - but the X5iii one the same card takes around 4 minutes.
 
Tried connecting the FiiL Diva (Bluetooth) - but won't recognize it.  The X5iii and X7 both connect well.
 
Still some lag between selecting a song and having it actually play. Once its going though, the lag has been reduced.  Scrolling is pretty good.
 
TBH - if they could speed this thing up, improve the BT, and fix replay-gain and gapless, it would really be an awesome little DAP IMO.
 
Jan 20, 2017 at 8:34 PM Post #2,015 of 3,121
  @FiiO,
Thanks for the new Firmware! The bug with not all songs appearing in the 'All Songs' section is now fixed and the update of the lib itself is pretty fast too! 

George,
 
Thanks , if you have any questions or suggestions ,please feel free to tell us.
 
FiiO Stay updated on FiiO at their sponsor profile on Head-Fi.
 
https://www.facebook.com/FiiOAUDIO https://twitter.com/FiiO_official https://www.instagram.com/fiioofficial/ https://www.fiio.com support@fiio.com
Jan 20, 2017 at 8:46 PM Post #2,016 of 3,121
  Well!!! Faster to update the database, but no gapless yet......
:'(

Robton ,for the gapless, we will add it in our new Firmware if everything goes smoothly. 
 
FiiO Stay updated on FiiO at their sponsor profile on Head-Fi.
 
https://www.facebook.com/FiiOAUDIO https://twitter.com/FiiO_official https://www.instagram.com/fiioofficial/ https://www.fiio.com support@fiio.com
Jan 20, 2017 at 8:54 PM Post #2,017 of 3,121
  FiiO Releases the Chinese New Year Firmware FW1.5.6 for X1 2nd gen: http://www.head-fi.org/t/822632/official-x1-2nd-gen-stable-firmware-discussion-thread-fw1-5-6
 
X1 2nd gen FW1.5.6:  >>Click here.  
How to upgrade the X1 2nd gen: >> Click here

The following changes and improvements were made to FW1.5.6 compared to FW1.5.3:
1. Improved the issue that some tracks could not be updated to the media library;
2. Fixed issue where the player might freeze when playing certain tracks;
3. Fixed issue where the player might freeze when skipping through albums under the Album category;
4. Fixed issue where there would be no sound output when connecting to some Bluetooth speakers;
5. Fixed issue where the player might freeze after searching for a Bluetooth device then turning off the screen and waking up.
6. Miscellaneous bug fixes.


新年快乐! 

 
Thanks Fiio! I hope you all get plenty of red envelopes!
 
Jan 21, 2017 at 1:56 PM Post #2,022 of 3,121
@FiiO Glad to hear about the new firmware update. Happy New Year!
 
@Dobrescu George Here's what I can gather for now, about how the construction of the firmware :
 
- fifo_uimage & fifo-uimageesmt containes Images of Linux kernels
- In the YAFFS2 image :
-- The whole OS is based on Linux MIPS
-- /usr contains the main programs
-- /etc/init.d/rcS contains most of the declarations
-- /.ash_history is the file I sent a pastebin of : the one with the differents command of tests
-- /etc/profile contains a reference to Ingenic Software, the company which conceived the processor. So we can take the wild guess that the Linux they developed the FW from is the stock one, bundled with the processor.
 
-- /usr is as you can guess, the main folder here
--- fifo-audio-app is the GUI itself, included the interface, the interactions, the events, etc. so bummer to tweak the original FW from what we have (aside for the custom themes, of course) :-/
 
Let's think a little further : is it possible to make a Rockbox build or anything similar on the Fiio X1 II? Well, theoretically yeah. We know that it's Linux MIPS, we know how the firmware is packed. It's more about how we can handle the hardware.
 
EDIT : my original .org file was too long, but if you're curious ^^' : http://pastebin.com/bxLYviB9
 
Jan 21, 2017 at 2:51 PM Post #2,023 of 3,121
  @FiiO Glad to hear about the new firmware update. Happy New Year!
 
@Dobrescu George Here's what I can gather for now, about how the construction of the firmware :
 
- fifo_uimage & fifo-uimageesmt containes Images of Linux kernels
- In the YAFFS2 image :
-- The whole OS is based on Linux MIPS
-- /usr contains the main programs
-- /etc/init.d/rcS contains most of the declarations
-- /.ash_history is the file I sent a pastebin of : the one with the differents command of tests
-- /etc/profile contains a reference to Ingenic Software, the company which conceived the processor. So we can take the wild guess that the Linux they developed the FW from is the stock one, bundled with the processor.
 
-- /usr is as you can guess, the main folder here
--- fifo-audio-app is the GUI itself, included the interface, the interactions, the events, etc. so bummer to tweak the original FW from what we have (aside for the custom themes, of course) :-/
 
Let's think a little further : is it possible to make a Rockbox build or anything similar on the Fiio X1 II? Well, theoretically yeah. We know that it's Linux MIPS, we know how the firmware is packed. It's more about how we can handle the hardware.
 
EDIT : my original .org file was too long, but if you're curious ^^' : http://pastebin.com/bxLYviB9

 
That's a lot of work you put in there tho! 
 
Let's see if we can repack the FW and give custom UIs a test for now! Ths ought to speed the device up a bit! 
 
Jan 21, 2017 at 3:08 PM Post #2,024 of 3,121
I'm going wireless today. 
cool.gif

 

 
--
 

Users who are viewing this thread

Back
Top