Codebase list squeezelite / uncommitted/main
* New upstream version 1.9.9-1414+git20221121.dbe69eb * Enable -DOPUS and add build-dep on libopus-dev and libopusfile-dev tony mancill authored 1 year, 4 months ago Debian Janitor committed 1 year, 4 months ago
16 changed file(s) with 117 addition(s) and 46 deletion(s). Raw diff Collapse all Expand all
44 EXECUTABLE ?= squeezelite
55
66 # passing one or more of these in $(OPTS) enables optional feature inclusion
7 OPT_DSD = -DDSD
8 OPT_FF = -DFFMPEG
9 OPT_ALAC = -DALAC
10 OPT_LINKALL = -DLINKALL
11 OPT_RESAMPLE= -DRESAMPLE
12 OPT_VIS = -DVISEXPORT
13 OPT_IR = -DIR
14 OPT_GPIO = -DGPIO
15 OPT_RPI = -DRPI
16 OPT_NO_FAAD = -DNO_FAAD
17 OPT_SSL = -DUSE_SSL
18 OPT_NOSSLSYM= -DNO_SSLSYM
19 OPT_OPUS = -DOPUS
20 OPT_PORTAUDIO = -DPORTAUDIO
7 OPT_DSD = -DDSD
8 OPT_FF = -DFFMPEG
9 OPT_ALAC = -DALAC
10 OPT_LINKALL = -DLINKALL
11 OPT_RESAMPLE = -DRESAMPLE
12 OPT_VIS = -DVISEXPORT
13 OPT_IR = -DIR
14 OPT_GPIO = -DGPIO
15 OPT_RPI = -DRPI
16 OPT_NO_FAAD = -DNO_FAAD
17 OPT_NO_MAD = -DNO_MAD
18 OPT_NO_MPG123 = -DNO_MPG123
19 OPT_SSL = -DUSE_SSL
20 OPT_NOSSLSYM = -DNO_SSLSYM
21 OPT_OPUS = -DOPUS
22 OPT_PORTAUDIO = -DPORTAUDIO
2123 OPT_PULSEAUDIO = -DPULSEAUDIO
2224
2325 SOURCES = \
2426 main.c slimproto.c buffer.c stream.c utils.c \
2527 output.c output_alsa.c output_pa.c output_stdout.c output_pack.c output_pulse.c decode.c \
26 flac.c pcm.c mad.c vorbis.c mpg.c
28 flac.c pcm.c vorbis.c
2729
2830 SOURCES_DSD = dsd.c dop.c dsd2pcm/dsd2pcm.c
2931 SOURCES_FF = ffmpeg.c
3638 SOURCES_FAAD = faad.c
3739 SOURCES_SSL = sslsym.c
3840 SOURCES_OPUS = opus.c
41 SOURCES_MAD = mad.c
42 SOURCES_MPG123 = mpg.c
3943
4044 LINK_LINUX = -ldl
4145 LINK_ALSA = -lasound
4448 LINK_SSL = -lssl -lcrypto
4549 LINK_ALAC = -lalac
4650
47 LINKALL = -lmad -lmpg123 -lFLAC -lvorbisfile -lvorbis -logg
51 LINKALL = -lFLAC -lvorbisfile -lvorbis -logg
4852 LINKALL_FF = -lavformat -lavcodec -lavutil
4953 LINKALL_RESAMPLE = -lsoxr
5054 LINKALL_IR = -llirc_client
5155 LINKALL_FAAD = -lfaad
5256 LINKALL_OPUS = -lopusfile -lopus
57 LINKALL_MAD = -lmad
58 LINKALL_MPG123 = -lmpg123
5359
5460 DEPS = squeezelite.h slimproto.h
5561
97103 ifneq (,$(findstring $(OPT_SSL), $(OPTS)))
98104 SOURCES += $(SOURCES_SSL)
99105 endif
106 ifeq (,$(findstring $(OPT_NO_MAD), $(OPTS)))
107 SOURCES += $(SOURCES_MAD)
108 endif
109 ifeq (,$(findstring $(OPT_NO_MPG123), $(OPTS)))
110 SOURCES += $(SOURCES_MPG123)
111 endif
100112
101113 # add optional link options
102114 ifneq (,$(findstring $(OPT_LINKALL), $(OPTS)))
118130 endif
119131 ifneq (,$(findstring $(OPT_SSL), $(OPTS)))
120132 LDADD += $(LINK_SSL)
133 endif
134 ifeq (,$(findstring $(OPT_NO_MAD), $(OPTS)))
135 LDADD += $(LINKALL_MAD)
136 endif
137 ifeq (,$(findstring $(OPT_NO_MPG123), $(OPTS)))
138 LDADD += $(LINKALL_MPG123)
121139 endif
122140 else
123141 # if not LINKALL and linux add LINK_LINUX
00 # Contributor: Carl Chave <online@chave.us>
11 # Maintainer: Ralph Irving <ralph.irving@gmail.com>
22 pkgname=squeezelite
3 pkgver=1.9.7.1273
4 pkgrel=1
3 pkgver=1.9.9.1401
4 pkgrel=0
55 pkgdesc="Lightweight headless squeezebox player for Logitech Media Server"
66 url="https://github.com/ralph-irving/squeezelite"
77 arch="all"
88 license="GPL-3.0-or-later3"
99 options="!check" # No test suite
10 depends="flac alsa-lib faad2 mpg123 libvorbis libmad soxr openssl opusfile libalac"
11 makedepends="flac-dev alsa-lib-dev faad2-dev mpg123-dev libvorbis-dev libmad-dev soxr-dev openssl-dev opusfile-dev opus-dev libalac-dev"
10 depends="flac alsa-lib faad2-libs mpg123-libs libvorbis libmad soxr openssl opusfile libalac lirc"
11 makedepends="flac-dev alsa-lib-dev faad2-dev mpg123-dev libvorbis-dev libmad-dev soxr-dev openssl-dev opusfile-dev opus-dev libalac-dev lirc-dev"
1212 install="$pkgname.pre-install"
1313 subpackages="$pkgname-doc $pkgname-openrc"
1414 source="$pkgname-$pkgver.zip::https://github.com/ralph-irving/squeezelite/archive/master.zip load-libtremor-first.patch $pkgname.confd $pkgname.initd"
1616
1717 build() {
1818 cd "$builddir"
19 make OPTS="-DRESAMPLE -DDSD -DGPIO -DVISEXPORT -DUSE_SSL -DNO_SSLSYM -DOPUS -DALAC -I/usr/include/opus -I/usr/include/alac"
19 make OPTS="-DRESAMPLE -DDSD -DGPIO -DVISEXPORT -DUSE_SSL -DNO_SSLSYM -DOPUS -DALAC -DIR -I/usr/include/opus -I/usr/include/alac"
2020 gcc -Os -fomit-frame-pointer -fcommon -s -o find_servers tools/find_servers.c
2121 gcc -Os -fomit-frame-pointer -fcommon -s -o alsacap tools/alsacap.c -lasound
2222 }
4444 install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/COPYING
4545 }
4646
47 sha512sums="e72b13714476170108844b84c0043dc06d2ff2e8c9b651a7ad1571d148fc5567aca48048646d16fb82630d6972a31b9328f04e522972b297d1cf8e804785867f fix-arm-segfault.patch
47 sha512sums="271d4c5184c7f48ac79c8f8f9f3bc39f7f970b4d98acda792e40450b687f211094b4dcaea23e034d4deb7ea78713b95e691db9c09fbf31b1be59b6d525ef11a8 fix-arm-segfault.patch
4848 093379f79b5dc9f5b8aa45826d61738b088d78305a7d514df33851ae34d02ee9034a8ecddf2558fcb1bf4daaf64c620ea4411521908cfc748e31fd0a2d50bbf7 alac-version.patch"
33
44 depend() {
55 need net
6 use alsasound
6 use alsa
77 after bootmisc
88 }
99
0 squeezelite (1.9.9-1414+git20221121.dbe69eb-1) unstable; urgency=medium
1
2 * New upstream version 1.9.9-1414+git20221121.dbe69eb
3 * Enable -DOPUS and add build-dep on libopus-dev and libopusfile-dev
4
5 -- tony mancill <tmancill@debian.org> Sat, 10 Dec 2022 16:19:57 -0800
6
07 squeezelite (1.9.9-1395+git20220104.874e4f9-1) unstable; urgency=medium
18
29 * New upstream version 1.9.9-1395+git20220104.874e4f9
1111 liblircclient-dev,
1212 libmad0-dev,
1313 libmpg123-dev,
14 libopus-dev,
15 libopusfile-dev,
1416 libpulse-dev,
1517 libsoxr-dev,
1618 libssl-dev,
33 # Uncomment this to turn on verbose mode.
44 #export DH_VERBOSE=1
55
6 # Enable ffmpeg, soxr resampling, visualisation export and disable dlopening
7 # libraries
8 export OPTS := -DDSD -DFFMPEG -DRESAMPLE -DVISEXPORT -DLINKALL -DIR -DUSE_SSL
6 # Enable ffmpeg, sox resampling, visualisation export, opus,
7 # and disable dlopening libraries
8 export OPTS := -DDSD -DFFMPEG -DRESAMPLE -DVISEXPORT -DLINKALL -DIR -DUSE_SSL -DOPUS -I/usr/include/opus
99
1010 # Enable all hardening build flags
1111 export DEB_BUILD_MAINT_OPTIONS := hardening=+all
00 version=4
11 # debian/watch
2 # Disabled because upstream does not want to apply tags. See requests:
2 # Upstream does not apply tags. See requests:
33 # - https://github.com/ralph-irving/squeezelite/issues/29
44 # - https://github.com/ralph-irving/squeezelite/issues/55
55 # - https://github.com/ralph-irving/squeezelite/issues/63
88 # Upstream repo:
99 # https://github.com/ralph-irving/squeezelite
1010 #
11 # The orig.tar.gz is created using `git archive` - for example:
12 # git archive --format=tgz --prefix=squeezelite-1.9+git2021216.e02fa87/ --output=../squeezelite_1.9+git20201216.e02fa87.orig.tar.gz e02fa87128debc65e26c582f1a017a20a53d1bcf
11 # The orig.tar.gz is created using `git archive` against the upstream repo - for example:
12 # git archive --format=tgz --prefix=squeezelite-1.9.9-1414+git20221121.dbe69eb/ --output=../squeezelite_1.9.9-1414+git20221121.dbe69eb.orig.tar.gz dbe69eb8aa88f644cfb46541d6cef72fa666570d
13 #
14 # the major, minor, and micro versions are taken from https://github.com/ralph-irving/squeezelite/blob/master/squeezelite.h
15
16 opts="mode=git,pgpmode=none,pretty=1.9.9-xxxx+git%cd.%h" \
17 https://github.com/ralph-irving/squeezelite heads/master debian
182182 if (!strstr(exclude_codecs, "pcm") && (!include_codecs || (order_codecs = strstr(include_codecs, "pcm"))))
183183 sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_pcm());
184184
185 #if !defined(NO_MAD) && !defined(NO_MPG123)
185186 // try mad then mpg for mp3 unless command line option passed
186187 if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mad")) &&
187188 (!include_codecs || (order_codecs = strstr(include_codecs, "mp3")) || (order_codecs = strstr(include_codecs, "mad"))))
189190 else if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mpg")) &&
190191 (!include_codecs || (order_codecs = strstr(include_codecs, "mp3")) || (order_codecs = strstr(include_codecs, "mpg"))))
191192 sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_mpg());
193 #elif !defined(NO_MAD)
194 if (!strstr(exclude_codecs, "mp3") && (!include_codecs || (order_codecs = strstr(include_codecs, "mp3"))))
195 sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_mad());
196 #elif !defined(NO_MPG123)
197 if (!strstr(exclude_codecs, "mp3") && (!include_codecs || (order_codecs = strstr(include_codecs, "mp3"))))
198 sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_mpg());
199 #endif
192200
193201 LOG_DEBUG("include codecs: %s exclude codecs: %s", include_codecs ? include_codecs : "", exclude_codecs);
194202
751751
752752 static struct codec ret = {
753753 'w', // id
754 "wma,wmap", // types
754 "wma,wmap,wmal", // types
755755 READ_SIZE, // min read
756756 WRITE_SIZE, // min space
757757 ff_open_wma, // open
759759 ff_decode, // decode
760760 };
761761
762 LOG_INFO("using ffmpeg to decode wma,wmap");
762 LOG_INFO("using ffmpeg to decode wma,wmap,wmal");
763763 return &ret;
764764 }
765765
281281
282282 static bool load_flac() {
283283 #if !LINKALL
284 void *handle = dlopen(LIBFLAC, RTLD_NOW);
284 void *handle = NULL;
285 char name[30];
285286 char *err;
287
288 sprintf(name, LIBFLAC, FLAC_API_VERSION_CURRENT < 12 ? 8 : 12);
289
290 handle = dlopen(name, RTLD_NOW);
286291
287292 if (!handle) {
288293 LOG_INFO("dlerror: %s", dlerror());
304309 return false;
305310 }
306311
307 LOG_INFO("loaded "LIBFLAC);
312 LOG_INFO("loaded %s", name);
308313 #endif
309314
310315 return true;
2727
2828 #define TITLE "Squeezelite " VERSION ", Copyright 2012-2015 Adrian Smith, 2015-2021 Ralph Irving."
2929
30 #define CODECS_BASE "flac,pcm,mp3,ogg"
30 #define CODECS_BASE "flac,pcm,ogg"
3131 #if NO_FAAD
3232 #define CODECS_AAC ""
3333 #else
5050 #else
5151 #define CODECS_DSD ""
5252 #endif
53 #define CODECS_MP3 " (mad,mpg for specific mp3 codec)"
53 #if !defined(NO_MAD) && !defined(NO_MPG123)
54 #define CODECS_MP3 ",mp3 (mad,mpg for specific mp3 codec)"
55 #elif defined(NO_MAD) && defined(NO_MPG123)
56 #define CODECS_MP3 ""
57 #else
58 #define CODECS_MP3 ",mp3"
59 #endif
5460
5561 #define CODECS CODECS_BASE CODECS_AAC CODECS_FF CODECS_OPUS CODECS_DSD CODECS_MP3
5662
219225 #endif
220226 #if NO_SSLSYM
221227 " NO_SSLSYM"
228 #endif
229 #if NO_MPG123
230 " NO_MPG123"
231 #endif
232 #if NO_MAD
233 " NO_MAD"
222234 #endif
223235 #if LINKALL
224236 " LINKALL"
4444
4545 struct opus {
4646 struct OggOpusFile *of;
47 bool end;
4748 #if FRAME_BUF
4849 u8_t *write_buf;
4950 #endif
118119
119120 LOCK_S;
120121
121 if (stream.state <= DISCONNECT && !_buf_used(streambuf)) {
122 if (stream.state <= DISCONNECT && u->end) {
122123 UNLOCK_S;
123124 return DECODE_COMPLETE;
124125 }
170171 frames = process.max_in_frames;
171172 write_buf = process.inbuf;
172173 );
174
175 u->end = frames == 0;
173176
174177 // write the decoded frames into outputbuf then unpack them (they are 16 bits)
175178 n = OP(u, read, u->of, (opus_int16*) write_buf, frames * channels, NULL);
272275 free(u->write_buf);
273276 u->write_buf = NULL;
274277 #endif
278 u->end = false;
275279 }
276280
277281 static bool load_opus(void) {
2525
2626 #define MAJOR_VERSION "1.9"
2727 #define MINOR_VERSION "9"
28 #define MICRO_VERSION "1395"
28 #define MICRO_VERSION "1414"
2929
3030 #if defined(CUSTOM_VERSION)
3131 #define VERSION "v" MAJOR_VERSION "." MINOR_VERSION "-" MICRO_VERSION STR(CUSTOM_VERSION)
189189 // dynamically loaded libraries at run time
190190
191191 #if LINUX
192 #define LIBFLAC "libFLAC.so.8"
192 #define LIBFLAC "libFLAC.so.%d"
193193 #define LIBMAD "libmad.so.0"
194194 #define LIBMPG "libmpg123.so.0"
195195 #define LIBVORBIS "libvorbisfile.so.3"
204204 #endif
205205
206206 #if OSX
207 #define LIBFLAC "libFLAC.8.dylib"
207 #define LIBFLAC "libFLAC.%d.dylib"
208208 #define LIBMAD "libmad.0.dylib"
209209 #define LIBMPG "libmpg123.0.dylib"
210210 #define LIBVORBIS "libvorbisfile.3.dylib"
232232 #endif
233233
234234 #if FREEBSD
235 #define LIBFLAC "libFLAC.so.8"
235 #define LIBFLAC "libFLAC.so.%d"
236236 #define LIBMAD "libmad.so.0"
237237 #define LIBMPG "libmpg123.so.0"
238238 #define LIBVORBIS "libvorbisfile.so.3"
5050 struct streamstate stream;
5151
5252 #if USE_SSL
53 #if WIN
54 #define _last_error() WSAGetLastError()
55 #define ERROR_WOULDBLOCK WSAEWOULDBLOCK
56 #else
5357 #define _last_error() ERROR_WOULDBLOCK
54
58 #endif
5559 static SSL_CTX *SSLctx;
5660 SSL *ssl;
5761
392396 // stream body into streambuf
393397 } else {
394398 int n;
399 int error;
395400
396401 space = min(_buf_space(streambuf), _buf_cont_write(streambuf));
397402 if (stream.meta_interval) {
403408 LOG_INFO("end of stream (%u bytes)", stream.bytes);
404409 _disconnect(DISCONNECT, DISCONNECT_OK);
405410 }
406 if (n < 0 && _last_error() != ERROR_WOULDBLOCK) {
407 LOG_INFO("error reading: %s", strerror(last_error()));
408 _disconnect(DISCONNECT, REMOTE_DISCONNECT);
411 if (n < 0) {
412 error = _last_error();
413 if (error != ERROR_WOULDBLOCK) {
414 LOG_INFO("error reading: %s (%d)", strerror(error), error);
415 _disconnect(DISCONNECT, REMOTE_DISCONNECT);
416 }
409417 }
410418
411419 if (n > 0) {
5353
5454 struct vorbis {
5555 OggVorbis_File *vf;
56 bool opened;
56 bool opened, end;
5757 #if FRAME_BUF
5858 u8_t *write_buf;
5959 #endif
139139
140140 LOCK_S;
141141
142 if (stream.state <= DISCONNECT && !_buf_used(streambuf)) {
142 if (stream.state <= DISCONNECT && v->end) {
143143 UNLOCK_S;
144144 return DECODE_COMPLETE;
145145 }
203203 );
204204
205205 bytes = frames * 2 * channels; // samples returned are 16 bits
206 v->end = frames == 0;
206207
207208 // write the decoded frames into outputbuf even though they are 16 bits per sample, then unpack them
208209 #ifdef TREMOR_ONLY
310311 v->opened = false;
311312 }
312313 }
314 v->end = false;
313315 }
314316
315317 static void vorbis_close(void) {