Installation of SqueezeLite on Joggler Ubuntu

General discussion relating to the O2 Joggler, from the default O2 setup, to alternative operating systems and applications.
Post Reply
User avatar
pete
Posts: 2950
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Installation of SqueezeLite on Joggler Ubuntu

Post by pete »

Decided today to turn the Openframe 7 device running Ubuntu 12.10 (and other stuff) into a headless SqueezeLite box.

I am remote controlling this box and currently testing some other software. Works great!

Code: Select all

# apt-get install git

# apt-get install build-essential libasound2-dev libflac-dev libmad0-dev libvorbis-dev libvo-aacenc-dev libfaad-dev libmpg123-dev

# cd /opt

# git clone https://code.google.com/p/squeezelite/

# cd /opt/squeezelite

# make

#./squeezelite -l
Sample Output:
Output devices:
null - Discard all samples (playback) or generate zero samples (capture)
default:CARD=SB - HDA ATI SB, ALC888 Analog - Default Audio Device
front:CARD=SB,DEV=0 - HDA ATI SB, ALC888 Analog - Front speakers
surround40:CARD=SB,DEV=0 - HDA ATI SB, ALC888 Analog - 4.0 Surround output to Front and Rear speakers
surround41:CARD=SB,DEV=0 - HDA ATI SB, ALC888 Analog - 4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=SB,DEV=0 - HDA ATI SB, ALC888 Analog - 5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=SB,DEV=0 - HDA ATI SB, ALC888 Analog - 5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=SB,DEV=0 - HDA ATI SB, ALC888 Analog - 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=SB,DEV=0 - HDA ATI SB, ALC888 Digital - IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=HDMI - HDA ATI HDMI, HDMI 0 - HDMI Audio Output
Next we edit the init file so we can start up squeezelite on boot.

Code: Select all

# nano /etc/init.d/squeezelite
Copy and paste this into /etc/init.d/squeezelite. Make sure you change the variables. USER should be the user you created when you installed Debian. OUTPUT is the device we found earlier with ./squeezelite -l. NAME can be whatever you like. LMS is the IP address of your logitech media server.

Code: Select all

#!/bin/sh
### BEGIN INIT INFO
# Provides:          squeezelite
# Required-Start:    $syslog
# Required-Stop:     $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Script to start squeezelite
# Description:       Service script for squeezelite, command line squeezebox player
### END INIT INFO
#Define some variables.  LMS is the IP of your Logitech Media Server.  Output device can be found by running squeezelite -l

USER=someuser
OUTPUT=iec958:CARD=SB,DEV=0  
NAME=SqueezelitePlayerName
LMS=192.168.x.x

case "$1" in
  start)
    echo "Starting Squeezelite"
    start-stop-daemon --start --quiet -b -m -p /var/run/squeezelite.pid --chuid $USER --exec /opt/squeezelite/squeezelite -- -z -o $OUTPUT -n $NAME $LMS
  ;;
  stop)
    echo "Stopping Squeezelite"
    start-stop-daemon --stop --quiet --pidfile /var/run/squeezelite.pid
    rm -f /var/run/squeezelite
  ;;
  *)
    echo "Usage: /etc/init.d/squeezelite {start|stop}"
    exit 1
  ;;
esac
exit 0
Next, change the init to be executable with

Code: Select all

# chmod +X /etc/init.d/squeezelite
Then start squeezelite

Code: Select all

# /etc/init.d/squeezelite start
The player should show up in your logitech media server. Give it a test play.
The last step is to add the script to boot with:

Code: Select all

# insserv squeezelite
http://forums.slimdevices.com/showthrea ... post738328
- Pete
O2 Jogglers running EFI Ubuntu / Squeezeplayer
OpenPeak Voip Telephony / Zigbee tabletops hardware modded with Seabios / RTC / Ethernet ROM edits / SSD drives running XPe for automation screens

Auto mater
castalla
Posts: 860
Joined: Wed May 29, 2013 10:33 am

Re: Installation of SqueezeLite on Joggler Ubuntu

Post by castalla »

You can get precompiled binaries here: https://code.google.com/p/squeezelite/downloads/list
User avatar
pete
Posts: 2950
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: Installation of SqueezeLite on Joggler Ubuntu

