OpenWrt Forum Archive

Topic: airmusic NW11 - AR9331/32M RAM/8M Flash/Audio Codec

The content of this topic has been archived between 28 Mar 2018 and 7 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi All,

I have bought the airmusic NW11 box:

root@airmusic:~# dmesg
Linux version 2.6.39.4 (jh@srv64) (gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08) ) #5 Fri Nov 7 17:28:25 CST 2014

SoC: Atheros AR9330 rev 1
Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz

Kernel command line:  board=TL-WR703N console=ttyATH0,115200 rootfstype=squashfs,jffs2 noinitrd

MIPS: machine is TP-LINK TL-WR703N v1
wr703N

I have modified the "ushare" as you recommended:

root@airmusic:~# cat /etc/config/ushare

config 'ushare'
        option 'username' 'nobody'
        option 'servername' 'Airmusic'
        option 'interface' 'wlan1'
        option 'content_directories' '/tmp/mnt'
        option 'disable_telnet' '1'
        option 'disable_webif' '1'
        option 'enabled' '1'

       
At the beginning, I had problem with it, my *.flac files were not visible,
while I could see directories. I had to enable the 'disable_webif' option.
After that, I could share/unshare folders under GUI, which has made
files visible for me (even under sub-directories).
In my case the [option 'content_directories' '/tmp/mnt'] did not help.

I see, the "ushare" creates a kind of configuration file,
which contains shared music files see:

root@airmusic:~# ls -l /tmp/mnt/disk-a0/.??*
-rwxrwxrwx    1 root     root          4264 Jan  1 08:02 /tmp/mnt/disk-a0/.udisklist

I see, the "ushare" is unstable. Sometimes it hangs, sometimes crashes.
It seems, the problems appears when I create play list, which is probably
not supported or when I move forward/backward the playing song.
So, I created crontab job (as recommended by you):

root@airmusic:~# crontab -l
* * * * * if [ `ps | grep -c ushare` != 2 ] ; then /etc/init.d/ushare restart ; fi > /dev/null 2>&1

It restarts the "ushare" when it crashes, but I have to wait sometimes
longer than 1 minute to get the Airmusic server visible on my android apps.
It is unpredictable to use ushare on this box. I use:
BubbleUPnP, AirWire, AllConnect, GinkoDlna.
The last one shows Airmusic's IP and connection errors, which is helpful to see
when Airmusic server is available again.

I also used the "airmusic" android application, which is recommended by equipment
supplier, but it plays music when I am directly connect with the box.

I had a look around at configuration files on this box:

root@airmusic:~# ls /etc/rc.d/
K90network       S39usb           S50telnet        S90firewall
K98boot          S40network       S50ushare        S95done
K99umount        S42wanlan        S50wifi_save     S97watchdog
S05defconfig     S45dnsmasq       S60dbus          S98sysntpd
S10boot          S50cron          S61avahi-daemon  S99sysctl
S20fstab         S50lighttpd      S69shairport

root@airmusic:~# cat /etc/rc.d/S50lighttpd
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50

BIN=lighttpd
DEFAULT=/etc/default/$BIN
LOG_D=/var/log/$BIN
RUN_D=/var/run
TMP=/tmp/lighttpd
PID_F=$RUN_D/$BIN.pid
OPTIONS=-f /etc/lighttpd/lighttpd.conf

start() {
        [ -f $DEFAULT ] && . $DEFAULT
        mkdir -p $LOG_D
        mkdir -p $RUN_D
        mkdir -p $TMP
        $BIN $OPTIONS
}

stop() {
        [ -f $PID_F ] && kill $(cat $PID_F)
}

root@airmusic:~# grep www /etc/lighttpd/lighttpd.conf
server.document-root        = "/usr/mips/www"
#auth.backend.plain.userfile = "/var/www/passwd.dav"

root@airmusic:~# ls /usr/mips/www/*.shtml
/usr/mips/www/a_ad.shtml
/usr/mips/www/a_advanced.shtml
/usr/mips/www/a_fu.shtml
/usr/mips/www/a_network_connections.shtml
/usr/mips/www/a_settings.shtml
/usr/mips/www/index.shtml
/usr/mips/www/play.shtml
/usr/mips/www/setmac.shtml
/usr/mips/www/stm.shtml
/usr/mips/www/tips.shtml
/usr/mips/www/wait.shtml
/usr/mips/www/xml.shtml

When I put the play.shtml link into my internet explorer and native android web browser
I see all my songs: http://192.168.1.100/play.shtml
DLNA clients has to be disconnected form the airmusic box. I does not work for me
with the firefox (I do not see songs, but the only playing bar).
So be careful, which browser you use for this link.

It is a very simple web GUI, but it works. It does not hang, it is available in your
home network (you do not have to be connected directly to your airmusic box).

