L'effetto della patch è quello di impostare ad un massimo teorico la lunghezza dello stream, che altrimenti è posta a 0, quindi provoca la chiusura di squeezelite (come succedeva con i files molto lunghi con wav ricordate?).Ahi. Cominciamo subito male... la patch fallisce l'ultimo chunk:
il codice in git non corrisponde.codice:--- src/dsf.c +++ src/dsf.c @@ -278,7 +281,10 @@ static void dsf_write_bits(struct dsf *dsf, const sox_sample_t *buf, unsigned d = dsd[i * dsf->block_size]; for (j = start_bit; j < start_bit + len; j++) { - d |= (buf[i + j * dsf->chan_num] > 0) << j; + if (buf[i + j * dsf->chan_num] > 0) + d |= 1 << j; + else + d &= ~(1 << j); } dsd[i * dsf->block_size] = d;
Con la patch parzialmente applicata, qualcosa cambia: vengono prodotti dei dati, che squeezelite riceve e... "suona", ma è junk (viene fuori solo rumore):
Dopo di che ho provato a ricostruire a mano come avrebbe dovuto essere la funzione con l'ultima parte della patch, ma non funziona: non solo produce dsf invalidi ma, curiosamente, si comporta come il sox di Mans non patchato (cioè, non fa neanche finta di suonare).codice:[17-02-06 01:46:21.7378] Slim::Player::StreamingController::_Stream (1265) 00:1c:c0:37:22:73: stream [17-02-06 01:46:21.7400] Slim::Player::StreamingController::_Stream (1302) Song queue is now 1 [17-02-06 01:46:21.7403] Slim::Player::StreamingController::_setPlayingState (2357) new playing state BUFFERING [17-02-06 01:46:21.7404] Slim::Player::StreamingController::_setStreamingState (2366) new streaming state STREAMING [17-02-06 01:46:21.7540] Slim::Player::TranscodingHelper::getConvertCommand2 (446) Matched: flc->dsf via: [sox] -q -t flac $FILE$ -t dsf -b 1 - rate -vMn 5644800 sdm -f sdm-8 [17-02-06 01:46:21.7546] Slim::Player::TranscodingHelper::getConvertCommand2 (446) Matched: flc->dsf via: [sox] -q -t flac $FILE$ -t dsf -b 1 - rate -vMn 5644800 sdm -f sdm-8 *** /tmp/squeezelite.log *** [01:46:21.988143] _read_header:158 DSF version: 1 format: 0 [01:46:21.988599] _read_header:168 channels: 2 [01:46:21.988607] _read_header:169 sample rate: 5644800 [01:46:21.988613] _read_header:170 lsb first: 1 [01:46:21.988619] _read_header:171 sample bytes: 2305843009213693951 [01:46:21.988626] _read_header:172 block size: 4096 [01:46:21.988632] _read_header:178 found dsd len: 12 [01:46:21.988639] dsd_decode:527 setting track_start [01:46:21.988646] dsd_decode:543 DSD to PCM output [01:46:22.078507] output_thread:638 open output device: hw:CARD=D20 [01:46:22.078721] alsa_open:355 opening device at: 44100 [01:46:22.078983] alsa_open:406 opened device hw:CARD=D20 using format: S32_LE sample rate: 44100 mmap: 1 [01:46:22.079016] alsa_open:485 buffer: 499 period: 3 -> buffer size: 22005 period size: 7335 [01:46:22.196789] _output_frames:61 start buffer frames: 159744 [01:46:22.196853] _output_frames:146 track start sample rate: 705600 replay_gain: 0 [01:46:22.206886] output_thread:638 open output device: hw:CARD=D20 [01:46:22.221039] alsa_open:355 opening device at: 705600 [01:46:22.221299] alsa_open:406 opened device hw:CARD=D20 using format: S32_LE sample rate: 705600 mmap: 1 [01:46:22.221322] alsa_open:485 buffer: 499 period: 3 -> buffer size: 131070 period size: 43690 *** /var/log/squeezeboxserver//server.log *** [17-02-06 01:46:22.2056] Slim::Player::StreamingController::playerTrackStarted (2180) 00:1c:c0:37:22:73 [17-02-06 01:46:22.2059] Slim::Player::StreamingController::_setPlayingState (2357) new playing state PLAYING [17-02-06 01:46:22.2061] Slim::Player::StreamingController::_Playing (361) Song 1 has now started playing [17-02-06 01:46:22.2066] Slim::Player::StreamingController::_Playing (390) Song queue is now 1 [17-02-06 01:46:22.9703] Slim::Player::StreamingController::pause (2116) 00:1c:c0:37:22:73 [17-02-06 01:46:22.9711] Slim::Player::StreamingController::_setPlayingState (2357) new playing state PAUSED
Direi che a questo punto è tempo interpellare Mans...
Però mi pare che esca in PCM...