Post by pete »

Thank-you castalla

Yup; its working great.

Using a touchscreen interface running on the Openframe 7 which is controlling the headless Squeezelite; such that its a custom page on the touchscreen is just squeezebox gui page of sorts. I can also utilize the squeezelite as a TTS proxy from the mothership. I don't currently have any nice speech fonts for the XUbuntu build.
- Pete
O2 Jogglers running EFI Ubuntu / Squeezeplayer
OpenPeak Voip Telephony / Zigbee tabletops hardware modded with Seabios / RTC / Ethernet ROM edits / SSD drives running XPe for automation screens

Auto mater
User avatar
pete
Posts: 2950
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: Installation of SqueezeLite on Joggler Ubuntu

Post by pete »

castalla,

For whatever reasons I cannot get it to autostart SqueezeLite using the Upstart script above in Ubuntu 12.10.

Not sure why though. Manual command line works just fine.
pete@ICS-XUbuntu-01:~$ sudo chkconfig -add squeezelite
insserv: warning: script 'K01acpi-support' missing LSB tags and overrides
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'hwclock' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `h wclock'
insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `h wclock'
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'network-interface' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `n etwork-interface'
insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `n etwork-interface'
- Pete
O2 Jogglers running EFI Ubuntu / Squeezeplayer
OpenPeak Voip Telephony / Zigbee tabletops hardware modded with Seabios / RTC / Ethernet ROM edits / SSD drives running XPe for automation screens

Auto mater
User avatar
pete
Posts: 2950
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: Installation of SqueezeLite on Joggler Ubuntu

Post by pete »

This is an Openframe 1.0 that I am playing with.

I keep changing the output in the startup script:

Code: Select all

#!/bin/sh
### BEGIN INIT INFO
# Provides:          squeezelite
# Required-Start:    $syslog
# Required-Stop:     $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Script to start squeezelite
# Description:       Service script for squeezelite, command line squeezebox player
### END INIT INFO
#Define some variables.  LMS is the IP of your Logitech Media Server.  Output device can be found by running squeezelite -l

USER=joggler
OUTPUT=pulse  or  OUTPUT=CARD=MID
NAME=ICS-SqueezeLite
LMS=192.168.244.174

case "$1" in
  start)
    echo "Starting Squeezelite"
    start-stop-daemon --start --quiet -b -m -p /var/run/squeezelite.pid --chuid $USER --exec /opt/squeezelite/squeezelite -- -z -o $OUTPUT -n $NAME $LMS
  ;;
  stop)
    echo "Stopping Squeezelite"
    start-stop-daemon --stop --quiet --pidfile /var/run/squeezelite.pid
    rm -f /var/run/squeezelite
  ;;
  *)
    echo "Usage: /etc/init.d/squeezelite {start|stop}"
    exit 1
  ;;
esac
exit 0

Code: Select all

