Codebase list squeezelite / 2995095
Merge tag 'upstream/1.5' into develop Chris Boot 10 years ago
26 changed file(s) with 155 addition(s) and 71 deletion(s). Raw diff Collapse all Expand all
4141 Minor changes
4242 - support of compile time linking for distro packaging, uses -DLINKALL option
4343
44 Version 1.4 (beta)
45 ==================
44 Version 1.4 28/12/13
45 ====================
4646
4747 Features
4848 - native support of dsd playback to dop capable dac or via conversion to pcm and resampling
5454 - fix problem with libmpg123 playback not playing to end of track
5555 - add ablity for player name change to be stored locally in a file (to emulate hardware where name is stored on player)
5656
57 Version 1.5 12/1/14
58 ===================
59
60 Minor changes
61 - add configurable delay for switch between pcm and dop
62 - allow visexport to work with jivelite running as any user
63 - bug fixes for dsf playback, for status progress on windows using wdm-ks output, and to avoid 100% cpu
64 - change some logging levels for slimproto to aid readablity
65
00 Squeezelite - lightweight headless squeezebox emulator
11
2 (c) Adrian Smith 2012, 2013, triode1@btinternet.com
2 (c) Adrian Smith 2012-2014, triode1@btinternet.com
33
44 Released under GPLv3 license:
55
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
8080 }
8181 }
8282
83 void dop_init(bool enable) {
83 void dop_init(bool enable, unsigned delay) {
8484 LOCK_O;
8585 output.has_dop = enable;
86 output.dop_delay = delay;
8687 UNLOCK_O;
8788 }
8889
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
214214 unsigned bytes_per_frame = dop ? 2 : 1;
215215
216216 if (bytes < d->block_size * d->channels) {
217 LOG_WARN("stream too short");
218 return DECODE_ERROR;
217 LOG_INFO("stream too short"); // this can occur when scanning the track
218 return DECODE_COMPLETE;
219219 }
220220
221221 IF_PROCESS(
248248
249249 frames = min(bytes, d->sample_bytes) / bytes_per_frame;
250250 if (frames == 0) {
251 // /2 for dop should never result in 0 as header len is always even
252 LOG_WARN("frames got to zero");
253 return DECODE_ERROR;
251 if (dop && d->sample_bytes == 1 && bytes >= 2) {
252 // 1 byte left add a byte of silence and play
253 *(iptrl + 1) = *(iptrr + 1) = 0x69;
254 frames = 1;
255 } else {
256 // should not get here due to wrapping m/2 for dop should never result in 0 as header len is always even
257 LOG_INFO("frames got to zero");
258 return DECODE_COMPLETE;
259 }
254260 }
255261
256262 frames = min(frames, out);
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
2121
2222 #include <signal.h>
2323
24 #define TITLE "Squeezelite " VERSION ", Copyright 2012, 2013 Adrian Smith."
24 #define TITLE "Squeezelite " VERSION ", Copyright 2012-2014 Adrian Smith."
2525
2626 static void usage(const char *argv0) {
2727 printf(TITLE " See -t for license terms\n"
6767 " \t\t\t phase_response = 0-100 (0 = minimum / 50 = linear / 100 = maximum)\n"
6868 #endif
6969 #if DSD
70 " -D\t\t\tOutput device supports DSD over PCM (DoP)\n"
70 " -D [delay]\t\tOutput device supports DSD over PCM (DoP), delay = optional delay switching between PCM and DoP in ms\n"
7171 #endif
7272 #if VISEXPORT
7373 " -v \t\t\tVisulizer support\n"
168168 #endif
169169 #if DSD
170170 bool dop = false;
171 unsigned dop_delay = 0;
171172 #endif
172173 #if VISEXPORT
173174 bool visexport = false;
330331 #if DSD
331332 case 'D':
332333 dop = true;
334 if (optind < argc && argv[optind] && argv[optind][0] != '-') {
335 dop_delay = atoi(argv[optind++]);
336 }
333337 break;
334338 #endif
335339 #if VISEXPORT
349353 break;
350354 }
351355 }
356
357 // warn if command line includes something which isn't parsed
358 if (optind < argc) {
359 usage(argv[0]);
360 exit(0);
361 }
352362
353363 signal(SIGINT, sighandler);
354364 signal(SIGTERM, sighandler);
405415 }
406416
407417 #if DSD
408 dop_init(dop);
418 dop_init(dop, dop_delay);
409419 #endif
410420
411421 #if VISEXPORT
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
118118
119119 if (output.track_start && !silence) {
120120 if (output.track_start == outputbuf->readp) {
121 frames -= size;
122 IF_DSD(
123 if (output.dop != output.next_dop) {
124 if (output.dop_delay) {
125 // add silence delay in two halves, before and after track start and pcm-dop change
126 if (!output.dop_delay_active) {
127 output.pause_frames = output.current_sample_rate * output.dop_delay / 2000;
128 output.dop_delay_active = true; // first delay - don't process track start
129 break;
130 } else {
131 output.pause_frames = output.next_sample_rate * output.dop_delay / 2000;
132 output.dop_delay_active = false; // second delay - process track start
133 }
134 output.state = OUTPUT_PAUSE_FRAMES;
135 }
136 }
137 output.dop = output.next_dop;
138 )
121139 LOG_INFO("track start sample rate: %u replay_gain: %u", output.next_sample_rate, output.next_replay_gain);
122140 output.frames_played = 0;
123141 output.track_started = true;
124142 output.current_sample_rate = output.next_sample_rate;
125 IF_DSD( output.dop = output.next_dop; )
126143 if (!output.fade == FADE_ACTIVE || !output.fade_mode == FADE_CROSSFADE) {
127144 output.current_replay_gain = output.next_replay_gain;
128145 }
129146 output.track_start = NULL;
130 continue;
147 break;
131148 } else if (output.track_start > outputbuf->readp) {
132149 // reduce cont_frames so we find the next track start at beginning of next chunk
133150 cont_frames = min(cont_frames, (output.track_start - outputbuf->readp) / BYTES_PER_FRAME);
223240
224241 wrote = output.write_cb(out_frames, silence, gainL, gainR, cross_gain_in, cross_gain_out, &cross_ptr);
225242
226 if (wrote < 0) {
227 LOG_WARN("error in write cb");
228 frames -= out_frames;
243 if (wrote <= 0) {
244 frames -= size;
229245 break;
230246 } else {
231247 out_frames = (frames_t)wrote;
396412 if (output.error_opening) {
397413 output.current_sample_rate = output.default_sample_rate;
398414 }
415 IF_DSD( output.dop_delay_active = false; )
399416 }
400417 output.frames_played = 0;
401418 UNLOCK;
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
531531 continue;
532532 }
533533 LOG_INFO("start error: %s", snd_strerror(err));
534 usleep(10000);
534535 }
535536 } else {
536537 start = false;
578579 // EPIPE indicates underrun - attempt to recover
579580 UNLOCK;
580581 continue;
582 } else if (err == -EIO) {
583 // EIO can occur with non existant pulse server
584 UNLOCK;
585 LOG_SDEBUG("snd_pcm_delay returns: EIO - sleeping");
586 usleep(100000);
587 continue;
581588 } else {
582589 LOG_DEBUG("snd_pcm_delay returns: %d", err);
583590 }
587594 }
588595
589596 // process frames
590 _output_frames(avail);
597 frames_t wrote = _output_frames(avail);
591598
592599 UNLOCK;
600
601 // some output devices such as alsa null refuse any data, avoid spinning
602 if (!wrote) {
603 LOG_SDEBUG("wrote 0 - sleeping");
604 usleep(10000);
605 }
593606 }
594607
595608 return 0;
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
5757 LOG_WARN("error initialising port audio: %s", Pa_GetErrorText(err));
5858 return;
5959 }
60
60
6161 printf("Output devices:\n");
6262 for (i = 0; i < Pa_GetDeviceCount(); ++i) {
63 printf(" %i - %s [%s]\n", i, Pa_GetDeviceInfo(i)->name, Pa_GetHostApiInfo(Pa_GetDeviceInfo(i)->hostApi)->name);
63 if (Pa_GetDeviceInfo(i)->maxOutputChannels) {
64 printf(" %i - %s [%s]\n", i, Pa_GetDeviceInfo(i)->name, Pa_GetHostApiInfo(Pa_GetDeviceInfo(i)->hostApi)->name);
65 }
6466 }
6567 printf("\n");
66
68
6769 if ((err = Pa_Terminate()) != paNoError) {
6870 LOG_WARN("error closing port audio: %s", Pa_GetErrorText(err));
6971 }
327329 static int pa_callback(const void *pa_input, void *pa_output, unsigned long pa_frames_wanted,
328330 const PaStreamCallbackTimeInfo *time_info, PaStreamCallbackFlags statusFlags, void *userData) {
329331 int ret;
332 double stream_time;
330333 frames_t frames;
331334
332335 optr = (u8_t *)pa_output;
333336
334337 LOCK;
335338
336 output.device_frames = (unsigned)((time_info->outputBufferDacTime - Pa_GetStreamTime(pa.stream)) * output.current_sample_rate);
339 stream_time = Pa_GetStreamTime(pa.stream);
340
341 if (time_info->outputBufferDacTime > stream_time) {
342 // workaround for wdm-ks which can return outputBufferDacTime with a different epoch
343 output.device_frames = (unsigned)((time_info->outputBufferDacTime - stream_time) * output.current_sample_rate);
344 } else {
345 output.device_frames = 0;
346 }
347
337348 output.updated = gettime_ms();
338349
339350 frames = _output_frames(pa_frames_wanted);
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
2323
2424 #if VISEXPORT
2525
26 #include <sys/stat.h>
2627 #include <sys/mman.h>
2728 #include <fcntl.h>
2829
112113
113114 sprintf(vis_shm_path, "/squeezelite-%02x:%02x:%02x:%02x:%02x:%02x", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
114115
116 mode_t old_mask = umask(000); // allow any user to read our shm when created
117
115118 vis_fd = shm_open(vis_shm_path, O_CREAT | O_RDWR, 0666);
116119 if (vis_fd != -1) {
117120 if (ftruncate(vis_fd, sizeof(struct vis_t)) == 0) {
133136 LOG_WARN("unable to open visualizer shared memory");
134137 vis_mmap = NULL;
135138 }
139
140 umask(old_mask);
136141 }
137142
138143 #endif // VISEXPORT
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
115115
116116 LOG_INFO("mac: %02x:%02x:%02x:%02x:%02x:%02x", pkt.mac[0], pkt.mac[1], pkt.mac[2], pkt.mac[3], pkt.mac[4], pkt.mac[5]);
117117
118 LOG_DEBUG("cap: %s%s%s", base_cap, fixed_cap, var_cap);
118 LOG_INFO("cap: %s%s%s", base_cap, fixed_cap, var_cap);
119119
120120 send_packet((u8_t *)&pkt, sizeof(pkt));
121121 send_packet((u8_t *)base_cap, strlen(base_cap));
131131 if (status.current_sample_rate && status.frames_played && status.frames_played > status.device_frames) {
132132 ms_played = (u32_t)(((u64_t)(status.frames_played - status.device_frames) * (u64_t)1000) / (u64_t)status.current_sample_rate);
133133 if (now > status.updated) ms_played += (now - status.updated);
134 LOG_SDEBUG("ms_played: %u (frames_played: %u device_frames: %u)", ms_played, status.frames_played, status.device_frames);
135 } else if (status.frames_played && now > status.stream_start) {
136 ms_played = now - status.stream_start;
137 LOG_SDEBUG("ms_played: %u using elapsed time (frames_played: %u device_frames: %u)", ms_played, status.frames_played, status.device_frames);
134138 } else {
139 LOG_SDEBUG("ms_played: 0");
135140 ms_played = 0;
136141 }
137142
155160 pkt.server_timestamp = server_timestamp; // keep this is server format - don't unpack/pack
156161 // error_code;
157162
158 LOG_INFO("STAT: %s", event);
163 LOG_DEBUG("STAT: %s", event);
159164
160165 if (loglevel == lSDEBUG) {
161 LOG_SDEBUG("received bytesL: %u streambuf: %u outputbuf: %u calc elapsed: %u real elapsed: %u (diff: %u) device: %u delay: %d",
166 LOG_SDEBUG("received bytesL: %u streambuf: %u outputbuf: %u calc elapsed: %u real elapsed: %u (diff: %d) device: %u delay: %d",
162167 (u32_t)status.stream_bytes, status.stream_full, status.output_full, ms_played, now - status.stream_start,
163168 ms_played - now + status.stream_start, status.device_frames * 1000 / status.current_sample_rate, now - status.updated);
164169 }
174179 pkt.length = htonl(sizeof(pkt) - 8);
175180 pkt.reason = disconnect & 0xFF;
176181
177 LOG_INFO("DSCO: %d", disconnect);
182 LOG_DEBUG("DSCO: %d", disconnect);
178183
179184 send_packet((u8_t *)&pkt, sizeof(pkt));
180185 }
186191 memcpy(&pkt_header.opcode, "RESP", 4);
187192 pkt_header.length = htonl(sizeof(pkt_header) + len - 8);
188193
189 LOG_INFO("RESP");
194 LOG_DEBUG("RESP");
190195
191196 send_packet((u8_t *)&pkt_header, sizeof(pkt_header));
192197 send_packet((u8_t *)header, len);
199204 memcpy(&pkt_header.opcode, "META", 4);
200205 pkt_header.length = htonl(sizeof(pkt_header) + len - 8);
201206
202 LOG_INFO("META");
207 LOG_DEBUG("META");
203208
204209 send_packet((u8_t *)&pkt_header, sizeof(pkt_header));
205210 send_packet((u8_t *)meta, len);
214219 pkt_header.id = 0; // id 0 is playername S:P:Squeezebox2
215220 pkt_header.length = htonl(sizeof(pkt_header) + strlen(name) + 1 - 8);
216221
217 LOG_INFO("set playername: %s", name);
222 LOG_DEBUG("set playername: %s", name);
218223
219224 send_packet((u8_t *)&pkt_header, sizeof(pkt_header));
220225 send_packet((u8_t *)name, strlen(name) + 1);
223228 static void process_strm(u8_t *pkt, int len) {
224229 struct strm_packet *strm = (struct strm_packet *)pkt;
225230
226 LOG_INFO("strm command %c", strm->command);
231 LOG_DEBUG("strm command %c", strm->command);
227232
228233 switch(strm->command) {
229234 case 't':
254259 output.state = interval ? OUTPUT_PAUSE_FRAMES : OUTPUT_STOPPED;
255260 UNLOCK_O;
256261 if (!interval) sendSTAT("STMp", 0);
257 LOG_INFO("pause interval: %u", interval);
262 LOG_DEBUG("pause interval: %u", interval);
258263 }
259264 break;
260265 case 'a':
264269 output.skip_frames = interval * status.current_sample_rate / 1000;
265270 output.state = OUTPUT_SKIP_FRAMES;
266271 UNLOCK_O;
267 LOG_INFO("skip ahead interval: %u", interval);
272 LOG_DEBUG("skip ahead interval: %u", interval);
268273 }
269274 break;
270275 case 'u':
277282 LOCK_D;
278283 decode.state = DECODE_RUNNING;
279284 UNLOCK_D;
280 LOG_INFO("unpause at: %u now: %u", jiffies, gettime_ms());
285 LOG_DEBUG("unpause at: %u now: %u", jiffies, gettime_ms());
281286 sendSTAT("STMr", 0);
282287 }
283288 break;
289294 u16_t port = strm->server_port; // keep in network byte order
290295 if (ip == 0) ip = slimproto_ip;
291296
292 LOG_INFO("strm s autostart: %c transition period: %u transition type: %u codec: %c",
293 strm->autostart, strm->transition_period, strm->transition_type - '0', strm->format);
294
297 LOG_DEBUG("strm s autostart: %c transition period: %u transition type: %u codec: %c",
298 strm->autostart, strm->transition_period, strm->transition_type - '0', strm->format);
299
295300 autostart = strm->autostart - '0';
296301 sendSTAT("STMf", 0);
297302 if (header_len > MAX_HEADER -1) {
302307 codec_open(strm->format, strm->pcm_sample_size, strm->pcm_sample_rate, strm->pcm_channels, strm->pcm_endianness);
303308 } else if (autostart >= 2) {
304309 // extension to slimproto to allow server to detect codec from response header and send back in codc message
305 LOG_INFO("streaming unknown codec");
310 LOG_DEBUG("streaming unknown codec");
306311 } else {
307312 LOG_WARN("unknown codec requires autostart >= 2");
308313 break;
321326 output.next_replay_gain = unpackN(&strm->replay_gain);
322327 output.fade_mode = strm->transition_type - '0';
323328 output.fade_secs = strm->transition_period;
324 LOG_INFO("set fade mode: %u", output.fade_mode);
329 LOG_DEBUG("set fade mode: %u", output.fade_mode);
325330 UNLOCK_O;
326331 }
327332 break;
328333 default:
329 LOG_INFO("unhandled strm %c", strm->command);
334 LOG_WARN("unhandled strm %c", strm->command);
330335 break;
331336 }
332337 }
335340 struct cont_packet *cont = (struct cont_packet *)pkt;
336341 cont->metaint = unpackN(&cont->metaint);
337342
338 LOG_INFO("cont metaint: %u loop: %u", cont->metaint, cont->loop);
343 LOG_DEBUG("cont metaint: %u loop: %u", cont->metaint, cont->loop);
339344
340345 if (autostart > 1) {
341346 autostart -= 2;
352357 static void process_codc(u8_t *pkt, int len) {
353358 struct codc_packet *codc = (struct codc_packet *)pkt;
354359
355 LOG_INFO("codc: %c", codc->format);
360 LOG_DEBUG("codc: %c", codc->format);
356361 codec_open(codc->format, codc->pcm_sample_size, codc->pcm_sample_rate, codc->pcm_channels, codc->pcm_endianness);
357362 }
358363
359364 static void process_aude(u8_t *pkt, int len) {
360365 struct aude_packet *aude = (struct aude_packet *)pkt;
361366
362 LOG_INFO("enable spdif: %d dac: %d", aude->enable_spdif, aude->enable_dac);
367 LOG_DEBUG("enable spdif: %d dac: %d", aude->enable_spdif, aude->enable_dac);
363368
364369 LOCK_O;
365370 if (!aude->enable_spdif && output.state != OUTPUT_OFF) {
376381 audg->gainL = unpackN(&audg->gainL);
377382 audg->gainR = unpackN(&audg->gainR);
378383
379 LOG_INFO("audg gainL: %u gainR: %u adjust: %u", audg->gainL, audg->gainR, audg->adjust);
384 LOG_DEBUG("audg gainL: %u gainR: %u adjust: %u", audg->gainL, audg->gainR, audg->adjust);
380385
381386 LOCK_O;
382387 output.gainL = audg->adjust ? audg->gainL : FIXED_ONE;
460465 while (h->handler && strncmp((char *)pack, h->opcode, 4)) { h++; }
461466
462467 if (h->handler) {
463 LOG_INFO("%s", h->opcode);
468 LOG_DEBUG("%s", h->opcode);
464469 h->handler(pack, len);
465470 } else {
466471 pack[4] = '\0';
467 LOG_INFO("unhandled %s", (char *)pack);
472 LOG_WARN("unhandled %s", (char *)pack);
468473 }
469474 }
470475
749754 if (!fgets(player_name, PLAYER_NAME_LEN, fp)) {
750755 player_name[PLAYER_NAME_LEN] = '\0';
751756 } else {
752 LOG_INFO("retrived name %s from %s", player_name, name_file);
757 // strip any \n from fgets response
758 int len = strlen(player_name);
759 if (len > 0 && player_name[len - 1] == '\n') {
760 player_name[len - 1] = '\0';
761 }
762 LOG_INFO("retrieved name %s from %s", player_name, name_file);
753763 }
754764 fclose(fp);
755765 }
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
1919
2020 // make may define: PORTAUDIO, SELFPIPE, RESAMPLE, VISEXPORT, DSD, LINKALL to influence build
2121
22 #define VERSION "v1.4"
22 #define VERSION "v1.5"
2323
2424 // build detection
2525 #if defined(linux)
527527 bool next_dop; // set in decode thread
528528 bool dop;
529529 bool has_dop; // set in dop_init - output device supports dop
530 unsigned dop_delay; // set in dop_init - delay in ms switching to/from dop
531 bool dop_delay_active;
530532 #endif
531533 };
532534
580582 bool is_flac_dop(u32_t *lptr, u32_t *rptr, frames_t frames);
581583 void update_dop_marker(u32_t *ptr, frames_t frames);
582584 void dop_silence_frames(u32_t *ptr, frames_t frames);
583 void dop_init(bool enable);
585 void dop_init(bool enable, unsigned delay);
584586 #endif
585587
586588 // codecs
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
00 /*
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
3 * (c) Adrian Smith 2012, 2013, triode1@btinternet.com
3 * (c) Adrian Smith 2012-2014, triode1@btinternet.com
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by