Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Idea: Automatically suspend USB DACs when idle
#11
(09-28-2022, 03:56 PM)Tim Curtis Wrote: Just keep in mind that edge case usage scenarios need significant demand in order to consider adding code to moOde because that code will become yet another vector for support and troubleshooting.
That's basically why I was suggesting the hook idea, it would have provided a nice extension point for interested/expert users to call their own stuff without adding too much complexity at moode side and also being far away from any hardware problems. Unfortunately it seems like there is no place to put something like this because some renderers bypass moode completely if I understood that right.
The problem to be solved, at least from my experiments, is that some renderer tries to open the alsa device while USB is powered off and gets an error because there is no easy way to intercept such a call and make it wait until the USB is powered up again. So my current idea (without having any kind of knowledge of alsa) is having some kind of virtual device in alsa that's always available (pointing to loopback or something) and as soon as its used the USB can be powered on and then point the virtual device to the USB. Maybe something like this works but I have no idea if that's even possible with alsa.

(09-28-2022, 04:05 PM)TheOldPresbyope Wrote: Given the difference in behavior among various RPi models I think turning the internal hub on and off likely is a non-starter for most users but again that's just me.

When I said "behave consistently" I was referring to the DAC display-blanking. If it blanks when using the MPD renderer, it should blank when using the others and v.v.

I too was thinking about ALSA as a possible layer to work with but I have too superficial an understanding of its internals to comment.
I don't actually know if there is much difference between the models as I would rely on uhubctl and its hardware support. So basically get the usb port of the currently selected output and turn this off/on. Of course there must be a warning for the internal RPi hub that every port is disabled. Also this feature in general should be somehow marked as "for experts" or unstable or something along those lines in the UI.
I am fully on board with the consistency argument. I just thought there would be some kind of callback or whatever to moode code in every case when music is playing mainly because of the UI. But that doesn't seem to be the case which basically kills the hook idea. I am still positive however that something involving alsa could be possible.

(09-28-2022, 04:15 PM)Tim Curtis Wrote: Another option is to just use a bn-link wireless outlet to turn the DAC on/off. They are inexpensive and super reliable. I use them in my Media Room :-)

https://www.amazon.com/dp/B01NASZ0UM?psc...ct_details

In my case unfortunately the DAC is USB-powered so this is not an option Wink
Reply


Messages In This Thread
RE: Automatically suspend USB DACs when idle - by sll552 - 09-29-2022, 07:22 AM

Forum Jump: