[How To] installing openwrt on old music player : airmusic M2 / NW11 / soundmate

I restart a topic from the old forum about airmusic players :
https://forum.archive.openwrt.org/viewtopic.php?id=50512

T2jb5zXf8cXXXXXXXX_!!1650254499

These player were very interesting, based on the first version of the linkplay modules, which were "easily" modded thanks to the processor ar9331 which is the same on TP-Link TL-WR703N. These player include dedicated sound chipset (wolfson) and an digital optical output directly managed by the ar9331. SebastianFM has done drivers for these which are shared in this post.

The objective of this post is to share files and knowledge about it.

These are old note, a little messy but I you look carefully all you need to modify will be here.

This contains some technical details but pre-compiled image for soundmate M2 is given at the end of this post.


BACKUP

Before starting backup your device partitions :

You can use this tutorial :
https://wiki.openwrt.org/doc/howto/generic.backup
And this one :
https://forum.openwrt.org/viewtopic.php?pid=175111#p175111

For information the place to find the mac@ in uboot :
https://forum.openwrt.org/viewtopic.php?pid=187108#p187108

On airmusic "cat /proc/mtd" :

mtd0: 00020000 00001000 "u-boot"
mtd1: 00100000 00001000 "kernel"
mtd2: 006d0000 00001000 "rootfs"
mtd3: 0002c000 00001000 "rootfs_data"
mtd4: 00010000 00001000 "art"
mtd5: 007d0000 00001000 "firmware"

We backup it on usb key :

cat /dev/mtd0 > /tmp/mnt/USB-disk-a1/openWRT/backup/u-boot
cat /dev/mtd1 > /tmp/mnt/USB-disk-a1/openWRT/backup/kernel
cat /dev/mtd2 > /tmp/mnt/USB-disk-a1/openWRT/backup/rootfs
cat /dev/mtd3 > /tmp/mnt/USB-disk-a1/openWRT/backup/rootfs_data
cat /dev/mtd4 > /tmp/mnt/USB-disk-a1/openWRT/backup/art
cat /dev/mtd5 > /tmp/mnt/USB-disk-a1/openWRT/backup/firmware


COMPILATION

In the past I have use an VMware ubuntu 16.04 x64
You can take this image builder :
https://archive.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/
or this one more recent but not compiled : https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/

Now some modifications :
Activate wifi on boot :
https://oldwiki.archive.openwrt.org/doc/howto/build#custom_files ==> newer url
So we include a new subfolder on the root build which will include lib/wifi/mac80211.sh and inside :
You need to remove 'option disabled 1' (from lib/wifi/mac80211.sh)

To launch compilation you can run this command line (inspired from this post) :

make image PROFILE=TLWR703 PACKAGES="-ppp -ppp-mod-pppoe block-mount kmod-usb-storage kmod-scsi-core kmod-crypto-hash kmod-lib-crc16 kmod-fs-ext4 liblua libuci-lua rpcd luci-lib-ip libiwinfo libiwinfo-lua luci-theme-bootstrap -luci-app-firewall lua luci-proto-ppp libubus-lua luci-mod-admin-full luci-lib-nixio luci-base luci-proto-ipv6 uhttpd luci uhttpd-mod-ubus kmod-usb-audio kmod-i2c-core kmod-sound-soc-core alsa-lib alsa-utils kmod-sound-core kmod-ac97 kmod-sound-core kmod-input-core kmod-lib-lzo kmod-regmap libncurses terminfo libpthread librt " FILES="files" -j1 V=s

You could have a problem of firmware file size.
It doesn't work because the firmware of the TLWR703 is normally 4MB while the firmware of the M2 should be 8MB. To correct it :
Open : target/linux/ar71xx/image/Makefile
or target/linux/ar71xx/image/tp-link.mk on imagebuilder from trunk) ,
Then search for define Device/tl-wr703n-v1 and replace this line :
$(Device/tplink-4mlzma) by $(Device/tplink-8mlzma)

Once you have successfuly compiled the firmware, you should have something like : "openwrt-15.05.1-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin"
Copy it on USB key, then with telnet commands :

/tmp/mnt/USB-disk-a1/
cp openwrt-15.05.1-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin /tmp/
mtd -r write openwrt-15.05.1-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin firmware

OK I flashed OpenWRT successfuly

OK now we can install drivers from SebastianFM
They are some Prerequisite, first install these packages:

  • opkg update
  • opkg install kmod-i2c-core
  • opkg install kmod-sound-soc-core
  • opkg install alsa-lib
  • opkg install alsa-utils

then push this kernel modules to device and load them in order:

  1. snd-soc-ar9331-audio.ko
  2. ar9331-audio-dev.ko

old : 1rst version of the driver: (support only optical output)
---- copy the 2 files .ko in /lib/modules# cd 4.1.20/
cd /lib/modules# cd 4.1.20/
wget http://alecsis.free.fr/sqeezeWRT/snd-soc-ar9331-audio.ko
wget http://alecsis.free.fr/sqeezeWRT/ar9331-audio-dev.ko

New version (support wolfson jack ouput) :
Message from SebastianFM :

Some time ago I just found a way how to use i2c over gpio kernel driver which allows kernel drivers to communicate with audio codec connected to GPIO pins. This way I didn't need to write my own codec driver but I could use existing WM8904 codec kernel driver.
After few small changes in codec driver everything works perfectly, including mixer, volume control, equalizer (using alsamixer). I'm using latest OpenWrt snapshop so I compiled modules for kernel 4.4.14. I prepared source code for release and I'll try to upload it to GitHub soon.

