Hi all,
First of all, a big thank you to Bela for getting ShairPort into the repo.
I just managed to get ShairPort installed on my piCorePlayer installation, which already has Squeezelite running on it.
By configuring ALSA to use the dmix (direct mixing) plugin, I now have both apps working without stepping on each others toes.
To test the 'worst case' scenario, I've been playing music through both apps at the same time, and it's producing the mixed output from both sources. It's been playing for a few hours now, so it's looking really promising. I will test it more over the next few days, trying different scenarios.
In any case, I've included the steps below in case anyone else finds this useful. I really hope it works flawlessly, as I'd love to have my SqueezeBox-based players also support direct streaming from Airport devices.
In my setup, I'm using a Behringer UCA202 USB DAC, but I believe these steps will work with any USB DAC, as long as it's the default ALSA device.
Cheers,
Pete
PreparationBurn the piCorePlayer image to the SD card:
https://sites.google.com/site/picoreplayer/Expand the second partition:
(refer to the 'System with pre-installed extensions' section)
http://distro.ibiblio.org/tinycorelinux/5.x/armv6/releases/READMEInstall nano:
tce-load -wi nanoShairPortInstall shairport:
tce-load -wi shairportCreate the shairport script:
sudo nano /usr/local/etc/init.d/shairportAdd the following to the shairport script:
#! /bin/sh
# /usr/local/etc/init.d/shairport
#
NAME="piCorePlayer"
case "$1" in
start)
/usr/local/bin/shairport -d -a "$NAME" -b 95
;;
stop)
killall shairport
;;
*)
echo "Usage: /usr/local/etc/init.d/shairport {start|stop}"
exit 1
;;
esac
exit 0Set the execute permissions for the shairport script:
sudo chmod a+x /usr/local/etc/init.d/shairportConfigure the boot script to run the shairport script on startup:
sudo nano /opt/bootlocal.shAdd this line to the bottom of the boot script:
/usr/local/etc/init.d/shairport startAdd the shairport script to the backup file list (to ensure it gets persisted between reboots):
sudo nano /opt/.filetool.lstAdd this line to the bottom of the backup file list:
usr/local/etc/init.d/shairportALSA MixerConfigure the mixer to ensure multiple apps can share the sound device:
sudo nano /etc/asound.confRemove or comment out the original lines in the file, and add the following:
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dsp0 {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1024 # the key must be unique
ipc_key_add_uid 0
ipc_perm 0666# permissions - octal notation
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 8192
rate 48000 #or 44100
}
}
ctl.dmixer {
type hw
card 0
}Set the volume to maximum:
sudo alsamixersudo alsactl storeSqueezeliteSet Squeezelite to use the default ALSA audio device (to ensure the ALSA mixer get used):
sudo nano /usr/local/sbin/config.cfgComment out the first line below, and add the second line:
#OUTPUT="sysdefault:CARD=ALSA"
OUTPUT="default"Save changesEnsure the changes are persisted between reboots:
sudo filetool.sh -bReboot the device:
sudo reboot