[SlimDevices: Plugins] squeezelite output to file for snapcast

2020-12-08 Thread gekoch


I'm currently running a snapserver which plays the files that are stored
in the /tmp/snapfifo file.
So you can 
Code:

cat someWaveFile.wav > /tmp/snapfifo

 and then it plays the song to all snapcast clients that are currently
connect to this server.

I tried: 
Code:

squeezelite -o - > /tmp/snapfifo

 but I only got some noise while playing a song through LMS

Has someone already got this working?



gekoch's Profile: http://forums.slimdevices.com/member.php?userid=71033
View this thread: http://forums.slimdevices.com/showthread.php?t=113394

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] squeezelite output to file for snapcast

2020-12-08 Thread bpa


gekoch wrote: 
> I'm currently running a snapserver which plays the files that are stored
> in the /tmp/snapfifo file.
> So you can > 
Code:

  >   > cat someWaveFile.wav > /tmp/snapfifo

> >  and then it plays the song to all snapcast clients that are currently
> connect to this server.
> 
> I tried: > 
Code:

  >   > squeezelite -o - > /tmp/snapfifo

> >  but I only got some noise while playing a song through LMS
> 
> Has someone already got this working?

IIRC what is saved is a PCM stream.  You need add a WAV header to tell
any player the format of the PCM stream such as sample rate , sample
size, endian, signed/unsiged etc.



bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=113394

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] squeezelite output to file for snapcast

2020-12-08 Thread Roland0


gekoch wrote: 
> I'm currently running a snapserver which plays the files that are stored
> in the /tmp/snapfifo file.
> 
> I tried: > 
Code:

  >   > squeezelite -o - > /tmp/snapfifo

> >  but I only got some noise while playing a song through LMS
> 

Try setting both squeezelite and snapserver to the same (fixed) sample
size and sample rate (e.g. 16 bit / 44100 hz)



'Various SW' (https://www.nexus0.net/pub/sw/): Web Interface | TUI |
Playlist Editor / Generator | Music Classification | Similar Music |
Announce | EventTrigger | Chiptunes | LMSlib2go | ...
'Various HowTos' (https://www.nexus0.net/pub/documents/LMS/): build a
self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

Roland0's Profile: http://forums.slimdevices.com/member.php?userid=56808
View this thread: http://forums.slimdevices.com/showthread.php?t=113394

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] squeezelite output to file for snapcast

2020-12-08 Thread bpa


Roland0 wrote: 
> Try setting both squeezelite (options -a and -r) and snapserver (conf
> file) to the same (fixed) sample size and sample rate (e.g. 16 bit /
> 44100 hz)
The OP example shows "cat" of a file with WAV header. If OP needs a WAV
header the "-a" and "-r" will not provide it. Also I think when output
is to a file "-o"  the "-a" option is not required as it is ALSA
specific.



bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=113394

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] squeezelite output to file for snapcast

2020-12-08 Thread Roland0


bpa wrote: 
> The OP example shows "cat" of a file with WAV header. If OP needs a WAV
> header the "-a" and "-r" will not provide it. 
> 
Don't thing a wav header is required:

Snapcast docs wrote: 
> 
> [stream]
> # stream URI of the PCM input stream, can be configured multiple times
> # Format:
> TYPE://host/path?name=NAME[&codec=CODEC][&sampleformat=SAMPLEFORMAT]
> stream = pipe:///tmp/snapfifo?name=default
> 
> The sampleformat is a triple of ::,
> e.g. 44100:16:2.
> The PCM samples (bit depth) must be encoded signed, little endian in 8,
> 16, 24, or 32 bit, where 24 is expected to be encoded in the lower three
> bytes of a 32 bit word.
> 

bpa wrote: 
> 
> Also I think when output is to a file "-o"  the "-a" option is not
> required as it is ALSA specific.
> 
man page says:

man squeezelite wrote: 
> -a 
> Specify parameters used when opening an audio output
> device.
> When the output is sent to standard output, the value can
> be 16, 24 or 32, which denotes the sample size in bits. Little Endian
> only.



