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.

Thanks SebastianFM for all these inflammations !

SebastianFM wrote:

You need to remove 'option disabled 1' from lib/wifi/mac80211.sh.
Optionally, after flashing OpenWrt you can connect using serial cable and type in terminal:
uci delete wireless.@wifi-device[0].disabled
uci commit wireless
wifi

Understood. May be it's better to enable it by default. But what happens when wifi is enabled ? Is there a default SSID generated ?

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.

I'm now really looking forward to test your version wink

as this device has no ethernet it would be good to include emergency access daemon https://wiki.openwrt.org/doc/howto/ead in the default build-then it would be working similar as the original firmware-when network settings are screwed then it falls back to default. then you don't have to take it apart to connect the serial cable.

I forgot about something. I added block mount to my firmware to extend storage space. So all the changes in fs are stored on USB flash drive and can be restored easily.

kuku wrote:

as this device has no ethernet it would be good to include emergency access daemon https://wiki.openwrt.org/doc/howto/ead in the default build-then it would be working similar as the original firmware-when network settings are screwed then it falls back to default. then you don't have to take it apart to connect the serial cable.

Great, kuku, thanks.
SebastianFM it can be a good solution to avoid to use a serial cable, isn't it ?

SebastianFM wrote:

I forgot about something. I added block mount to my firmware to extend storage space. So all the changes in fs are stored on USB flash drive and can be restored easily.

It allow to install packages on the USB key with opkg ?
It seems great.

(Last edited by schmurtz on 19 May 2016, 15:37)

Did you read EAD howto? It allows to run commands on device connected over ethernet. So not useful in case of wrong Wi-Fi settings.

schmurtz, if you want to test OpenWrt on your device you will need to use ImageBuilder, command: make image PROFILE=TLWR703 PACKAGES="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". It will create default firmware with added block mount and USB storage support. ImageBuilder allows you to add/replace files, so by adding to command FILES=... you can replace lib/wifi/mac80211.sh.
When you'll have firmware with added block mount and enabled Wi-Fi:
1. Backup all device's partitions.
2. Flash new firmware.
3. Connect to it, SSID: OpenWrt.
4. Open device's configuration page.
5. Enable and configure block mount. You'll find there instructions how to prepare storage.
6. Reboot device.
Please ensure that block mount is enabled before you'll start to modifying device's configuration or fs.

(Last edited by SebastianFM on 19 May 2016, 20:41)

Hi, yesterday I've tried 3 things... and it was 3 fails hmm

  • I've soldered an ethernet port. Pretty easy with the help of the post from ircama. I tried with the firmware  IB-MP401 (which contains a visible interface ethernet whith "ifconfig") and with 1.0.08-A32(A.01) but my ethernet never works hmm

  • As I read that some firmware "are also offering the Linux ALSA driver" I tried the squeezelite bin file on different firmwares without success : I always have the same message : "can't load library 'libasound.so.2'" .  If someone know which firmware offer ALSA driver I'm interested !

  • I tried to compile a new firmware with SebastianFM's command line : failed. I think that my old ubuntu 12 32 bits is too old to compile a new openwrt firmware.

To conclude : I will install a new ubuntu to compile a new OpenWRT firmware, I will try my ethernet port again with this new firmware (can be useful to debug if I make error on my wifi configuration and it may be interesting to have better connection for streaming synchronization).

By the way :

SebastianFM wrote:

1. Backup all device's partitions.


In two word what is the right way to do that ? This wayOr this way ? Sorry for this question, I'm a real beginner to backup OpenWRT firmware... I'm able to backup and flash the Winbond memory with USBASP but I have to remove the chip first..not very easy wink

(Last edited by schmurtz on 20 May 2016, 14:51)

SebastianFM wrote:

schmurtz, if you want to test OpenWrt on your device you will need to use ImageBuilder, command: make image.... It will create default firmware with added block mount and USB storage support. ImageBuilder allows you to add/replace files, so by adding to command FILES=... you can replace lib/wifi/mac80211.sh.
When you'll have firmware with added block mount and enabled Wi-Fi:

OK I've done it. I used ImageBuilder from this url : https://downloads.openwrt.org/chaos_cal … x/generic/
My firmware is named : "openwrt-15.05.1-ar71xx-generic-root.squashfs". The file size is 2.8 MB instead of 8.1 MB for original firmware. This difference of file size is normal ?

SebastianFM wrote:

1. Backup all device's partitions.

I've got boot.backup and art, firmware, kernel, rootfs, rootfs_data, u-boot on my hard drive. Is it OK ?

SebastianFM wrote:

2. Flash new firmware.

I have to use USB key with $$update$$ file to do that or a command line MTD ?

Thanks.

(Last edited by schmurtz on 21 May 2016, 02:04)

schmurtz wrote:
SebastianFM wrote:

schmurtz, if you want to test OpenWrt on your device you will need to use ImageBuilder, command: make image.... It will create default firmware with added block mount and USB storage support. ImageBuilder allows you to add/replace files, so by adding to command FILES=... you can replace lib/wifi/mac80211.sh.
When you'll have firmware with added block mount and enabled Wi-Fi:

OK I've done it. I used ImageBuilder from this url : https://downloads.openwrt.org/chaos_cal … x/generic/
My firmware is named : "openwrt-15.05.1-ar71xx-generic-root.squashfs". The file size is 2.8 MB instead of 8.1 MB for original firmware. This difference of file size is normal ?

The final firmare file built by IB is openwrt-15.05.1-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin.

schmurtz wrote:
SebastianFM wrote:

1. Backup all device's partitions.

I've got boot.backup and art, firmware, kernel, rootfs, rootfs_data, u-boot on my hard drive. Is it OK ?

Yep.

schmurtz wrote:
SebastianFM wrote:

2. Flash new firmware.

I have to use USB key with $$update$$ file to do that or a command line MTD ?

Thanks.

You'll need to flash it manually.
mtd -r write openwrt-15.05.1-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin firmware

Hi,
The bin file is not generated, I've got this message :

[mktplinkfw] kernel length aligned to 1176540
[mktplinkfw] *** error: images are too big

There is probably too much packages. If I remove some packages it's OK.
Which one you recommand to remove ?

Edit : no, finally I think this is because TLWR703 has 4MB of flash memory and not 8MB as the M2. At that time I don't find how to customize this size...

(Last edited by schmurtz on 22 May 2016, 00:06)

At that time I'm trying to modify TLWR703's profile to increase the firmware size up to 8MB.
I read this topic but I'm not really sure that it is the right way to do that.

Hi guys, I am following this topic with much interest. In particular installing a new OpenWrt image onto the device.
Being quite new into OpenWrt development, I am looking into the Image Generator now.

BTW, FYI: I have a Soundmate M1 and I'm running version 1.0.02. I tried 1.1.01, it booted and I could get to the web interface and telnet when connected directly to it, but it would not connect to my home WiFi. Even with manual configuration of the /etc/config/network and /etc/config/wireless files. So I reverted back to 1.0.02 (I did not try other versions as I could not find these at the time).

schmurtz wrote:

At that time I'm trying to modify TLWR703's profile to increase the firmware size up to 8MB.
I read this topic but I'm not really sure that it is the right way to do that.

Found different way to make the image - just disable ppp and ppp-mod-pppoe and then it  makes the image

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" FILES="files"

or add this and make image for target TLWR703-8M:

vi target/linux/ar71xx/image/Makefile


line 463

define Device/tl-wr703n-v1
    $(Device/tplink-8mlzma)
    BOARDNAME := TL-WR703N
    DEVICE_PROFILE := TLWR703-8M
    TPLINK_HWID := 0x07030101
    CONSOLE := ttyATH0,115200
endef

vi target/linux/ar71xx/generic/profiles/tp-link.mk 

line 128

define Profile/TLWR703-8M
    NAME:=TP-LINK TL-WR703N
    PACKAGES:=kmod-usb-core kmod-usb2
endef


define Profile/TLWR703-8M/Description
    Package set optimized for the TP-LINK TL-WR703N.
endef
$(eval $(call Profile,TLWR703-8M))

(Last edited by kuku on 22 May 2016, 22:47)

f.d.roscamabbing wrote:

BTW, FYI: I have a Soundmate M1 and I'm running version 1.0.02. I tried 1.1.01, it booted and I could get to the web interface and telnet when connected directly to it, but it would not connect to my home WiFi. Even with manual configuration of the /etc/config/network and /etc/config/wireless files. So I reverted back to 1.0.02 (I did not try other versions as I could not find these at the time).

Why can't you connect to the network ?
Maybe try different browser - my firefox doesn't display the password dialog on computer and on android - I have to put the password in android default browser - then it works

