Airplay (shairport) Cubox-i4pro

Airplay seems quite difficult to understand. Initially it does not work after boot up , but following “/etc/init.d/shairport start” shareport is “Listening for connections”. That is good so far. Either from OS 10.9.2 or IOS 7.0.6 streaming works fairly well. There is some difficulty with requesting resend packets:

WARNING: requesting resend on 141 packets (1F3F:1FCB)
WARNING: requesting resend on 1 packets (4656:4656)
WARNING: requesting resend on 1 packets (4657:4657)
WARNING: requesting resend on 1 packets (4658:4658)
WARNING: requesting resend on 1 packets (4659:4659)
WARNING: requesting resend on 1 packets (465A:465A)
WARNING: requesting resend on 137 packets (465A:46E2)
WARNING: requesting resend on 1 packets (465B:465B)
WARNING: requesting resend on 2 packets (7270:7271)
WARNING: requesting resend on 1 packets (A693:A693)
WARNING: requesting resend on 1 packets (A694:A694)
WARNING: requesting resend on 1 packets (A695:A695)
WARNING: requesting resend on 1 packets (A696:A696)
WARNING: requesting resend on 150 packets (A696:A72B)
WARNING: requesting resend on 1 packets (A697:A697)
WARNING: requesting resend on 1 packets (A698:A698)

Here is another mystery. My setup is using the AudioQuest DragonFly USB DAC. The audio from the MPD webUI is properly directed through the USB DragonFly DAC, but Airplay comes from the imxspdif optical output on the Cubox-i4pro.

Any clues… discussion would be greatly appreciated.

As far as Shairport output handling is concerned it seems just yesterday Michelangelo Guarise has updated the Volumio-WebUI. The repository is on github.com/volumio/Volumio-WebUI.

How do we update to this version?

Dear Tracer5
currently on system different than the Pi, shairport works only on first device. The update you saw on github is still not complete. What I’m implementing is a change on the init script of shairport, that will select the output accordingly to the Output selected in the webui.
The problem is that Shairport cannot start if this is changed, this happens in my opinion due to a bug in current shairport version. So I’m recompiling a new one, but this is taking a bit longer than I thought (dependencies problems)…
You can however change it manually, and start shairport after boot:

So, let’s update the init script:

rm /etc/init.d/shairport nano /etc/init.d/shairport

And paste the following code:

[code]#! /bin/sh

/etc/init.d/shairport

BEGIN INIT INFO

Provides: shairport

Required-Start: alsa-utils hostname avahi

Required-Stop: alsa-utils hostname avahi

Short-Description: shairport - Airtunes emulator!

Description: Airtunes emulator!

Default-Start: 2 3 4 5

Default-Stop: 0 1 6

END INIT INFO

NAME="$(cat /etc/hostname)"

case “$1” in
start)
/usr/local/bin/shairport -a “$NAME” -o alsa – -d “hw:2,0”
;;
stop)
killall shairport
;;
*)
echo “Usage: /etc/init.d/shairport {start|stop}”
exit 1
;;
esac

exit 0[/code]

What you have to do is change the hw:2,0 to the output you wish to use. To find out, for example, the naming of your USB DAC, just type

aplay -l

And change it accordingly. You will then see that Shairport will not be able to start properly, or worse that mpd will not start (and so the webui). In either case, just restart the services you want to start with

MPD

/etc/init.d/mpd restart

SHAIRPORT

/etc/init.d/shairport stop /etc/init.d/shairport start

Many thanks for your suggested changes to /etc/init.d/shairport. Unfortunately, any attempt to direct output to the USB DragonFly on hw:2,0 only results is white noise, no music. What is interesting is that the Airplay iPhone can control the volume of the noise from the DragonFly. Do you have any further suggestions?

root@volumio:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: imxspdif [imx-spdif], device 0: IMX SPDIF mxc-spdif-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: imxhdmisoc [imx-hdmi-soc], device 0: IMX HDMI TX mxc-hdmi-soc-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: DragonFly [AudioQuest DragonFly], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0

Hello

I’ve installed the new version 1.4 on a cubox i4.

Works fine.

