It Is possibile to do this?
I need to start or restart squeezelite when i Power on my USB dac.
Because if dac Is off squeezelite dont start and i need to start It manualy.
By udev event?
Results 1 to 10 of 188
-
2021-01-13, 02:31 #1
- Join Date
- Feb 2020
- Posts
- 85
Start/restart squeezelite when plug-in USB dac
-
2021-01-13, 04:27 #2
- Join Date
- Apr 2005
- Location
- UK/London
- Posts
- 3,641
Paul Webster
http://dabdig.blogspot.com
Author of "Now Playing" plugins covering Radio France (FIP etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland
-
2021-01-13, 04:48 #3
I'm not sure this will help in this case. That tweak means that once Squeezelite has started, it doesn't mind the USB DAC disappearing - it will output to it again without intervention once the DAC reappears. But in my experience Squeezelite will still fail to start at boot time if the DAC isn't there.
That tweak MAY help the OP if he can find a way to force Squeezelite to start regardless of whether the DAC is present (I'd be interested in such a solution too) - that tweak may then mean that as soon as the DAC appears Squeezelite will then be happy to output to it.
-
2021-01-13, 04:54 #4
Try enabling the Close output setting (-C) option with a value of 5.
It's suppose to allow squeezelite to start and wait for the device to appear.
You need to use the hw:CARD= device with the -o option not plughw:CARD=Ralphy
1-Touch, 5-Classics, 3-Booms, 2-UE Radio
Squeezebox client builds donations always appreciated.
-
2021-01-13, 05:14 #5
- Join Date
- Feb 2020
- Posts
- 85
Not works.
Now, my dac Is Power off. Squeezelite Is down. I try to start squeezelite by SSH to Copy the output:
tc@Stereo:~$ /usr/local/bin/squeezelite -n "Stereo" -o hw:CARD=R20,DEV=0 -a 80:4::1: -C 5
[13:10:54.592723] test_open:281 playback open error: No such device
[13:10:54.592815] output_init_common:394 unable to open output device: hw:CARD=R20,DEV=0
tc@Stereo:~$
As you see, if the dac Is off, squeezelite dont accept "-o hw:card....." because It not exist. If i Power on dac It works.
I'm thinking an udev rule that start squeezelite when dac Is on...
-
2021-01-13, 05:15 #6
Thanks Ralphy - that's done the trick in my case. With the output set to hw:CARD=DAC,DEV=0, and the -C 5 option, Squeezelite starts up even if the DAC is off, and starts outputting to it as soon as the DAC appears. It's also equally robust if I should disconnect and then reconnect the DAC while it's playing.
-
2021-01-13, 05:31 #7
@corrobor - you posted just before me, and evidently have different results. I think my case is slightly different, in that my USB DAC is one of several inputs built into my amp (a Hypex DLCP). Previously, if I had the amp switched to 'optical' instead of 'USB' while the Pi was booting, the DAC would not be found and Squeezelite would not start. But now I find that I can even do without the '-C 5' option. The difference is that I'm now using 'hw:CARD=DAC,DEV=0' under pCP7, whereas previously I was using 'front:CARD=DAC,DEV=0' under pCP6. Something has clearly changed, for the better in my case.
-
2021-01-13, 06:21 #8
Using an ALSA output prefix other than hw: with the -o option "hides" some or all of the physical capabilities of the audio hardware from squeezelite behind the ALSA subsystems.
Ralphy
1-Touch, 5-Classics, 3-Booms, 2-UE Radio
Squeezebox client builds donations always appreciated.
-
2021-01-13, 10:11 #9
- Join Date
- Feb 2020
- Posts
- 85
-
2021-01-14, 02:23 #10
- Join Date
- Feb 2020
- Posts
- 85