'Various SW' (https://www.nexus0.net/pub/sw/): Web Interface | TUI |
Playlist Editor / Generator | Music Classification | Similar Music |
Announce | EventTrigger | Chiptunes | LMSlib2go | ...
'Various HowTos' (https://www.nexus0.net/pub/documents/LMS/): build a
self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

Roland0's Profile: http://forums.slimdevices.com/member.php?userid=56808
View this thread: http://forums.slimdevices.com/showthread.php?t=113394

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] squeezelite output to file for snapcast

2020-12-09 Thread bpa


Roland0 wrote: 
> 
> man page says:> > > 
> > Quote Originally Posted by man squeezelite
> > -a 
> > Specify parameters used when opening an audio output device.
> > When the output is sent to standard output, the value can be 16, 24 or
> > 32, which denotes the sample size in bits. Little Endian only.> > 

OK - I only checked the "-h" output.



bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=113394

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] squeezelite output to file for snapcast

2020-12-13 Thread gekoch


thx for the help 
Code:

-a 16

 was the only thing to add and its now working!



gekoch's Profile: http://forums.slimdevices.com/member.php?userid=71033
View this thread: http://forums.slimdevices.com/showthread.php?t=113394

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] squeezelite output to file for snapcast

2022-03-01 Thread gekoch


now after it has worked for almost an year I have a problem with the
filesize of the /tmp/snapfifo.
It gets insanely big as big as the hardrive allows it (several GB)

How can I stop it from growing that big in a matter of seconds after I
launched:

Code:

/usr/bin/squeezelite -s 192.168.1.47 -a 16 -o - > /tmp/snapfifo




gekoch's Profile: http://forums.slimdevices.com/member.php?userid=71033
View this thread: http://forums.slimdevices.com/showthread.php?t=113394

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] squeezelite output to file for snapcast

2022-03-01 Thread bpa


gekoch wrote: 
> now after it has worked for almost an year I have a problem with the
> filesize of the /tmp/snapfifo.
> It gets insanely big as big as the hardrive allows it (several GB)
> 
> How can I stop it from growing that big in a matter of seconds after I
> launched:
> > 
Code:

  >   > /usr/bin/squeezelite -s 192.168.1.47 -a 16 -o - > /tmp/snapfifo

> > 

IIRC if LMS is playing nothing to the player,  squeezelite when
outputting to a file will output silence (probably bytes of zeroes as
PCM)  as quick as fast as the destination will accept.

SO What has changed on the LMS playing side ? Are there no files to play
>



bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=113394

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] squeezelite output to file for snapcast

2022-03-01 Thread gekoch


on LMS there is a radio station playing. But after 15s the snapfifo file
is around 10GB and the system is not reacting anymore...
Does squeezlite fill the snapfifo File with junk?



gekoch's Profile: http://forums.slimdevices.com/member.php?userid=71033
View this thread: http://forums.slimdevices.com/showthread.php?t=113394

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] squeezelite output to file for snapcast

2022-03-01 Thread bpa


gekoch wrote: 
> on LMS there is a radio station playing. But after 15s the snapfifo file
> is around 10GB and the system is not reacting anymore...
> Does squeezlite fill the snapfifo File with junk?

Squeezelite cannot just generate junk - it has to play audio all the
time. It outputs the audio from its source or silence (which is a stream
of PCM bytes of data) if there is nothing from the source. 

Use "tee" to see what is being put into fifo.
Use squezelite logging to see exactly what is going on.



bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=113394

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] squeezelite output to file for snapcast

2022-03-01 Thread gekoch


hmm I was able to solve it...

as soon as snapserver started and no /tmp/snapfifo was available
snapserver did create a file with "snapserver" as owner and group

when I then tried to launch squeezlite with:

Code:

/usr/bin/squeezelite -s 192.168.1.47 -n evita -a 16 -o - > /tmp/snapfifo


I would get an Persmission denied. 
When I stop snpaserver and let it run from the terminal with root
everything is working as excepted.

So what is the best way to start squeezelite also under the "snapserver"
owner so it has permission to write to the /tmp/snapfifo file?
Or should I both run as root?



gekoch's Profile: http://forums.slimdevices.com/member.php?userid=71033
View this thread: http://forums.slimdevices.com/showthread.php?t=113394

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] squeezelite output to file for snapcast

2022-03-01 Thread bpa


gekoch wrote: 
> So what is the best way to start squeezelite also under the "snapserver"
> owner so it has permission to write to the /tmp/snapfifo file?
> Or should I both run as root?

In principle, running application as root is not a good idea as it means
things are not being done properly and could end up very badly.

I think you need to read up about running services which I don't know
much but you probably need to create a script  where the sequence of
commands is done but with each step tested. 

A simpler approach might be to check  - if it worked before and not now
- what has changed ?



bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=113394

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins