You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have homeassistant integrations combined with Snapcast to turn on amps when the relevant client becomes active, and off after an idle timeout. I have a Pi hooked up to a network AVR over HDMI, which works perfectly for this as the AVR is always IDLE and the HDMI output is always recognised by the Pi.
I also have a Pi with a class D amp + DAC which is powered on and off by a zigbee smart plug, which the Pi is connected to over USB. If the pi boots (or snapclient restarts) while the amp is not powered, the USB audio sink is not available and snapclient is not able to use the specified sink (-s 16 when its plugged in and listed with snapclient -l.
Thoughts I've had:
set alsa to 'default' to USB when its available, and set snapclient to send to default sink - can't find much online about this
create a udev rule or similar 'trigger' that runs a simple script when the USB device becomes available / unavailable. This could set the alsa default sink to point to the USB device, or could change the snapclient config and trigger a restart of the snapclient systemd service.
attempt some wizardry with pulse, keeping a consistent sink available at all times, which the snapclient config points to, but redirecting this to the USB device when its available - not sure if this is possible but I always find alsa is easier to work with than pulse.
It's important that the snapclient points to a valid device when the USB is not plugged in, even though the sound can't go anywhere, because if not the snapclient falls over. This means I can't select an input to be able to make snapclient 'active' which triggers the automation to turn on the amp.
I'm probably missing something really simple here, any suggestions are appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have homeassistant integrations combined with Snapcast to turn on amps when the relevant client becomes active, and off after an idle timeout. I have a Pi hooked up to a network AVR over HDMI, which works perfectly for this as the AVR is always IDLE and the HDMI output is always recognised by the Pi.
I also have a Pi with a class D amp + DAC which is powered on and off by a zigbee smart plug, which the Pi is connected to over USB. If the pi boots (or snapclient restarts) while the amp is not powered, the USB audio sink is not available and snapclient is not able to use the specified sink (
-s 16
when its plugged in and listed withsnapclient -l
.Thoughts I've had:
It's important that the snapclient points to a valid device when the USB is not plugged in, even though the sound can't go anywhere, because if not the snapclient falls over. This means I can't select an input to be able to make snapclient 'active' which triggers the automation to turn on the amp.
I'm probably missing something really simple here, any suggestions are appreciated!
Beta Was this translation helpful? Give feedback.
All reactions