MPD icon indicating copy to clipboard operation
MPD copied to clipboard

(Reopen) "always_on" not working for ALSA devices

Open Cleric-K opened this issue 2 years ago • 6 comments

I'm not sure if #1599 gets attention since it is closed but the always_on option currently doesn't work for ALSA. I have described in the last post of the issue that simple change in the code makes it work. Is it intended that ALSA doesn't support always_on? From my experience everything works perfectly well with the above mentioned code change.

Cleric-K avatar Sep 21 '22 15:09 Cleric-K

Yes, correct "always_on"does not work, reports as "closed". If this cannot cannot be controlled from within mpd it would preferable to remove the option.

GK-774 avatar Sep 25 '22 21:09 GK-774

Yes, in the way the code is compiled right now it does not work. But as explained in the linked issue, by modifying AlsaOutput::Pause() to return true, everything works great, as far as my tests have gone. So my question is why don't we simply change the return value of the method and make always_on work with ALSA? Is there something I'm overlooking? Maybe something that will break down in this way, something that I haven't covered in my tests?

Cleric-K avatar Sep 26 '22 07:09 Cleric-K

If you simply return "true", always_on "no" (or having it not defined at all) would not work, it would be "on" in any case, no? Or have I misunderstood this?

GK-774 avatar Sep 27 '22 08:09 GK-774

Please disregard my last comment. Just tried it and yes, this makes it work as expected.

GK-774 avatar Sep 27 '22 09:09 GK-774

Well, no. It keeps the output open but consumes 100% cpu when stopped. With always_on "no" it behaves normal. It´s probably not a good idea at all at least not for an USB audio device.

GK-774 avatar Sep 27 '22 12:09 GK-774

Hm, you are right. Since I use the device only for audio player I haven't noticed the high cpu. I'll try to look through the code if I can spot something. Most certainly the high cpu comes from some code that keeps looping as fast as the cpu allows.

Cleric-K avatar Sep 27 '22 13:09 Cleric-K