But I have a problem. No sound with shairport.

On 1.2 Beta, I’ve tried your solution. It works fine. I tested with 1.4. No success.

Do you have an idea ?

Thanks

JPP

I resolve the issue in version 1.4

I open with nano the /etc/init.d/shairport

and I adds on -o alsa – -d “hw:2,0” on the line

#! /bin/sh
# /etc/init.d/shairport
#
### BEGIN INIT INFO
# Provides:          shairport
# Required-Start:    alsa-utils hostname avahi
# Required-Stop:     alsa-utils hostname avahi
# Short-Description: shairport - Airtunes emulator!
# Description:       Airtunes emulator!
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
NAME="Volumio"
 
case "$1" in
  start)
    /usr/local/bin/shairport -d -a "$NAME" -w -B "mpc stop" -o alsa -- -d "hw:2,0"
    ;;
  stop)
    killall shairport
    ;;
  *)
    echo "Usage: /etc/init.d/shairport {start|stop}"
    exit 1
    ;;
esac
 
exit 0

I verified my number port. Here 2 for my dac

So it work fantastic.

I have the same problem with PI and DragonFly. I changed shairport.conf : /usr/local/bin/shairport -d -a “Volumio” -w -B “mpc stop” -o “alsa” – -d “hw:0,0” -c “PCM”
But no change. Stil white noise from left channel.

Try changing the shairport audio output from alsa to ao in the init script:

/usr/local/bin/shairport -d -a "$NAME" -w -B "mpc stop" -o ao

This worked for me on Volumio 1.4 using a DragonFly 1.2. The chain OS X -> iTunes Airplay -> Raspberry Pi [Volumio] -> DragonFly is now as crisp as ever. I do get occasional short bursts of static (less than a second). Not sure about the reason for that…

I find this is a great usage for Volumio … I am also streaming via Shairport from i-devices to a Cubox-i2 with Volumio set to “DAC” and from there to a Yulong DA8 USB DAC. The sound is great but there are sometimes some odd scratchy noises as if it where an old vinyl record playing.

Question to the specialists: The DAC indicates 48kHz as opposed to 41kHz when using an Airport Express. Is the stream up sampled or is this the normal sampling rate for Shairport and what are those “vinyl” kind of background noises ?

Cool in any event.

Hi,

As usual with my lack of luck, nothing is working here.
Got a dragon fly dac 1.2 on my cubox-i4 pro with last volumio, and can’t get to play to airplay…

aplay -l gives the following output :

root@volumio:~# aplay -l **** List of PLAYBACK Hardware Devices **** card 0: imxspdif [imx-spdif], device 0: IMX SPDIF mxc-spdif-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: imxhdmisoc [imx-hdmi-soc], device 0: IMX HDMI TX mxc-hdmi-soc-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: DragonFly [AudioQuest DragonFly], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0

Is my dragonfly dac therefore “hw:2,0” correct ? ?

I removed the /etc/init.d/shairport and created a new one as following prior instruction earlier in the thread. Doesn’t work at all.

Actually, the airplay “device” is seen by my mac (the mac itself, and the vox player, but the mac refuses to connect to “volumio” airplay device, and vox play actually hangs and crashes when trying to switch to it.

in the meanwhile, in the ssh shell running :

oot@volumio:~# /etc/init.d/shairport stop Terminated root@volumio:~# /etc/init.d/shairport start Listening for connections. 4499 root@volumio:~# error: Timeout WARNING: exec of external start command failed read failure: Connection reset by peer error: Timeout WARNING: exec of external start command failed

I’ve tried using the following settings :

/usr/local/bin/shairport -a "$NAME" -o alsa -- -d "hw:2,0"
/usr/local/bin/shairport -d -a "$NAME" -w -B "mpc stop" -o alsa -- -d "hw:2,0"
/usr/local/bin/shairport -d -a "Volumio" -w -B "mpc stop" -o "alsa" -- -d "hw:0,0" -c "PCM" 
/usr/local/bin/shairport -d -a "$NAME" -w -B "mpc stop" -o ao

nothing works. no sound (not even noise) outputs…

Any help or advice is more than welcomed…