Load modules in the following order:
snd-soc-ar9331-audio.ko
wm8904.ko
ar9331-audio-dev.ko

Thanks to SebastianFM for these files :
3.18.23.zip
4.4.14.zip

 cd /lib/modules/4.1.20/
wget http://alecsis.free.fr/sqeezeWRT/V2/ar9331-audio-dev.ko
wget http://alecsis.free.fr/sqeezeWRT/V2/wm8904.ko
wget http://alecsis.free.fr/sqeezeWRT/V2/snd-soc-ar9331-audio.ko

insmod  /lib/modules/4.1.20/snd-soc-ar9331-audio.ko
insmod  /lib/modules/4.1.20/wm8904.ko
insmod  /lib/modules/4.1.20/ar9331-audio-dev.ko

(respect load order)

list sound cards :

aplay -l
cat /proc/asound/cards

Now you can test :wink:

To autoload this modules at start, you can edit vi /etc/rc.local
then add lines

insmod  /lib/modules/4.1.20/snd-soc-ar9331-audio.ko
insmod  /lib/modules/4.1.20/wm8904.ko
insmod  /lib/modules/4.1.20/ar9331-audio-dev.ko

I don't want to compile my own firmware !

I can understand :sweat_smile:
You can get my pre-compiled firmware and flash it easily :
(please backup before and be careful) :

cd tmp/
wget http://alecsis.free.fr/sqeezeWRT/openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin
mtd -r write ./openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin firmware

This image require a lot of work, it's not perfect but it include :

  • Squeezebox player (thanks to Squeezelite and the awesome SqueezeWRT) (should be enought to do anything :stuck_out_tongue: )
  • MPD player
  • DLNA player (thanks to UPMPDCLI)
  • airplay (thanks to shairport)

Other things :

Cantata is really awesome to control MPD player
Squeezebox server (LMS) allow to transform your squeezelite player in a synchronized multiroom player compatible with airplay, upnp, spotify connect and many other awesome things

New URL: https://openwrt.org/docs/guide-user/additional-software/imagebuilder#files_variable

The old page is for archival purposes only and does not receive updates any more.

You might want to update your postign accordingly.

1 Like

Hi Schmurtz,

I also got one of these devices some time ago. Mine was a later version, with more RAM, Flash, and RJ45 port, but still same firmware.

https://img.alicdn.com/imgextra/i1/712263107/TB2cZkrbpXXXXXZXXXXXXXXXXXX_!!712263107.jpg

I recently entered into it, to switch wireless off in order to reduce a little bit radio pollution at home (I have it wired) and realized it was OpenWRT. I reviewed posts on it and seems quite interesting. It has several programs violating GPL: audiorender, newshair (shairport), nrender... or that i cant find sources of.

Would it be possible to flash a recent OpenWRT version to it, and get free programs that provide music streaming capabilities (In fact I just need it as a receiver for digital audio and put the stream to SPDIF, dlna renderer, and perhaps digital radio tuner)?
I mean, have you tried to upgrade to the current OpenWRT release? compatibility problems with programs migrated long ago?
Thank you
Cheers,
J

Hi John, I don't try anymore to update it. The main reason is that SebastianFM who has compiled the sound driver is the only one who own the source code. May be there's another drivers since all this time but not sure... So I stuck on this old version, that's enought to play music in my toilets :smile:
If you discover some new things about this device, keep me informed here please, I still curious to know if I will do something with the other one that I keep in his box since many years :stuck_out_tongue:

Hello schmurtz, after install your prebuild openwrt firmware, how to access the device? I cant find it via wireless. My product is Veetop Airmusic with 8MB flash, 32MB ram

Hello schmurts, do you plan to update your prebuilt firmware with new version of shairport-sync as it now supports AirPlay 2 with multiroom audio even from iOS devices.
That would give new life to all NW11. Thanks!

If you install schmurtz's firmware, be sure to have serial console ready. The default Wi-Fi client settings are

wireless.@wifi-iface[0].ssid='Freete'
wireless.@wifi-iface[0].bssid='68:7F:74:1B:C8:08'
wireless.@wifi-iface[0].encryption='psk2'
wireless.@wifi-iface[0].key='JalLqemb1!'

and no AP mode, so unless you setup AP with these parameters, you won't connect to it anymore.
Other than that, the firmware works, LuCi is there, after installing WM drivers the AirPlay works nicely.


Notes to myself

Link to the latest buildtools for TL-WR703N:
https://archive.openwrt.org/releases/17.01.7/targets/ar71xx/generic/lede-imagebuilder-17.01.7-ar71xx-generic.Linux-x86_64.tar.xz

17.01.7 is using kernel 4.4.167, so it should work with http://alecsis.free.fr/sqeezeWRT/4.4.14.zip kernel modules
https://github.com/mikebrady/shairport-sync-for-openwrt
https://github.com/mikebrady/shairport-sync-for-openwrt/blob/2.1/Makefile PKG_VERSION:=4.0-dev
It will be necessary to create a new nqptp package for OpenWRT https://github.com/mikebrady/nqptp as a dependency of shairport-sync 4.0.

@moole6, I'm curious if you were ever successful in upgrading shairport to shairport-sync on these devices? I haven't worked with OpenWRT before, but I have this device and am considering trying to follow the "guide" on this thread to try and achieve a shairport-sync reciever.