Posts: 4
Threads: 0
Joined: Jan 2025
Reputation:
0
I agree that this is just mildly annoying, so if there is no easy way to fix it, I'll be able to live with it quite well. But it is slightly odd behavior (and didn't happen until a while ago), so I was wondering whether it can be fixed.
And yes, its just annoying because I'm inattentive/stupid. Of course I realize that there is no music right away. But that usually happens when I just got home and wonder where to put the groceries, why there is such a mess here or try to keep the kids from starving. So I accept it as a fact of life until I realize that it may not require a complicated solution and try to switch output a few hours later.
So I can solve it by learning or could follow your suggestion to always switch on things in the same order. But that's not as easy as it sounds, since I feed the USB output right into an amp. Switching the amp off whenever possible is good for the environment, while I'm too lazy to do that with the RPi that runs moode. That's all good and fine, but not thinking about things is a luxury that's nice to afford, so I thought I'd ask.
Thanks for your response and the suggestion!
Posts: 13,845
Threads: 314
Joined: Mar 2018
Reputation:
563
(01-02-2025, 11:51 AM)nikolas Wrote: Sorry to get back to an old thread, but I'm trying to see whether there is a good solution to the issue that remained unsolved here: If moode restarts while the USB output device is off, it resets the output to HDMI. This neither changes when the USB device is started and once output is set to HDMI, it also doesn't seem to revert to USB when restarting moode while the USB output is on. So the only way to fix this seems to be to reset output to USB manually. That works until the next reboot (or longer if the USB device is on during boot). I am just wondering whether there is a smarter way to fix this. Maybe moode could remember the device or one could set output to USB by default and moode could keep looking for it. Or if there is a way to change output from the command line, I could just run that every once in a while.
Just wondering whether there is a simple solution. Its simple enough to fix manually and doesn't happen too often. But when it happens, I always spend a few hours without music before I realize that I just need to set output back to USB. Thank you for your thoughts and all the work you put into this project - I've been enjoying it for a long time already!
It might be possible to modify the startup section that does audio device configuration to restore a previously unavailable USB audio device but I'd have to determine how much work is involved. One challenge is how to handle the case where even after plugging the USB DAC back in the user in fact wants to use HDMI or an I2S DAC.
I'll ad to the TODO list to investigate.
Posts: 4
Threads: 0
Joined: Jan 2025
Reputation:
0
Great, thank you! As Nutul pointed out, this is about me being lazy, so I agree that it depends on how much work it is on your end. If there is any way I can help, I'd be happy to do so.
As for the challenge you mention, couldn't that be solved by reverting to the last output that the user picked? That is, to store the ID of the device the user picked somewhere and have moode check at startup whether that device is there. If not, pick hdmi/whatever (but don't overwrite the ID and maybe check whether the device has reappeared every once in a while). If yes, pick that device. That way I think it would only fail if a user disconnects the device they chose, lives happily with the default replacement and then plugs back in the default device.
I'm clearly overthinking a minor issue. But if you manage to fix it, that would be appreciated. If not, all your other work is still greatly appreciated, thank you!
Posts: 3
Threads: 1
Joined: Dec 2024
Reputation:
0
01-02-2025, 09:47 PM
(This post was last modified: 01-02-2025, 09:48 PM by Stampede.)
Hi,
In one of the rpi4 images I build with buildroot, I faced the same problem that the init system assigened the USB devices and HDMI in random order.
I added file in /etc/modprobe.d to force USB devices to card 0. Not sure about the initsystem of MoOde, but this could work too.
Code: options snd slots=snd-usb-audio,vc4
Posts: 6
Threads: 2
Joined: Dec 2024
Reputation:
0
Probably not much use if you want to use Moode but some Raspberry Pi devices can operate as USB slave, which could fix the problem.
https://superuser.com/questions/1565915/...ave-device
also
audio, at least, can be turned off at HDMI with the regular Raspberry Pi OS. No idea if this configuration file crosses over to Moode.
Code: dtoverlay=vc4-kms-v3d,noaudio
https://www.raspberrypi.com/documentatio...g_txt.html
Posts: 4
Threads: 0
Joined: Jan 2025
Reputation:
0
Thank you for the additional thoughts and sorry for being slow - I wanted to try them to see what happens:
I can't use the Raspberry Pi as a USB slave (or at least think I can't), because it does some other things and should stay on when the amp switches off. Among others, it switches the amp back on via openhab. So that also makes it difficult for me to switch the amp on before switching the Pi on. And by difficult I mean that I'd have to resort to 20th century methods such as finding the remote control or even getting up from the sofa.
I tried to switch off HDMI using your code, HebRob. Somewhat interestingly, that caused moode to detect one HDMI device instead of two. So something happened, but it did not solve the problem. I'm not sure whether it disabled audio on both HDMI ports and moode just keeps one or whether it only disabled one (not sure how to test this, since I don't have anything connected via HDMI).
Fixing the order of devices as Stampede suggested worked, now USB is always device 0. But when the amp is off, it is reported as empty and moode picks the HDMI port nevertheless. I can neither switch to USB when the amp is still off, nor does it switch to USB when the amp goes back on. Once it changed to HDMI, I have to change it back manually.
Yet now I'd in principle be able to write a script that switches output back to USB. Is there some way to check what output moode uses and to change it via the command line? Then I could try to have it check and change it every once in a while. Its still a bit tricky, since the script would have to be triggered by something like the appearance of a new USB device. I guess that's possible, but beyond my programming capabilities. So it may be fun to try...
If you have any further ideas, happy to try them. Thank you!
Posts: 5
Threads: 2
Joined: Dec 2024
Reputation:
0
01-19-2025, 07:59 PM
(This post was last modified: 01-19-2025, 08:00 PM by abuelomg.
Edit Reason: Mentioned that scanning for audio sources does not work
)
I have the same problem with a McIntosh MA9000. The MoOde box is normally powered on permanently, while the McIntosh is powered off and back on every day.
After a power failure (Reboot of the Raspberry Pi 4) while the McIntosh is powered off, the USB audio gets lost and the Pi falls back to HDMI audio.
Powering on the McIntosh at this stage does not help, I can't select USB audio from the menus - "scan" does not work. I have to reboot the Raspberry Pi while the McIntosh is powered on and only after the reboot I can then change audio output from HDMI back to USB audio output again.
No problem for me, but to other family members this procedure is somewhat awkward.
Posts: 256
Threads: 16
Joined: Apr 2018
Reputation:
10
01-19-2025, 10:20 PM
(This post was last modified: 01-19-2025, 10:21 PM by philrandal.)
Same issue for me as for abuelomg above. Switched my SMSL USB DAC to another source, rebooted Moode, switched source back, only to find HDMI selected. Needed another reboot with the DAC connected to get any output. I wish there was an easy workaround for this, but I suspect it's not possible.
Posts: 13,845
Threads: 314
Joined: Mar 2018
Reputation:
563
I'm sure it's possible but the different USB scenarios have to be tested to see initially what works and what doesn't and for those scenarios where we end up in a "not working" state try to figure out why. Is it some sort of USB hot-plug issue or something else?
For example my only USB DAC is an Allo Revolution. It reappears nicely in the Audio output list after the somewhat artificial scenario below so from my perspective this particular USB device and usage scenario are OK.
1. Pi running, USB DAC connected and configured as the audio output
2. Power off or unplug USB DAC
3. Reboot Pi
4. Audio output is auto-configured to HDMI since USB DAC is "gone"
- maybe this is what user wants?
5. Power on or plug in USB DAC, wait a few moments
6. Menu > Configure > Audio
7. USB DAC appears in the Audio output list
8. Select USB DAC and start playing music
Since I don't have any of the equipment mentioned in the two prior posts its not possible for me do any diagnosis whatsoever on those particular scenarios.
Maybe a dev with those types of scenarios and interest in working on them will help out :-)
Posts: 1,364
Threads: 24
Joined: Jun 2022
Reputation:
46
(01-19-2025, 11:44 PM)Tim Curtis Wrote: 5. Power on or plug in USB DAC, wait a few moments It seems to me that after this operation, there is still no USB device to be chosen; that is, your point no. 7 is not reached.
I think it is my case as well... need to test this.
|