kuku wrote:
schmurtz wrote:

At that time I'm trying to modify TLWR703's profile to increase the firmware size up to 8MB.
I read this topic but I'm not really sure that it is the right way to do that.

Found different way to make the image - just disable ppp and ppp-mod-pppoe and then it  makes the image

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" FILES="files"

or add this and make image for target TLWR703-8M:

vi target/linux/ar71xx/image/Makefile
...

Thank you for that, I have already flashed my device and I don't have any wifi SSID network anymore hmm
I'm waiting for my serial cable now...

I had already modified "target/linux/ar71xx/image/Makefile" when I read your post. I think that I've done is pretty similar : (I've only replace tplink-4mlzma  by tplink-8mlzma)

define Device/tl-wr703n-v1
    $(Device/tplink-8mlzma)
    BOARDNAME := TL-WR703N
    DEVICE_PROFILE := TLWR703
    TPLINK_HWID := 0x07030101
    CONSOLE := ttyATH0,115200
endef

I don't specify "FILES="files" at the end of my command line because I read that this folder is included automatically if it is present... But may be I'm wrong.

(Last edited by schmurtz on 23 May 2016, 00:50)

OK, I used an arduino without chip as FTDI and I enable again the wifi. So it's working now. Thanks again SebastianFM.

2 questions :

  • Edit : OK, block-mount is configured wink
    I'm gonna configure block-mount now. Which tutorial do you recommand ?
    You said "You'll find there instructions how to prepare storage." , is there a missing url link ?

  • When I want to revert back changes to FS, I have just to unplug the USB key to get back on the non modified Openwrt firmware ?

  • I don't make any sound test at that time but I suppose that I have to include your driver before earing any sound ? smile

So I'm waiting for informations about SebastianFM's driver smile

Thanks.

(Last edited by schmurtz on 23 May 2016, 17:53)

schmurtz wrote:

OK, I used an arduino without chip as FTDI and I enable again the wifi. So it's working now. Thanks again SebastianFM.

2 questions :

  • Edit : OK, block-mount is configured wink
    I'm gonna configure block-mount now. Which tutorial do you recommand ?
    You said "You'll find there instructions how to prepare storage." , is there a missing url link ?

  • When I want to revert back changes to FS, I have just to unplug the USB key to get back on the non modified Openwrt firmware ?

  • I don't make any sound test at that time but I suppose that I have to include your driver before earing any sound ? smile

So I'm waiting for informations about SebastianFM's driver smile

Thanks.

After enabling block mount all the changes in FS are stored on the USB flash drive so to revert them you must just copy once again unmodified files from rootfs to USB flash drive.
I need your e-mail address. I'll send you compiled kernel modules for OpenWrt 15.05.1.

kuku wrote:

Why can't you connect to the network ?
...

A different browser may work (tried Firefox and Edge), but even with the configuration manually modified using Telnet it didn't work. Anyway, I'm not so interested in getting this version to work, much more in getting a new OpenWrt to work.

I looked into the details of my device. For audio it uses a module called "ar7240_i2s" (like all others probably). This is not standard in the OpenWrt tree, but I do find the aforementioned Domino.Io module, based on the same SoC, uses a module by this name. It seems tailored to the Wolfson WM8978 DAC, not the WM8918 DAC. They do not seem 100% compatible, although the code could be a base for a WM8918 tailored driver.

Source can be found here: https://github.com/domino-team/domino-f … /domino-pi

SebastianFM wrote:

I need your e-mail address. I'll send you compiled kernel modules for OpenWrt 15.05.1.

Here's my mail

(Last edited by schmurtz on 24 May 2016, 08:37)

Hello,
I've got squeezelite that working fine on my spdif output. That's really great ! Gapless and responsive smile

Now I want to use it with a little portable speaker so the jack output is useful for me  sometime. For the jack analogic output, SebastianFM, does it require to install a generic driver or a new version of your driver ?


I also try to have a good UPNP audio renderer so I read (and try) a lot of things about that. (Resolved, see edit below) Gmediarender  is not easy to make it works and seems to require a lot of dependence packages. So I think that upmpdcli is probably the best way to make it work.  I have the following packages : upmpdcli and mpd-mini.
The 2 daemons seem to be OK :

 1285 root     18716 S <  /usr/bin/mpd --no-daemon /etc/mpd.conf
 1333 upmpdcli 20556 S    /usr/bin/upmpdcli -i br-lan

