Here it is.
WARNING: I’ve been having some crash problems with Shairport launching from webUI and not having an ssh session open. It’s really driving me mad . I don’t have to be doing anything in SSH, I just need to have an open session for shairport to work normally.
If someone could shed some light over this, it would be awesome.
INSTRUCTIONS:
scp -r /Your/Local/Volumio/Directory/www root@your.volumio.ip:/var
ssh root@your.columio.ip
and enter password (default: volumio).
- Once you’ve done that you’ll need to run the command
aplay -l
It will give you the list of available sound cards.
Something like:
**** List of PLAYBACK Hardware Devices ****
card 0: vt1613audio [vt1613-audio], device 0: HiFi vt1613-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: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0
In my case, i want to use “card 2”. (Pay close attention to which device you want to use and its card and device number).
- Then, you’ll have to edit the shairport init file:
nano /etc/init.d/shairport
It should look like this:
#! /bin/sh
# /etc/init.d/shairport
#
NAME="your desired airplay name"
case "$1" in
start)
/usr/bin/mpc stop
/usr/local/bin/shairport -d hw:2,0 -a "$NAME"
;;
stop)
killall shairport
;;
*)
echo "Usage: /etc/init.d/shairport {start|stop}"
exit 1
;;
esac
exit 0
Notice how in the line:
/usr/local/bin/shairport -d hw:2,0 -a “$NAME”
I used the values hw:2,0 based on the results from aplay -l, using the card and device number.
Save and exit your file with ctrl + x
- Next, we need to edit the sudoers list.
WARNING: Editing this list is a great security risk if you’re running volumio from a public network, or otherwise not-home unprotected network (which i think, is not the case for the majority of users running volumio at their home).
Run:
sudo visudo
It will look something like this:
[code]#
This file MUST be edited with the ‘visudo’ command as root.
Please consider adding local content in /etc/sudoers.d/ instead of
directly modifying this file.
See the man page for details on how to write a sudoers file.
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Host alias specification
User alias specification
Cmnd alias specification
User privilege specification
root ALL=(ALL:ALL) ALL
volumio ALL=(ALL:ALL) ALL
Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
See sudoers(5) for more information on “#include” directives:
#includedir /etc/sudoers.d
[/code]
You should add the line “www-data ALL=(ALL) NOPASSWD: ALL” just below the line “volumio ALL=(ALL:ALL) ALL”.
Your sudoers list should now look like this:
[code]#
This file MUST be edited with the ‘visudo’ command as root.
Please consider adding local content in /etc/sudoers.d/ instead of
directly modifying this file.
See the man page for details on how to write a sudoers file.
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Host alias specification
User alias specification
Cmnd alias specification
User privilege specification
root ALL=(ALL:ALL) ALL
volumio ALL=(ALL:ALL) ALL
www-data ALL=(ALL) NOPASSWD: ALL
Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
See sudoers(5) for more information on “#include” directives:
#includedir /etc/sudoers.d
[/code]
You need to be very careful with this. Saving your sudoers list with any error will block the file, forcing you to recover it.
If this happens, here’s the solution:
http://askubuntu.com/questions/73864/how-to-modify-a-invalid-etc-sudoers-file-it-throws-out-an-error-and-not-allowi
Save and exit your file with “ctrl + x”, and hit “y” when asked to save changes.
That’s it! You’re done.
Just reboot the system:
reboot
Once the reboot is complete Just refresh the volumio webUI in your web browser and you should see the “airplay” tab in the top left corner (below the volumio logo).
www.zip (1.57 MB)