OpenWrt Forum Archive

Topic: shairport on openwrt

The content of this topic has been archived between 2 Sep 2014 and 25 Apr 2018. Unfortunately there are posts – most likely complete pages – missing.

I wish that patch was available as source -- I've spent a day getting a compilation environment up so that I could compile my own firmware, so I can't use their binary patch. I'd love to know what line or lines of code have to be tweaked to fix the USB 1.1 reset problem.

I got it to work on a TL-MR3020 with Attitude Adjustment by loosely following http://mikekazakov.blogspot.ro/2012/12/ … iver.html:
1. Use https://github.com/sm3rt/OpenWRT-ShairPort as a feed
2. Select the shairport package in menuconfig, not shairport_new
3. Change socketlib.h:27 from

int setup_server(struct addrinfo *server_address, in pPort);

to

int setup_server(struct addrinfo **server_address, int pPort);

, with the necessary changes in socketlib.c. This was to fix a segmentation fault that appeared because socket() didn't write in the provided struct. The symptom was "Error: Unable to accept connection to server socket: Bad address". Bad address in this case does not mean bad network address, but bad memory address.
4. Compile just the package and its dependencies (libopenssl, avahi-daemon, libao, libpthread), following the instructions at http://wiki.openwrt.org/doc/howtobuild/single.package
5. Install the package.
6. Enable the daemons:

/etc/init.d/dbus enable && /etc/init.d/avahi-daemon enable && /etc/init.d/shairport enable

7. Reboot/start and enjoy!

If you're running on an AR71XX you can skip steps 1-4 and download the binary I built from my Google Drive.
Patched versions of socketlib.h and socketlib.c are also available. IPv6 is disabled in those and I've left some debugging code in because I couldn't be bothered to remove it, but they work.

(Last edited by vladx2 on 19 Apr 2014, 22:14)

@vladx2, Why use the sm3rt feed, but not use it's package?

We are talking about socketlib.h and socketlib.c located in the following folder right?
build_dir/target-mips_34kc_uClibc-0.9.33.2/shairport-2012-10-20

How can we properly fix this socketlib?

Enabling those deamons could be a part of the post install of Shairport?

peteruithoven wrote:

@vladx2, Why use the sm3rt feed, but not use it's package?

We are talking about socketlib.h and socketlib.c located in the following folder right?
build_dir/target-mips_34kc_uClibc-0.9.33.2/shairport-2012-10-20

How can we properly fix this socketlib?

Enabling those deamons could be a part of the post install of Shairport?

I'm afraid it was mostly trial and error. Just posted to report what worked for me.

I used the shairport package instead of shairport_new by mistake, having tried other feeds before and not reading Sm3rt's instructions properly. To be honest, I didn't really investigate where the Sm3rt feed even pulls the code from, but it's not the latest Abrasive version as it claims in the Readme.

The fix to the socketlib is proper, not a kludge. The original version discarded the socket that the system call returned and the fix fixes that. However, the latest https://github.com/abrasive/shairport does not use socketlib.c/h anymore, so the fix is probably not needed in that.

Yes, enabling the deamons could be a part of the post install. Didn't do that since I have absolutely 0 experience with ipk's.

hi
can anyone help me please
i have TP-Link TL-WR841ND and i installed openwrt on it ,
and this device support (DBPSK, DQPSK, CCK, OFDM, 16-QAM, 64-QAM) modulation Technology
can i select one of them manually .
i want the device uses one modulation .
thank you very much

I am using ShairPort_new from
https://github.com/sm3rt/OpenWRT-ShairPort

However, I noticed that in my device, rcS process is always stuck at boot.
If I terminate airplay, i.e. ShairPort_new or disable it from start-up, rcS disappears.
If I launch airplay, i.e. ShairPort_new after boot is completed, it seems to work just fine.

Anyone experience something similar? or have any solution?

How did you manage to get that compiled? Could you please shared a compiled version?

How do we get this version into OpenWrt "properly"?

(Last edited by probono on 6 Jul 2014, 12:48)

Hi,

Am I just being stupid?? I can't seem to get this working on my 703N without going over the amount of space available? Whats the secret/easiest way to get this Shairport going ?

Thanks smile

* verify_pkg_installable: Only have 44kb available on filesystem /overlay, pkg libopenssl needs 670
* opkg_install_cmd: Cannot install package shairport.

Check out ImageBuilder with it you can create firmware really easy with shairport already included. All packages that are included are compressed so you can fit more than later by installing packages...

Thanks Valentt, I'm very new to this and will check it out smile

I got Shairport working thanks to valdx2's image. Much appreciated efforts.

Although Shairport works now, I have to restart Shairport every time a system logs disconnects. Tried turning of ipv6 in Avahi to no avail. Anyone aware of a workaround for this minor issue?

Having an really annoying poriblem with shairport on WR703N. All deamons up and running at boot (usbd, avahi and shairport). WR703N configured as a AP

/etc/config/wireless:

config wifi-device  radio0
        option type     mac80211
        option channel  11
        option hwmode   11ng
        option path     'platform/ar933x_wmac'
        option htmode   HT20
        list ht_capab   SHORT-GI-20
        list ht_capab   SHORT-GI-40
        list ht_capab   RX-STBC1
        list ht_capab   DSSS_CCK-40
        # REMOVE THIS LINE TO ENABLE WIFI:
        # option disabled 1

config wifi-iface
        option device   radio0
        option network  wan
        option mode     ap
        option ssid     vessLAN
        option encryption none


/etc/config/network:

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config interface 'lan'
        option ifname 'eth0'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'

config interface 'wan'
        option ifname 'wlan0'
        option proto 'static'
        option ipaddr '192.168.1.10'
        option netmask '255.255.255.0'

wlan0 is up and running:

root@OpenWrt:/# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:57:00:4C:D7:66
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:4

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:11579 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11579 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:949544 (927.2 KiB)  TX bytes:949544 (927.2 KiB)

wlan0     Link encap:Ethernet  HWaddr 08:57:00:4C:D7:66
          inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:304 errors:0 dropped:120 overruns:0 frame:0
          TX packets:335 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:22896 (22.3 KiB)  TX bytes:36412 (35.5 KiB)

iPhone is connected to the wlan
root@OpenWrt:/# iw dev wlan0 station dump
Station d0:23:db:b2:35:ef (on wlan0)
        inactive time:  40 ms
        rx bytes:       4148
        rx packets:     77
        tx bytes:       1583
        tx packets:     11
        tx retries:     0
        tx failed:      0
        signal:         -51 [-51] dBm
        signal avg:     -31 [-31] dBm
        tx bitrate:     1.0 MBit/s
        rx bitrate:     65.0 MBit/s MCS 7
        authorized:     yes
        authenticated:  yes
        preamble:       short
        WMM/WME:        yes
        MFP:            no
        TDLS peer:      no


Avahi has published my AirPlay server using IPv4
root@OpenWrt:/# avahi-browse -a
+  wlan0 IPv4 Web Server on OpenWrt                         _http._tcp           local
+   eth0 IPv4 Web Server on OpenWrt                         _http._tcp           local
+  wlan0 IPv4 Secure Shell on OpenWrt                       _ssh._tcp            local
+   eth0 IPv4 Secure Shell on OpenWrt                       _ssh._tcp            local
+  wlan0 IPv4 005E3D5D2921@vessLAN                          _raop._tcp           local
+   eth0 IPv4 005E3D5D2921@vessLAN                          _raop._tcp           local

The airplay server is seen on my iPhone
but, shairport is just sitting and awaiting connections
LogLevel: 7
AirName: vessLAN
HWID: 1<7hm0
HWID_Hex(12): 00313C37686D
Avahi/DNS-SD started on PID: 1747
Starting connection server: specified server port: 5002
Waiting for clients to connect
Avahi/DNS-SD Name: 00313C37686D@vessLAN
Established under name '00313C37686D@vessLAN'

on my phone it looks like im connected, AirPlay symbol turns white, but when trying to play music it thinks for a while then drops connection. I do not understand what the problem is

Solved it! Needed to bridge wifi and lan in the network configuration file

updated /etc/config/network
config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config interface 'lan'
        option ifname 'eth0'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'

updated /etc(config/wireless (just the wifi-iface part)
config wifi-iface
        option device   radio0
        option network  lan
        option mode     ap
        option ssid     vessLAN
        option encryption none

The discussion might have continued from here.