Volumio 2 on Amlogic g02ref (AML8726-MX)

Hello,

I have an old Android TV Box based on the Amlogic g02ref customer platform with AML8726-MX SOC. Originally, I had it running LibreELEC (Kodi) which worked rather well given the low-specs of the device (Dual-Core, 1GB RAM).

I would like to repurpose this box as a dedicated audio player since it has a coax digital output which I could connect directly to my amp. With LibreELEC (Kodi), navigating through the audio files, web radio and Youtube streams proved to be a bit cumbersome and the only real way to do it is through a screen connected to the device. Kodi’s web interface is sluggish and sometimes freezes the device, and there are a lot of things you cannot access through it (such as Audio Settings).

I needed something to play music files off my DLNA server, Youtube streams and web radio - all controllable through a responsive web interface so the device can run headless. I decided to give Volumio a try.

So in case anyone else is interested, here it is: Volumio image for Amlogic g02ref devices (version 2.657)

Note that this build is by no means perfect, mainly due to the outdated kernel used (and the partially broken Amlogic m6 PCM driver that came with it). It is important that you check the README on the repo for an overview of what issues you might encounter:

https://github.com/patrickkfkan/volumio-platform-aml/tree/master/g02ref

So far it’s working well enough for me. I am using the coax digital audio output and have set Audio Resampling to 16-bit + Very High quality while keeping sampling rate “Native”. Most of my audio files are 44.1khz and 48khz, with the occasional 96khz and a few 192khz. Since I intend to run Volumio for 24/7, I’ll see how it goes in terms of stability.

The web interface is, by the way, snappy. Way snappier than Kodi’s :wink:

I have taken the liberty to fork the platform-aml repo started by @balbes150 and placed my g02ref platform files there. I should mention I learnt a lot from @balbes150’s builds for other Amlogic SOCs. Credits also go to those at the LibreELEC team for the Amlogic kernel, @emanuel4you for his g02ref kernel patches and @adilinden-oss for the OverlayFS kernel patch.

Well done!
Pity that this is “doomed” due to lack of support in a mainline kernel.
Kernel 3.10 is very old, I remember backporting overlayfs when I did the first version for the Harddkernel’s amlogic s805 based Odroid C1 years ago. But we still do regular updates for it, including myVolumio support.

Thanks for the compliment :wink:

At least the S805 is one gen ahead of the g02ref (Meson8 vs Meson6), so even with the same kernel version some things are supported better. But for S805 devices, we have hope they will one day be fully supported in mainline: http://linux-meson.com/doku.php (despite what they say, I don’t believe they will ever have full support for g02ref/Meson6 given the age of these things and the effort required to support them).

So far, I have been running my g02ref build 24/7 without additional issues other than those already mentioned in my github readme. I have since owned a couple of 176.4khz and 88.2khz FLACs which I couldn’t play with the onboard audio because of broken / incompatible Amlogic PCM drivers, so I am now using a cheap $5 USB to Digital Coaxial adapter for audio output. With this adapter, I don’t have to rely on the Amlogic drivers and I can resample those FLACs to 16-bit 48khz (which this adapter supports) for playback. Fortunately, I don’t have great ears and haven’t been able to distinguish the difference in sound quality :laughing:
IMAG2531s.jpg

Updated to Volumio 2.692 . CIFS support also added to kernel (couldn’t believe I left it out in the first place :astonished: )

I’m probably the only one using a g02ref device for Volumio :smiley: , but I’ll put it up here anyway in case someone finds it useful.

Download: Volumio2.692-2019-12-29-amlg02ref.img

do you have anything newer re. amlogic devices?

The only “newer” Amlogic device I have is a NanoPi K2, which was actually released 2+ years ago :laughing:

(btw, I tried to reply to your PM but couldn’t add you to recipients)

Hello Patrick.
Yesterday I found this post about running Volumio on Amlogic 8726-MX devices, something I was looking for. I have a Matricom G-Box Midnight MX2 with that SOC. I have flashed a SD card with your image and it worked on first try using the toothpick method, amazing.
I already using Balbes fork for S802 for lonh time with very good performance. But the s802 fork doesn’t have WIFI support, at least in my box. The MX fork is working perfectly using WIFI and Ethernet network connections.
I’m using SPDIF audio out to connect to a AV receiver.
I tested very few things, installed Spotify an Spotify Connect pluggin. First one worked withou issues. Second one doesn’t show on Spotify app on my cellphone. Maybe a pluggin issue.
The other issue that I found is that Airplay is not working. Apparently the sharepoint service doesn’t starting at boot time. I started it manually and my iPhone detected the volumio box, but i ran out of time to test if audio is being streamed.
Thank you!!

The AirPlay issue was described here:https://forum.volumio.org/airplay-not-autostarting-after-upgrading-692-t13521.html
Is present at Volumio 2.692.

Is there a way to make the box to boot directly from SD card without having to apply the toothpick method? I’ve been reading the Libreelec forum but dinidn’t figured it out. Thank you.

Hi chatosaf,

Thanks for pointing this out. Come to think of it, I actually haven’t tried Airplay since upgrading to 2.692 (it was working in 2.657 with my friend’s iPhone). I don’t own any Apple devices myself so the issue doesn’t really affect me, but it would be nice to see this fixed in the next Volumio release.

-Patrick

Do you have access to the serial console of your device? For my board I connected a UART adapter like this (wires soldered to the debug pins - I added a fan as well since the box runs rather hot for me :wink:):
aml8726mx-uart-1.jpg

If you have access to the serial console, it should be possible to configure u-boot so that it boots directly from SD card.

Ok Patrick, thanks for the information. I will investigate if it’s possible to apply the multi-boot procedure that is used on S802 boxes.
Also I will try to build a image based on previous version of volumio.

Great job, thank you!

@patrickkfkan
Thank you for this build. It is the only one working on my meson6 box.
Can you tell me if wifi for 8188eu is working?
I can “modprobe 8188eu” it loads the driver but from web console wifi can’t be set ?
Searched a lot on the forum did not find answer. What is the proper SSH way of setting wifi on this box.

Thank you in adnace.
Best regards,
brajomobil

make sure (checking with dmesg) that the 8188euxxx firmware binary has also been loaded, there is no guarantee with these images.

@gkkpch
Thanks for helping. I am linux noob.
This is the dmesg. Is it ok?
[ 102.436541] [VFD] tm1628_write count=4
[ 102.436584] [VFD] tm1628_unlocked_set_power state=0
[ 102.436848] [VFD] tm1628_unlocked_set_power state=1
[ 102.436864] [VFD] tm1628_set_brightness(4)
[ 118.362581] cfg80211: Calling CRDA to update world regulatory domain
[ 118.448532] cfg80211: World regulatory domain updated:
[ 118.448554] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 118.448562] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[ 118.448567] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (N/A, 2000 mBm)
[ 118.448572] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm)
[ 118.448576] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 2000 mBm)
[ 118.448581] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2000 mBm)
[ 118.448585] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm)
[ 118.448590] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm)
[ 118.448595] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm)
[ 118.471050] RTL871X: module init start
[ 118.471070] RTL871X: rtl8188eu v4.3.0.5_12017.20140807
[ 118.471075] RTL871X: build time: Dec 29 2019 18:24:47
[ 118.471963] usbcore: registered new interface driver rtl8188eu
[ 118.471976] RTL871X: module init ret=0

Forgot to mention wifi is built in. Not connected to USB .

not loading firmware as far as I can see.
Check /lib/firmware/rtlwifi, does it contain a bin file starting with “rtl8188eu…”?

Hello,

I’m no longer using this for Volumio, but I’m certain WiFi works on the device I had. I’ve just taken it out for a quick spin and here are the logs:

dmesg