joggler@ICS-XUbuntu-01:/opt/squeezelite$ sudo squeezelite -l
xcb_connection_has_error() returned true
Home directory /home/joggler not ours.
Output devices:
  null                           - Discard all samples (playback) or generate zero samples (capture)
  pulse                          - PulseAudio Sound Server
  default:CARD=MID               - HDA Intel MID, STAC92xx Analog - Default Audio Device
  sysdefault:CARD=MID            - HDA Intel MID, STAC92xx Analog - Default Audio Device
  front:CARD=MID,DEV=0           - HDA Intel MID, STAC92xx Analog - Front speakers
  surround40:CARD=MID,DEV=0      - HDA Intel MID, STAC92xx Analog - 4.0 Surround output to Front and Rear speakers
  surround41:CARD=MID,DEV=0      - HDA Intel MID, STAC92xx Analog - 4.1 Surround output to Front, Rear and Subwoofer speakers
  surround50:CARD=MID,DEV=0      - HDA Intel MID, STAC92xx Analog - 5.0 Surround output to Front, Center and Rear speakers
  surround51:CARD=MID,DEV=0      - HDA Intel MID, STAC92xx Analog - 5.1 Surround output to Front, Center, Rear and Subwoofer speakers
  surround71:CARD=MID,DEV=0      - HDA Intel MID, STAC92xx Analog - 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
  iec958:CARD=MID,DEV=0          - HDA Intel MID, STAC92xx Digital - IEC958 (S/PDIF) Digital Audio Output
  dmix:CARD=MID,DEV=0            - HDA Intel MID, STAC92xx Analog - Direct sample mixing device
  dmix:CARD=MID,DEV=1            - HDA Intel MID, STAC92xx Digital - Direct sample mixing device
  dsnoop:CARD=MID,DEV=0          - HDA Intel MID, STAC92xx Analog - Direct sample snooping device
  dsnoop:CARD=MID,DEV=1          - HDA Intel MID, STAC92xx Digital - Direct sample snooping device
  hw:CARD=MID,DEV=0              - HDA Intel MID, STAC92xx Analog - Direct hardware device without any conversions
  hw:CARD=MID,DEV=1              - HDA Intel MID, STAC92xx Digital - Direct hardware device without any conversions
  plughw:CARD=MID,DEV=0          - HDA Intel MID, STAC92xx Analog - Hardware device with all software conversions
  plughw:CARD=MID,DEV=1          - HDA Intel MID, STAC92xx Digital - Hardware device with all software conversions
  default:CARD=USB               - VegaOne USB, USB Audio - Default Audio Device
  sysdefault:CARD=USB            - VegaOne USB, USB Audio - Default Audio Device
  front:CARD=USB,DEV=0           - VegaOne USB, USB Audio - Front speakers
  surround40:CARD=USB,DEV=0      - VegaOne USB, USB Audio - 4.0 Surround output to Front and Rear speakers
  surround41:CARD=USB,DEV=0      - VegaOne USB, USB Audio - 4.1 Surround output to Front, Rear and Subwoofer speakers
  surround50:CARD=USB,DEV=0      - VegaOne USB, USB Audio - 5.0 Surround output to Front, Center and Rear speakers
  surround51:CARD=USB,DEV=0      - VegaOne USB, USB Audio - 5.1 Surround output to Front, Center, Rear and Subwoofer speakers
  surround71:CARD=USB,DEV=0      - VegaOne USB, USB Audio - 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
  iec958:CARD=USB,DEV=0          - VegaOne USB, USB Audio - IEC958 (S/PDIF) Digital Audio Output
  dmix:CARD=USB,DEV=0            - VegaOne USB, USB Audio - Direct sample mixing device
  dsnoop:CARD=USB,DEV=0          - VegaOne USB, USB Audio - Direct sample snooping device
  hw:CARD=USB,DEV=0              - VegaOne USB, USB Audio - Direct hardware device without any conversions
  plughw:CARD=USB,DEV=0          - VegaOne USB, USB Audio - Hardware device with all software conversions
- Pete
O2 Jogglers running EFI Ubuntu / Squeezeplayer
OpenPeak Voip Telephony / Zigbee tabletops hardware modded with Seabios / RTC / Ethernet ROM edits / SSD drives running XPe for automation screens

Auto mater
castalla
Posts: 860
Joined: Wed May 29, 2013 10:33 am

Re: Installation of SqueezeLite on Joggler Ubuntu

Post by castalla »

Sorry! I'm the last person to advise on startup scripts!

There's a startup script here ( http://www.gerrelt.nl/RaspberryPi/squeezelitehf.sh ) but it's for debian on the raspberry pi - maybe you could modify it for your ubuntu?
User avatar
pete
Posts: 2950
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: Installation of SqueezeLite on Joggler Ubuntu

Post by pete »

Thank you castalla!

Yup; will have a look. I am so amazed right now that SqueezeLite is so tiny. I'm wondering if its just a timing thing.

I hand wrote a startup thing and while its not as nice with the PID and all; it does work on startup...very primitive though ....basically just taking the exec line and putting it in upstart...
- Pete
O2 Jogglers running EFI Ubuntu / Squeezeplayer
OpenPeak Voip Telephony / Zigbee tabletops hardware modded with Seabios / RTC / Ethernet ROM edits / SSD drives running XPe for automation screens

Auto mater
Post Reply