PDA

View Full Version : spotty conversion for Inguz?



bobertuk
2017-09-19, 04:15
Michael,

I know nothing about custom-convert.conf or sox so even attempting this is beyond me. Forum user 'JohnB' has been kind enough to try comming up with something but he's working blind. He doesn't subscribe to Spotify so it's all trial and error. Thank you JohnB for trying this out.

Inguz has its own custom-convert.conf which resamples files (flac, mp3 and others) to include its RC and EQ in the output stream.

Is there any chance that something like the following would work to resample output from spotty to Inguz? I say 'something like' because this code doesn't actually work!


spt flc * xx:xx:xx:xx:xx:xx
# RT:{START=--start-position %s}
[spotty] -n Squeezebox -c "$CACHE$" --single-track $FILE$ --disable-discovery --disable-audio-cache $START$ |[sox] -q -r 44100 -e signed-integer -b 16 -L -c 2 --ignore-length -t raw - -t wav | [InguzDSP] -id "xx:xx:xx:xx:xx:xx" -wav -wavo -d 24 | [flac] -cs --fast --totally-silent --ignore-chunk-sizes -



As I say, putting the above lines into the Inguz plugin custom-convert.conf to try it out doesn't in fact work! All the tracks from Spotify are skipped, each track producing the following error in the Inguz log. The first and second line are just for info, it's the third line that's significant.


20170919105651: InguzDSP (version 0.9.32) -id xx:xx:xx:xx:xx:xx -wav -wavo -d 24
20170919105651: xx:xx:xx:xx:xx:xx Gain -16 dB
20170919105651: xx:xx:xx:xx:xx:xx Unable to read: File is not WAV: no 'RIFF' tag found, instead '2F 63 79 67 '.




In LMS, I've set Inguz and spotty to log at 'info' level and there doesn't seem to be anything relavent in LMS server log.



The normal Inguz entry in custom-convert.conf for flac conversion is...


flc flc * xx:xx:xx:xx:xx:xx
# FT:{START=--skip=%t}U:{END=--until=%v}
[flac] -dcs $START$ $END$ -- $FILE$ | [InguzDSP] -id "90:2b:34:53:ce:43" -wav -wavo -d 24 | [flac] -cs -5 --totally-silent -


Any help would be appreciated.

Thank you Michael for all the effort you've put into creating spotty and for all the work you put into maintaining LMS. It's appreciated by us all!

Bob

mherger
2017-09-19, 04:38
> spt flc * xx:xx:xx:xx:xx:xx
> # RT:{START=--start-position %s}
> [spotty] -n Squeezebox -c "$CACHE$" --single-track $FILE$ --disable-discovery --disable-audio-cache $START$ |[sox] -q -r 44100 -e signed-integer -b 16 -L -c 2 --ignore-length -t raw - -t wav | [InguzDSP] -id "xx:xx:xx:xx:xx:xx" -wav -wavo -d 24 | [flac] -cs --fast --totally-silent --ignore-chunk-sizes -