But I can't see any new upnp renderer on my network.... Does it need another package ? Or may be I have to modify the command line to make it work correctly ?

edit : I tried an mpd client and it's working. So the problem comes from upmpdcli, I don't know why it doesn't expose an new rednderer on my network...
edit2 : Finally everything is working correctly  : it was a problem from my network hmm
If my M2 and my upnp controller are on the same wifi AP I can't see upmpdcli 's renderer but it's OK if I connect my upnp controller (with my iPhone and Allcast for example).

(Last edited by schmurtz on 29 May 2016, 12:13)

@schmurz
This means you have got audio working isn't it? How did you do this? Or did SebastianFM make a driver for that?

Currently my driver supports only S/PDIF output but I decided that I'll try to add support for analog output. I'll release kernel modules and source code when it will be finished. If you want to test it just send me e-mail.

f.d.roscamabbing wrote:

@schmurz
This means you have got audio working isn't it? How did you do this? Or did SebastianFM make a driver for that?

Yes, it working on S/PDIF output only. But it's working fine smile I look forward the analog ouput because I want to use it easily as a portable squeezebox too and may be I will buy a second one to transform my old speaker into squeezebox player too smile

All I have made is following SebastianFM's explanations about firmware building (see previous posts) and include his drivers inside.

I'd be interested to test it once it works. I cannot see your email address in your profie, so could you send me a mail? Address is my username @gmail.com.

Hi,

I'm working with my airmusic and SebastianFM's driver since few weeks now. It seems to be a very stable driver.
I'm only working with optical output I'm still waiting for a new version from SebastianFM wich will support analog-jack output. SebastianFM, if you read this... wink


Some news and some questions :

  • 1 - Upmpdcli is really a good stuff, thanks for that discover !
    I asked for an update of Upmpdcli, that's done on the trunk version of OpenWRT with the last version of UPNPDCLI (1.1.3) and libupnpp (0.14.1). You can have all the new functionalities including webradios. Webradios needs python which take a lot of space, you'll need block-mount if you really want to use this functionality. I tried SebastianFM driver on the dev branch (trunk) of OpenWRT but it is not compatible with kernel 4.1.23. So it was a little complicated but I've copied updated files for upnpdcli and libupnp from the trunk version and imported them in the current stable version of OpenWRT image builder and it seems OK. I think that this new version is little less stable than the old one.


  • 2 - I ask on the forum the creation of a new package for sc2mpd.
    This application is made by the same developper then upmpdcli. This can very very interesting because "the Linn Songcast protocol distributes an audio stream on a local network so that multiple hosts (Receivers) can play quasi-synchronously from a single source ( Sender)." It means you can send the sound from your computer without any lag... I'm not able to make this package and I don't have any answer from the community :'( .I'm sure it will interest someone in the near futur wink Sources are here, if someone is able to transform it into an OpenWRT package I'm very interested to try it !


  • 3 - I'm trying to use the reset button to launch a script. What I want is a wifi toggle to launch the default Wifi Access Point because for now if your wifi config is bad the only way to modify it is the serial port... not very handy.. I have took a look to the old implementation on the original firmware (I think it is hotplug2 daemon : Folder -> etc\hotplug.d\button\50-restorefactory), I also follow this guide about procd and tried to copy 50-restorefactory  into /etc/rc.button/  but without success. I think that I'm missing something but I don't know what. If someone have an idea or is able to make it work I'm also interested wink

    I also remark that if you press reset button during boot uboot tries to boot on something that not exists (including with the original firmware), it try to boot image at 9fc10000 instead Booting image at 9f020000
    ## Booting image at 9fc10000 ...
       Uncompressing Kernel Image ... Stream with EOS marker is not supportedLZMA ERROR 1 - must RESET board to recover
    cccccccccccccccccc
    Failed to execute bootcmd and switch_boot_mode, starting httpd to update firmware...
    May be it can be a way to reset wifi configuration (boot on a little image which launch a reset wifi configuration script) ?


  • 4 - I also tried to add an ethernet port on the motherboard. it seems easy if you take a look on the datasheet but may be it is necessary to add some components like HSC1616 to make it work, Look here.



I'll continue to work on it, keep you informed. smile

Is this the same device and openwrt supported?