mherger wrote: 
> > Querying LMS' API will give you the stream's sample rate as received
> by
> > LMS, which isn't necessarily the same as the one received by
> squeezelite
> > (unless you make sure LMS never transcodes).
> 
> I believe bidule needs to give us some more context about what he's 
> trying to do. It sounds as if he needed the sample rate or whatever to 
> _initialize_ the streaming. In which case getting it from the status 
> query would likely be too late.
> 
> -- 
> 
> Michael
Hello Michael, thank you for helping.
In the mean time I figured that I had to install the JQ command-line
JSON processor to make your script working

Code:
--------------------
    apt-get install -y jq
--------------------

Then with :

Code:
--------------------
    curl -X POST -sd 
'{"id":0,"params":["10.144.1.2",["status",0,1,"tags:T"]],"method":"slim.request"}'
 http://10.144.1.1:9000/jsonrpc.js | jq '.result.playlist_loop[0].samplerate'
--------------------

The system returned :
"48000"
Perfect !

To answer your specific question:
I'm trying to use the Samplerate information in order to switch a DAC
hardware clock on the fly.
For the time being the way I want to test it is this way:
Getting the sample rate each time a new track is starting and from that
select the right hardware clock with a GPIO flag.

However, you are right that it will probably be too late that way.

A solution may be to add a small RAM FiFO buffer before playing on the
hardware.
Something like asking Squeezelite to send the stream to a RAM FiFO and
use the same GPIO flag as before to read the FIFO with sox. 

Someone may have another simpler idea.

Any way I go step by step
Step 1 is done
Step 2 is to use "Event Trigger" to execute the above JSON commands
triggered by LMS on each new track
No success yet
Step 3 test Samplerate and change GPIO
Step 4 use the GPIO for the hardware clock selection


Question would it be possible to integrate the samplerate test inside
the Event Trigger config file ?

Jean


------------------------------------------------------------------------
bidule's Profile: http://forums.slimdevices.com/member.php?userid=15337
View this thread: http://forums.slimdevices.com/showthread.php?t=113499

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to