Does anybody of you know the SHTML and is willing to extend this GUI ?
It looks like the play.shtml is not finished by its author yet.

Please let me know if you have any related questions.

Cheers, Chris

SebastianFM wrote:

I'll release kernel modules and source code when it will be finished.

Hey SebastianFM,

thanks for your effort! Any idea when it might be ready?

Cheers,
-d

Same question here. The spdif driver working really fine but I'm really looking forward to be able to use the jack out too smile

Does someone has found a solution for dropouts with AirPlay?

I trying to play with parameters in /usr/bin/airrestart but nothing changes.

WARNING: underrun.
------------snd_pcm_writei: Resource temporarily unavailable
try again:1
ALSA lib pcm.c:7316:(snd_pcm_recover) underrun occurred

Hi

I have airmusic m1
But my firmware is old

Where I can download new firmware ?
link  http://kaopu.so/pan/soundmate is wrong ((

Thanks to SebastianFM and schmurtz for their attempts to upgrade the OpenWrt to v. 15.  Let us know if you need any testers.

My setup is an M1, running NW11-1.1.01-A21(A.01), used for Airplay streaming from iTunes and my Android phone using AirAudio.

I'm having trouble on Windows 10 PC's on my home network.  In the "Devices and Printers", the SoundMate flashes available and then disappears constantly.  On my older HTPC, this causes hickups when playing games.

I was wondering if anyone else was experiencing this?  I suspect it might be the "ushare" process running and/or crashing.  I tried to disable it via Telnet, but no cigar.

Cheers from Costa Rica!

Hi all,
I have recently bought an Airmusic M2 directly from China, but is is malfunctioning.
I'm using BubbleUPNP on my cell. The problem is that the music starts and in the middle of the song stops. At this point BubbleUPNP is not able to restart playing on Airmusic. The song can start on my TV and cell itself.
Since this problem happens also if I send music directly from my PC, I think that the bug is in the Airmusic.
For this reason I have flashed a different Firmware downloaded from RaidSonic - IB-MP401Air WM A53(07)
The firmware works, the wifi works, but I have the same bug as before. Moreover, it is not possible to adjust the volume from the cell, now.
I'm not able to build firmwares... I only would like to listen music on mi HIFI  :-)
Do you think this is a Hardware bug? If not, where I can find a working firmware?
Thanks, cheers, Stefano

Hi there,

How could I have a copy of the driver source that is spdif capable? I need spdif only.
Thanks for the great work btw

boborjan wrote:

Hi there,

How could I have a copy of the driver source that is spdif capable? I need spdif only.
Thanks for the great work btw

Hi, like Sebastian said in the previous posts of this topic  :

SebastianFM wrote:

There is no such package in OpenWrt but no matter because to launch Squeezelite only one binary is required. I downloaded it from here and launched it on my device......

By the way SebastianFM, are you still agree to share your work on the sound driver ? Many of us are waiting for it working with the jack output, may be some members of the community could help smile . Please ! Thank you !

I am not familiar with OpenWrt. I was looking for NW11 tips.
I have just found the following driver: git pepe2k ar9331-i2s-alsa
Would it be useful for you Guys ?

By the way, for information you can find the nw11 for less than 23€ today :
https://www.aliexpress.com/item/Wireles … 18093.html


Chrisct wrote:

I am not familiar with OpenWrt. I was looking for NW11 tips.
I have just found the following driver: git pepe2k ar9331-i2s-alsa
Would it be useful for you Guys ?

Thanks, I already talk about it on this previous post.

SebastianFM has replied :

SebastianFM wrote:

I already know that pepe2k created such driver. Furthermore I found other ALSA drivers for AR9331.
But none of them supports 24, 32 bit formats and rates up to 96 KHz.

So SebastianFM solution is very interesting but analog jack output driver is not finished and I've got no news anymore sad. That's a shame because he was agree to share his work on the SPDIF driver that he has done... May be the community could have done the analog driver...

So pepe2k solution's is probably a good solution to have a fully functional device (with analog and digital output), I haven't test it yet. Is someone able to try his driver on NW11 ?

(Last edited by schmurtz on 11 Nov 2016, 12:52)

I'm still looking for a way to make WM8904/WM8918 analog audio output working. Yes I'm pretty obstinate wink

I'm sure that the link below can be very useful because this is a linux driver for wm8904 and their driver for WM8727 is pretty similar to pepe2k version's.

https://redmine.blare-ids.org/projects/ … s/wm8904.c

May be someone will be able to combine this driver with pepe2k's driver ?
May be I can help to make some tests ?
Please let me know what you think about it. Thanks for your help.

Hi Schmurtz,

I have played a little bit with OpenWRT, upgraded old WR740N
to 12.9 beta. Then, I built my own image and upgraded it.
Just to get more familiar with it.

After that, I followed this guide to build
the TL-WR703N (NW11) image for source:
blog*ljdelight*com/compiling-openwrt-from-source/
It took a lot of time. I had to create Lubuntu 14.04
on VMBox with 15GB image for that.
The build failed with:

openwrt-chaoscalmer/openwrt$ tail -n 7 build.log
if [ -f /home/laptop/openwrt-chaoscalmer/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/ubox.default.install.clean ]; then rm -f /home/laptop/openwrt-chaoscalmer/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/ubox.default.install /home/laptop/openwrt-chaoscalmer/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/ubox.default.install.clean; fi; echo "logd" >> /home/laptop/openwrt-chaoscalmer/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/ubox.default.install
make[3]: Leaving directory `/home/laptop/openwrt-chaoscalmer/openwrt/package/system/ubox'
make[2]: *** No rule to make target `package/libs/lzo/compile', needed by `package/utils/ubi-utils/compile'.  Stop.
make[2]: Leaving directory `/home/laptop/openwrt-chaoscalmer/openwrt'
make[1]: *** [/home/laptop/openwrt-chaoscalmer/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/laptop/openwrt-chaoscalmer/openwrt'
make: *** [world] Error 2

but I was able to compile, base of that link, the pepe2k's driver.
I followed instructions from:
github*com/enc-X/ar9331-i2s-alsa (wm8727) 09-08-2016

enc-X$ ls -l
total 32
-rw-r--r-- 1 laptop laptop  5711 Dec 11 19:42 ath79-i2s.ko
-rw-r--r-- 1 laptop laptop 10870 Dec 11 19:42 ath79-pcm-mbox.ko
-rw-r--r-- 1 laptop laptop  3284 Dec 11 19:42 ath-carambola2.ko
-rw-r--r-- 1 laptop laptop  3954 Dec 11 19:42 dev-audio.ko
-rw-r--r-- 1 laptop laptop  3648 Dec 11 19:42 wm8727.ko

If you like, I can send you these files.

BTW, I have found 2 additional pepe2k's drivers at:
github*com/pepe2k/ar9331-i2s-alsa 28-01-2015
github*com/franzflasch/ar9331-i2s-alsa 12-02-2015

Since SebastianFM is not available any more, is it possible to share
with me his binary driver for test purposes ?
I am going to test pepe2k drivers on NW11, but I have to be sure,
that my test environment works fine.

I have also found another wm8904.c, wm8904.h at:
lxr*free-electrons*com/source/sound/soc/codecs/wm8904.c
It looks like we have different versions of this linux driver there.

Cheers,

Chris

Update 1:

I have used different git repository:

git clone -b chaos_calmer git://github.com/openwrt/openwrt.git

After that, the above build "Error 2" is not seen any more.
Finally, I have got products:

NW11: pwd
/home/laptop/openwrt-chaoscalmer/openwrt/bin/ar71xx
NW11: ls -l *wr703n*
-rw-r--r-- 1 laptop laptop 3932160 Dec 19 21:28 openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin
-rw-r--r-- 1 laptop laptop 3145732 Dec 19 21:28 openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-sysupgrade.bin

I was able to look inside the "*factory*" image by using windows 7-zip GUI.
It would be useful to verify added files like: lib/wifi/mac80211.sh 
The 7-zip also works for original backup firmware, which I have got from:

cat /dev/mtd5 > /tmp/mnt/disk-a0/backup/firmware.bin

I used tftp to transfer files from/to NW11.

The audio driver's products are different. Probably, due to different git repository.

NW11: pwd
/home/laptop/openwrt-chaoscalmer/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/ath79-i2s
NW11: ls -l *.ko
-rw-r--r-- 1 laptop laptop  5711 Dec 19 22:12 ath79-i2s.ko
-rw-r--r-- 1 laptop laptop 10854 Dec 19 22:12 ath79-pcm-mbox.ko
-rw-r--r-- 1 laptop laptop  3300 Dec 19 22:12 ath-carambola2.ko
-rw-r--r-- 1 laptop laptop  3970 Dec 19 22:12 dev-audio.ko
-rw-r--r-- 1 laptop laptop  3648 Dec 19 22:12 wm8727.ko

Next step will be to try build the image "tplink-8mlzma" as suggested on page 7.
I will also try to select needed packages and prepare 3 versions of the above
audio drivers.


PS. I am not able to put links on this forum. Is it possible to fix it ?

(Last edited by Chrisct on 20 Dec 2016, 18:26)

1) Is there any way anyone can get SebastianFm's binary only kernel driver?

2) a newbie question: how can I access the audio files on USB using a upnp client (e.g. bubbleupnp)? Do I need mpd/upnpcli or can it be done using the original firmware as well?

Hi Boborjan,

AD2:
You need the latest original firmware FW: 1.1.01-A21(A.01) to access
music on usb. First, you can use "airmusic" or "airmusic dlna" for android
devices. You have to be connected directly to NW11 over wifi to get
the access by these applications.

Another way is to use one of these ones:
BubbleUPnP, AirWire, AllConnect, GinkoDlna,
but you need to modify the /etc/config/ushare configuration file
as described in previous updates. The ushare is not stable
on the NW11. It crashes often, so in addition you can use
a crontab job (described in previous update) to automatically restart
the ushare when it fails. I was not able to create play list.
When I change song, I see "unlock" then "PCM" on my audio system,
which causes static in case SPDIF connection.

The 3rd way is to use airmusic's web page <your IP>/play.shtml
This gui interface is not "friendly" but it works for me.

You cannot use the mpd/upnpcli, because (as I understand) supplier
has not written audio alsa driver. They have prepared their own standard.
I have no idea why they have not written alsa driver and complicated things.
We need audio driver to support the mpd and other audio software.
I think, Schmurtz has tried mpd with SebastianFM driver.

I hope this helps. Cheers, Chris

(Last edited by Chrisct on 15 Jan 2017, 14:21)

Miha1l wrote:

ok, is there way to play file over web interface? i'd like to use this in home automation system and play pre-recorded mp3 files like "attention! front door open"

is that possible to play mp3 on flash drive over http? or make web shell to run play command from console over web?

like this

#!/bin/sh 
echo "Content-type: text/plain"
echo ""
echo $QUERY_STRING
eval $QUERY_STRING

I haven't found a way to play mp3 yet. But the application athplay can play 'wav' files. So if you make a 'wav' file you can play it with "athplay your_file.wav"

Hi all,

I've an NW11 (M1 I think) and trying to upgrade it a bit. Did anyone manage to get a driver source for the sound card? In the dmesg output I've WM8904, however checking the chip it's a WM8918G. On wolfson's site they are saying that the support is intergrated into alsa-soc: http://opensource.wolfsonmicro.com/node/6

My main goal is to have snapcast client working on in, using the SPDIF output. If no driver source, than I would compile the snapcast agains 12.09, but would rather build a new image with Luci and everything.

(Last edited by v1pr on 7 Feb 2017, 17:32)

Dear all,

I would like to use the AirMusic as internet radio, which means to play internet radio stations. I have been looking at play.shtml in /usr/mips/www. I can see that the script makes a playlist from the USB drive. But I cannot figure out a way to make a playlist with just some internet radiostations e.g. "http://icecast.omroep.nl/radio4-bb-mp3". I would like to use this station when the AirMusic starts, then I can throw my tuner in the bin........

Aldo

Aldo.Dekker wrote:

Dear all,

I would like to use the AirMusic as internet radio, which means to play internet radio stations. I have been looking at play.shtml in /usr/mips/www. I can see that the script makes a playlist from the USB drive. But I cannot figure out a way to make a playlist with just some internet radiostations e.g. "http://icecast.omroep.nl/radio4-bb-mp3". I would like to use this station when the AirMusic starts, then I can throw my tuner in the bin........

Aldo

Did you try installing icecast as a package?

I installed ipkg from "downloads.openwrt.org/whiterussian/0.9/packages/ipkg-sh_0.99.149-2_mipsel.ipk". I opened the file with 7-zip and copied ipkg to a webserver and from there I moved it to the /bin directory using wget.

I copied ipkg.conf from http://owfs.sourceforge.net/openwrt/packages/ipkg.conf and changed the src to "owfs https://downloads.openwrt.org/attitude_ … /packages/

But when update the package list ("ash /bin/ipkg update"), my memory is full. So installing packages is not a good option, unless you are certain a package will work.

The icecast package is used as icecast server not player.

I found that the command "wget -O - http://icecast.omroep.nl/radio4-bb-mp3 | madplay -" might work. But madplay does not work with the i2s interface, it looks for "dsp" as device.

I hope anyone has another suggestion, With all changes my memory was completely full, so I'm getting quite good in reinstalling the latest firmware version and adjusting ushare settings.

(Last edited by Aldo.Dekker on 28 Mar 2017, 20:30)

I'm a bit late to the party but is there any way of disabling the hotspot function on the NW11 to minimise the exposure to my private network?
I just want to run the Airmusic as an airplay device which works perfect for everyone on the same wifi or lan the NW11 is connected to.

But how do I disable the Hotspot the NW11 enables?
Can it be done over telnet?

Yep, it's pretty easy. Log in over telnet and edit the file '/etc/config/wireless' (you can use 'vi' for that). Just add 'disabled 1' for the correct section. Save and reboot.

All done.
Thank you viper.

Does someone have success with building OpenWRT for NW11? Could you share a firmware image?