[ 13.420385] cfg80211: Calling CRDA to update world regulatory domain
[ 13.492658] RTL871X: module init start
[ 13.495280] RTL871X: rtl8188eu v4.3.0.5_12017.20140807
[ 13.498968] RTL871X: build time: Dec 29 2019 18:24:47
[ 13.513725] bFWReady == _FALSE call reset 8051…
[ 13.549327] RTL871X: rtw_ndev_init(wlan0)
[ 13.553023] usbcore: registered new interface driver rtl8188eu
[ 13.556533] RTL871X: module init ret=0
[ 13.932252] ionvideo open
[ 13.935368] ionvideo_stop_generating!!!
[ 13.938384] ionvideo release
[ 14.092267] cfg80211: World regulatory domain updated:
[ 14.094912] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 14.103200] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[ 14.110475] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (N/A, 2000 mBm)
[ 14.118036] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm)
[ 14.125542] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 2000 mBm)
[ 14.133134] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2000 mBm)
[ 14.140674] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm)
[ 14.148305] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm)
[ 14.155836] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm)

[ 15.080302] ==> rtl8188e_iol_efuse_patch
[ 15.801290] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

[ 17.816056] RTL871X: nolinked power save enter

[ 26.107198] ==> rtl8188e_iol_efuse_patch
[ 26.428176] RTL871X: nolinked power save leave
[ 26.929366] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 26.991860] NET: Registered protocol family 17
[ 28.627054] RTL871X: nolinked power save enter
[ 29.059766] ==> rtl8188e_iol_efuse_patch
[ 29.395956] RTL871X: nolinked power save leave
[ 29.396231] RTL871X: rtw_set_802_11_connect(wlan0) fw_state=0x00000008
[ 29.435715] RTL871X: start auth
[ 29.438008] RTL871X: auth success, start assoc
[ 29.441918] RTL871X: assoc success
[ 29.443207] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 29.449862] RTL871X: send eapol packet
[ 29.456986] RsvdPageNum: 8
[ 30.448701] RTL871X: send eapol packet
[ 30.473371] RTL871X: send eapol packet
[ 30.475471] RTL871X: set pairwise key camid:4, addr:70:62:b8:6e:08:b0, kid:0, type:AES
[ 30.504860] RTL871X: set group key camid:5, addr:70:62:b8:6e:08:b0, kid:2, type:TKIP

ls /lib/firmware/rtlwifi/

LICENCE.rtlwifi_firmware.txt rtl8192dufw_wol.bin rtl8723bs_ap_wowlan.bin
rtl8188efw.bin rtl8192eefw.bin rtl8723bs_bt.bin
rtl8188eufw.bin rtl8192eu_ap_wowlan.bin rtl8723bs_nic.bin
rtl8192cfw.bin rtl8192eu_nic.bin rtl8723bs_wowlan.bin
rtl8192cfwU.bin rtl8192eu_wowlan.bin rtl8723bu_ap_wowlan.bin
rtl8192cfwU_B.bin rtl8192sefw.bin rtl8723bu_nic.bin
rtl8192cufw.bin rtl8712u.bin rtl8723bu_wowlan.bin
rtl8192cufw_A.bin rtl8723aufw_A.bin rtl8723fw.bin
rtl8192cufw_B.bin rtl8723aufw_B.bin rtl8723fw_B.bin
rtl8192cufw_TMSC.bin rtl8723aufw_B_NoBT.bin rtl8821aefw.bin
rtl8192defw.bin rtl8723befw.bin rtl8821aefw_29.bin
rtl8192dufw.bin rtl8723befw_36.bin rtl8821aefw_wowlan.bin

lsmod | grep 8188

8188eu 775969 0
cfg80211 182221 1 8188eu

Regards,
Patrick

Thanks Patrick for confirming your experience!

@patrickkfkan
@gkkpch
Than you for help.
Comparing your dmesg with mine after this line RTL871X: module init ret=0
I dont have cfg80211: World regulatory domain updated:
Does this mean there is problem with cfg80211 ?
But I dod not touch cfg file, just created SD card…
Sorry for stupid questions but I am linux noob.
Here is my compleate dmesg: https://www.dropbox.com/s/lyfqs9o7f1hpj4q/dmesg_g02ref_rtl8188eu.txt?dl=0
Hope it helps.
Thank you in advance.
Best regards,
brajomobil