diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..2bf5c09 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +squeezelite (1.3.1-1) unstable; urgency=low + + * Initial release (Closes: #729885) + + -- Chris Boot Mon, 18 Nov 2013 15:44:55 +0000 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..a803fa8 --- /dev/null +++ b/debian/control @@ -0,0 +1,26 @@ +Source: squeezelite +Section: sound +Priority: extra +Maintainer: Chris Boot +Build-Depends: debhelper (>= 9~), libasound2-dev, libflac-dev, libmad0-dev, + libvorbis-dev, libfaad-dev, libmpg123-dev, libsoxr-dev, libavformat-dev +Standards-Version: 3.9.5 +Homepage: https://code.google.com/p/squeezelite/ +Vcs-Git: git://anonscm.debian.org/collab-maint/squeezelite.git +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/squeezelite.git;a=summary + +Package: squeezelite +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Lightweight headless Squeezebox emulator + Squeezelite is a small headless Squeezebox emulator. It is aimed at + supporting high quality audio including USB DAC based output at multiple + sample rates. + . + It supports decoding PCM (WAV/AIFF), FLAC, MP3, Ogg, AAC, WMA and ALAC + audio formats. It can also resample audio, which allows squeezelite to + upsample the output to the highest sample rate supported by the output + device. + . + This package is built with the resampling, ffmpeg and visualisation export + options. It uses ALSA for audio output. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..d3461b9 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,42 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: squeezelite +Upstream-Contact: Adrian Smith +Source: https://code.google.com/p/squeezelite/ + +Files: * +Copyright: 2012-2013 Adrian Smith +License: GPL-3 + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + +Files: debian/* +Copyright: 2013 Chris Boot +License: GPL-2+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..e69de29 diff --git a/debian/man/squeezelite.1 b/debian/man/squeezelite.1 new file mode 100644 index 0000000..e1d64f0 --- /dev/null +++ b/debian/man/squeezelite.1 @@ -0,0 +1,245 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" (C) Copyright 2013 Chris Boot +.\" +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH SQUEEZELITE 1 "November 24, 2013" "Debian Project" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +squeezelite \- Lightweight headless Squeezebox emulator +.SH SYNOPSIS +.B squeezelite +.RI [ options ] +.SH DESCRIPTION +.B Squeezelite +is a small headless Logitech Squeezebox emulator. It is aimed at supporting high +quality audio including USB DAC based output at multiple sample rates. +.PP +The player is controlled using, and media is streamed from, a Logitech Media +Server instance running somewhere on the local network. +.SH OPTIONS +This program supports the following options: +.TP +.B \-h +Show a summary of the available command-line options. +.TP +.B \-s [:] +Connect to the specified Logitech Media Server, otherwise uses automatic +discovery to find server on the local network. This option should only be needed +if automatic discovery does not work, or the server is not on the local network +segment (e.g. behind a router). +.TP +.B \-o +Specify the audio output device; the default value is +.IR default . +Use the +.B \-l +option to list available output devices. +.TP +.B \-l +List available audio output devices to stdout and exit. These device names can +be passed to the +.B \-o +option in order to select a particular device or configuration to use for audio +playback. +.TP +.B \-a :

:: +Specify ALSA parameters used when opening an audio output device. +.B +is the buffer time in milliseconds (values less than 500) or size in bytes (default +.IR 40 ms); +.B

+is the period count (values less than 50) or size in bytes (default +.IR 4 " periods);" +.B +is the sample format (possible values: +.IR 16 ", " 24 ", " 24_3 " or " 32 ); +.B +is whether to use mmap (possible values: +.IR 0 " or " 1 ). +.TP +.B \-b : +Specify internal stream and output buffer sizes in kilobytes. +.TP +.B \-c ,... +Restrict codecs to those specified, otherwise load all available codecs; known codecs: +.IR flac ", " pcm ", " mp3 ", " ogg ", " aac ", " wma ", " alac . +.IR mad " or " mpg +can be supplied instead of +.I mp3 +to use a specific decoder library. +.TP +.B \-d = +Set logging level. Categories are: +.IR all ", " slimproto ", " stream ", " decode " or " output . +Levels can be: +.IR info ", " debug " or " sdebug . +The option can be repeated to set different log levels for different categories. +.TP +.B \-f +Send logging output to a log file instead of standard output or standard error. +.TP +.B \-m +Override the player's MAC address. The format must be colon-delimited +hexadecimal, for example: ab:cd:ef:12:34:56. This is usually automatically +detected, and should not need to be provided in most circumstances. +.TP +.B \-n +Set the player name. This name is used by the Logitech Media Server to refer to +the player by name. +.TP +.B \-p +Set real time priority of output thread (1-99; default +.IR 45 ). +.TP +.B \-r +Maximum sample rate for the output device; this is required if the ALSA output +device is switched off when squeezelite is started. +.TP +.B \-u [params] +Enable upsampling of played audio. The argument is optional; see +.B RESAMPLING +(below) for more information. +.TP +.B \-v +Enable visualiser support. This creates a shared memory segment that contains +some of the audio being played, so that an external visualiser can read and +process this to create visualisations. +.TP +.B \-z +Cause \fBsqueezelite\fR to run as a daemon. That is, it detaches itself from the +terminal and runs in the background. +.TP +.B \-t +Display version and license information. +.SH RESAMPLING +Audio can be resampled or upsampled before being sent to the output device. This +can be enabled simply by passing the \fB\-u\fR option to \fBsqueezelite\fR, but +further configuration can be given as an argument to the option. +.PP +Resampling is performed using the SoX Resampler library; the documentation for +that library and the SoX \fIrate\fR effect many be helpful when configuring +upsampling for \fBsqueezelite\fR. +.PP +The format of the argument is +.B :::::: +.SS recipe +This part of the argument string is made up of a number of single-character +flags: \fB[v|h|m|l|q][L|I|M][s][X]\fR. The default value is \fBhL\fR. +.TP +.IR v ", " h ", " m ", " l " or " q +are mutually exclusive and correspond to very high, high, medium, low or quick +quality. +.TP +.IR L ", " I " or " M +correspond to linear, intermediate or minimum phase. +.TP +.IR s +changes resampling bandwidth from the default 95% (based on the 3dB point) to +99%. +.TP +.IR X +resamples to the maximum sample rate for the output device ("asynchronous" +resampling). +.TP +.B Examples +.B \-u vLs +would use very high quality setting, linear phase filter and steep cut-off. +.br +.B \-u hM +would specify high quality, with the minimum phase filter. +.br +.B \-u hMX +would specify high quality, with the minimum phase filter and async upsampling +to max device rate. +.SS flags +The second optional argument to \fB\-u\fR allows the user to specify the +following arguments (taken from the \fIsoxr.h\fR header file), in hex: +.sp +#define SOXR_ROLLOFF_SMALL 0u /* <= 0.01 dB */ +.br +#define SOXR_ROLLOFF_MEDIUM 1u /* <= 0.35 dB */ +.br +#define SOXR_ROLLOFF_NONE 2u /* For Chebyshev bandwidth. */ +.sp +#define SOXR_MAINTAIN_3DB_PT 4u /* Reserved for internal use. */ +.br +#define SOXR_HI_PREC_CLOCK 8u /* Increase 'irrational' ratio accuracy. */ +.br +#define SOXR_DOUBLE_PRECISION 16u /* Use D.P. calcs even if precision <= 20. */ +.br +#define SOXR_VR 32u /* Experimental, variable-rate resampling. */ +.TP +.B Examples +.B \-u :2 +would specify \fBSOXR_ROLLOFF_NONE\fR. +.sp +\fBNB:\fR In the example above the first option, \fB\fR, has not been +specified so would default to \fBhL\fR. Therefore, specifying \fB\-u :2\fR is +equivalent to having specified \fB\-u hL:2\fR. +.SS attenuation +Internally, data is passed to the SoX resample process as 32 bit integers and +output from the SoX resample process as 32 bit integers. Why does this matter? +There is the possibility that integer samples, once resampled may be clipped +(i.e. exceed the maximum value). By default, if you do not specify an +\fBattenuation\fR value, it will default to \-1db. A value of \fI0\fR on the +command line, i.e. \fB-u ::0\fR will disable the default \-1db attenuation being +applied. +.sp +\fBNB:\fR Clipped samples will be logged. Keep an eye on the log file. +.TP +.B Examples +.B \-u ::6 +specifies to apply \-6db (ie. halve the volume) prior to the resampling process. +.SS precision +The internal 'bit' precision used in the re-sampling calculations (ie. quality). +.sp +\fBNB:\fR HQ = 20, VHQ = 28. +.TP +.B Examples +.B \-u :::28 +specifies 28-bit precision. +.SS passband_end +A percentage value between 0 and 100, where 100 is the Nyquist frequency. The +default if not explicitly set is \fI91.3\fR. +.TP +.B Examples +.B \-u ::::98 +specifies passband ends at 98 percent of the Nyquist frequency. +.SS stopband_start +A percentage value between 0 and 100, where 100 is the Nyquist frequency. The +default if not explicitly set is \fI100\fR. +.TP +.B Examples +.B \-u :::::100 +specifies that the stopband starts at the Nyquist frequency. +.SS phase_response +A value between 0-100, where \fI0\fR is equivalent to the recipe \fIM\fR flag +for minimum phase, \fI25\fR is equivalent to the recipe \fII\fR flag for +intermediate phase and \fI50\fR is equivalent to the recipe \fIL\fR flag for +linear phase. +.TP +.B Examples +.B \-u ::::::50 +specifies linear phase. +.SH SEE ALSO +https://code.google.com/p/squeezelite/ +.br +http://www.communitysqueeze.org/squeezelite_about.jsp +.br +http://www.communitysqueeze.org/squeezelite_upsample.jsp +.br +.BR sox (1) +\- for further information about resampling diff --git a/debian/patches/Makefile-tweaks.patch b/debian/patches/Makefile-tweaks.patch new file mode 100644 index 0000000..024336e --- /dev/null +++ b/debian/patches/Makefile-tweaks.patch @@ -0,0 +1,28 @@ +Description: Makefile tweaks for hardening build options + This patch changes the Makefile to add options to CFLAGS and LDFLAGS instead of + overriding the values from the environment, and ensures that CPPFLAGS is also + used when building C source. +Author: Chris Boot +Forwarded: not-needed +Last-Update: 2013-11-24 + +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + # Cross compile support - create a Makefile which defines these three variables and then includes this Makefile... +-CFLAGS ?= -Wall -fPIC -O2 $(OPTS) +-LDFLAGS ?= -lasound -lpthread -lm -lrt ++CFLAGS += -Wall -fPIC $(OPTS) ++LDFLAGS += -lasound -lpthread -lm -lrt + EXECUTABLE ?= squeezelite + + SOURCES = main.c slimproto.c utils.c output.c buffer.c stream.c decode.c process.c resample.c flac.c pcm.c mad.c vorbis.c faad.c mpg.c ffmpeg.c +@@ -33,7 +33,7 @@ + $(OBJECTS): $(DEPS) + + .c.o: +- $(CC) $(CFLAGS) $< -c -o $@ ++ $(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@ + + clean: + rm -f $(OBJECTS) $(EXECUTABLE) diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..4662bc6 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +Makefile-tweaks.patch diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..943ed77 --- /dev/null +++ b/debian/rules @@ -0,0 +1,12 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# Enable ffmpeg, soxr resampling, visualisation export and disable dlopening +# libraries +export OPTS=-DFFMPEG -DRESAMPLE -DVISEXPORT -DLINKALL + +%: + dh $@ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/squeezelite.default b/debian/squeezelite.default new file mode 100644 index 0000000..79fc64d --- /dev/null +++ b/debian/squeezelite.default @@ -0,0 +1,19 @@ +# Defaults for squeezelite initscript +# sourced by /etc/init.d/squeezelite +# installed at /etc/default/squeezelite by the maintainer scripts + +# The name for the squeezelite player: +SL_NAME="$(hostname -s)" + +# ALSA output device: +#SL_SOUNDCARD="default:CARD=Set" + +# Squeezebox server (Logitech Media Server): +# Uncomment the next line if you want to point squeezelite at the IP address of +# your squeezebox server. This is usually unnecessary as the server is +# automatically discovered. +#SB_SERVER_IP="192.168.x.y" + +# Additional options to pass to squeezelite: +# Please do not include -z to make squeezelite daemonise itself. +#SB_EXTRA_ARGS="" diff --git a/debian/squeezelite.init b/debian/squeezelite.init new file mode 100644 index 0000000..29a454c --- /dev/null +++ b/debian/squeezelite.init @@ -0,0 +1,128 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: squeezelite +# Required-Start: $network $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Lightweight headless Squeezebox emulator +# Description: Lightweight headless streaming audio player for Logitech's +# Squeezebox audio server +### END INIT INFO + +# Author: Chris Boot + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="Squeezebox client" +NAME=squeezelite +DAEMON=/usr/bin/$NAME +PIDFILE=/run/$NAME.pid +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Read configuration variable file if it is present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + DAEMON_ARGS="" + + # add squeezelite name if set + if [ -n "$SL_NAME" ]; then + DAEMON_ARGS="${DAEMON_ARGS} -n ${SL_NAME}" + fi + + # add souncard setting if set + if [ -n "$SL_SOUNDCARD" ]; then + DAEMON_ARGS="${DAEMON_ARGS} -o ${SL_SOUNDCARD}" + fi + + # add squeezebox server ip address if set + if [ -n "$SB_SERVER_IP" ]; then + DAEMON_ARGS="${DAEMON_ARGS} -s ${SB_SERVER_IP}" + fi + + # add any other options given by the user + if [ -n "$SB_EXTRA_ARGS" ]; then + DAEMON_ARGS="${DAEMON_ARGS} ${SB_EXTRA_ARGS}" + fi + + # Return + # 0 if daemon has been started + # 1 if daemon was already running + # 2 if daemon could not be started + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \ + --test > /dev/null || return 1 + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \ + --background --make-pidfile -- $DAEMON_ARGS || return 2 +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \ + --pidfile $PIDFILE --name $NAME +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start; RET=$? + case $RET in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0; exit 0 ;; + *) [ "$VERBOSE" != no ] && log_end_msg 1; exit 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop; RET=$? + case $RET in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0; exit 0 ;; + *) [ "$VERBOSE" != no ] && log_end_msg 1; exit 1 ;; + esac + ;; + status) + status_of_proc "$DAEMON" "$NAME" + ;; + restart|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop; RET=$? + case $RET in + 0|1) + do_start; RET=$? + case $RET in + 0) log_end_msg 0; exit 0 ;; + 1) log_end_msg 1; exit 1 ;; # Old process is still running + *) log_end_msg 1; exit 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1; exit 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 + exit 3 + ;; +esac + diff --git a/debian/squeezelite.install b/debian/squeezelite.install new file mode 100644 index 0000000..23f3600 --- /dev/null +++ b/debian/squeezelite.install @@ -0,0 +1 @@ +squeezelite /usr/bin diff --git a/debian/squeezelite.lintian-overrides b/debian/squeezelite.lintian-overrides new file mode 100644 index 0000000..706a6ac --- /dev/null +++ b/debian/squeezelite.lintian-overrides @@ -0,0 +1,4 @@ + +# There is no upstream changelog shipped with the package +squeezelite binary: no-upstream-changelog + diff --git a/debian/squeezelite.manpages b/debian/squeezelite.manpages new file mode 100644 index 0000000..7df1fb2 --- /dev/null +++ b/debian/squeezelite.manpages @@ -0,0 +1 @@ +debian/man/squeezelite.1 diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..e227c7b --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://qa.debian.org/cgi-bin/fakeupstream.cgi?upstream=vcs/git/google/squeezelite .*/v(.*)\.tar.gz