Unfortunately I'm not familiar with inguz at all. But what you could do
is run the command from the command line, rather than within LMS. That
could help you to figure out which of the components in this command is
failing (spotty, sox, inguz, flac). Replace the items in brackets with
the path to the executable, $CACHE$ with the path to your LMS' spotty
cache folder (see Settings/Information for the cache folder), $FILE$
with a spotify URI (can be found in Spotify's "..." menu). Then pipe all
of it in a .flac file. If that can be played, then there's a problem in
LMS. If it can't be played, leave out one component after the other:
spotty would give you PCM data, sox would convert it to WAV, inguz dito,
flac, well, flac. Store sox' output in a .wav file. Can it be played?
Yes: add inguz to the mix, repeat. If no. Hmm...

--

Michael

bobertuk
2017-09-19, 05:03
> spt flc * xx:xx:xx:xx:xx:xx
> # RT:{START=--start-position %s}
> [spotty] -n Squeezebox -c "$CACHE$" --single-track $FILE$ --disable-discovery --disable-audio-cache $START$ |[sox] -q -r 44100 -e signed-integer -b 16 -L -c 2 --ignore-length -t raw - -t wav | [InguzDSP] -id "xx:xx:xx:xx:xx:xx" -wav -wavo -d 24 | [flac] -cs --fast --totally-silent --ignore-chunk-sizes -

Unfortunately I'm not familiar with inguz at all. But what you could do
is run the command from the command line, rather than within LMS. That
could help you to figure out which of the components in this command is
failing (spotty, sox, inguz, flac). Replace the items in brackets with
the path to the executable, $CACHE$ with the path to your LMS' spotty
cache folder (see Settings/Information for the cache folder), $FILE$
with a spotify URI (can be found in Spotify's "..." menu). Then pipe all
of it in a .flac file. If that can be played, then there's a problem in
LMS. If it can't be played, leave out one component after the other:
spotty would give you PCM data, sox would convert it to WAV, inguz dito,
flac, well, flac. Store sox' output in a .wav file. Can it be played?
Yes: add inguz to the mix, repeat. If no. Hmm...

--

Michael

Thank you Michael, I'll give that a go and report back if I can get it to work.

Bob

JohnB
2017-09-19, 10:39
I feel the tests I've done have very much been the blind leaving the blind. :o

Just in case there is an obvious solution - these notes might be useful:

From what I can see, the spotty output is PCM.

Inguz expects the input to be wav.

So the task is to convert the spotty pcm output to wave. I tried the following sox command:


| [sox] -q -r 44100 -e signed-integer -b 16 -L -c 2 -t raw - -t wav |

and then, just in case "ignore-length" might make a difference:


| [sox] -q -r 44100 -e signed-integer -b 16 -L -c 2 --ignore-length -t raw - -t wav |

The sox parameters are based on those used in the spt-flc section of the Spotty custom-convert.conf file.

As a test I created a 44.1k, 16bit, 2 channel, little-endian raw file (using Sound Forge) and the following command line correctly converted it to wav:


sox -q -r 44100 -e signed-integer -b 16 -L -c 2 F:\test.raw F:\test.wav

The difference between this and what I tried in the Inguz Spotty command is:
F:\test.raw F:\test.wav vs
-t raw - -t wav

Any thoughts?

i.e. is the second the correct "translation" of the first when used in a custom-convert.conf file?

JohnB
2017-09-19, 14:24
I've been doing some testing, using the custom-convert.conf command lines - as suggested by Michael, though not using Spotify.

This sox section of the command line seems to work. It accepts piped in pcm and pipes out wav.

| [sox] -q -t raw -b 16 -e signed -c 2 -r 44.1k -L - -t wav - |

I've tested it on files (within LMS) but not on Spotify streams.

It would make the Inguz section:


spt flc * xx:xx:xx:xx:xx:xx
# RT:{START=--start-position %s}
[spotty] -n Squeezebox -c "$CACHE$" --single-track $FILE$ --disable-discovery --disable-audio-cache $START$ | [sox] -q -t raw -b 16 -e signed -c 2 -r 44.1k -L - -t wav - | [InguzDSP] -id "xx:xx:xx:xx:xx:xx" -wav -wavo -d 24 | [flac] -cs --fast --totally-silent --ignore-chunk-sizes -

That seemed to work, according to Bob.

JohnB
2017-09-20, 08:35
On further investigation it seems that the sox command that I had tried before, the first example in post #4, just needed a tailing "-" to make it work!

bobertuk
2017-09-20, 09:32
I've been doing some testing, using the custom-convert.conf command lines - as suggested by Michael, though not using Spotify.

This sox section of the command line seems to work. It accepts piped in pcm and pipes out wav.

| [sox] -q -t raw -b 16 -e signed -c 2 -r 44.1k -L - -t wav - |

I've tested it on files (within LMS) but not on Spotify streams.

It would make the Inguz section:


spt flc * xx:xx:xx:xx:xx:xx
# RT:{START=--start-position %s}
[spotty] -n Squeezebox -c "$CACHE$" --single-track $FILE$ --disable-discovery --disable-audio-cache $START$ | [sox] -q -t raw -b 16 -e signed -c 2 -r 44.1k -L - -t wav - | [InguzDSP] -id "xx:xx:xx:xx:xx:xx" -wav -wavo -d 24 | [flac] -cs --fast --totally-silent --ignore-chunk-sizes -

That seemed to work, according to Bob.

All working now thanks to JohnB. John has also written a new section for Inguz Plugin.pm that generates the appropriate lines in custom-convert.conf.

John, do you want to publish your modification for Plugin.pm or would you rather wait?

Bob

JohnB
2017-09-20, 10:03
Bob,

I'd rather wait for now because, from what very little I can understand of the InguzDSP source code (and it is very little), it looks as though Inguz might well accept raw pcm input (as long as it is 44100Hz, 2 channel, 16 bit, little endian) if the -wav parameter is changed to -raw. That would be a better solution IF it worked - so I would like to check things out.

(All these things take time ..... lots of time .... at least for me.)

Dela Vandaag
2018-06-17, 14:07
Could one of you direct me where in custom-convert.conf these lines have to be put? All spotify music is skipped when I try a modified custom-convert.conf.

EDIT:
It appeared that in my installation the InguzDSP-files are not in /usr/share/squeezeboxserver/Bin/i386-linux/ but in /usr/share/squeezeboxserver/Bin/x86_64-linux/. Once I edited the file InguzDSP in that directory accordingly everything works.

Cheers, Dela