Thank you for your donation!


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


Audio: Way to disable HDMI or set USB as default?
#31
(04-12-2025, 01:15 PM)Tim Curtis Wrote: @hatenick, Have you tried the "Device ready wait" setting in Audio Config?

Yes of course, but it is not applicable in my case, my RPI working forever until power off or so, and I have to close the DAC off and open at times arbitrarily.
Reply
#32
Is this the usage scenario?

1. Audio device stays on
2. Pi is powered off then at some point powered back on
3. Audio output in Moode Audio Config reverts to HDMI
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#33
(04-12-2025, 01:35 PM)Tim Curtis Wrote: Is this the usage scenario?

1. Audio device stays on
2. Pi is powered off then at some point powered back on
3. Audio output in Moode Audio Config reverts to HDMI

Well

1. RPI always on forever
2. DAC is powered on and ALSA CARD id 0 or 2 at this time depending on the first DAC power state at the RPI boot time. The index 0 or 2 does not make any difference.
3. DAC is powered off. ALSA makes the HDMI 0 audio out as index ALSA CARD 0 even if DAC was 0 beforehand. Why? I do not know? At this time moOde makes HDMI audio 0 as current output. I can see this by going to Audio in settings.
4. DAC is powered on and now it has ALSA CARD index 2 now. So I have to change it to index 2 third card from the drop down.
5. DAC is powered off and output again changes to HDMI 0 as index 0
6. DAC is powered on goto 4

I believe you have
Code:
sudo alsactl save
at some point so you have DAC is 0 always and do not have the problem? Just a wild guess? Maybe I can try to save ALSA settings, but HDMI audio off now so USB DAC is always 0 or I do not have any sound card  Smile
Reply
#34
The alsactl save command is not used.

I'm not able to repro your issue by turning off my USB DAC then turning it back on a few minutes later.
moOde 930 | Pi-3B+ | Allo Revolution DAC

1. Pi and DAC powered on, DAC is assigned ALSA card 0
Startup log
Code:
20250412 105529 worker: --
20250412 105529 worker: -- ALSA debug
20250412 105529 worker: --
20250412 105529 worker: Cards:  0:Revolution      1:vc4hdmi         2:empty           3:empty           
20250412 105529 worker:         4:empty           5:empty           6:empty           7:empty           
20250412 105530 worker: Mixers: 0:(Revolution )   1:none            2:none            3:none            
20250412 105530 worker:         4:none            5:none            6:none            7:none            
20250412 105530 worker: --
20250412 105530 worker: -- Audio configuration
20250412 105530 worker: --
20250412 105530 worker: Audio device:  0:Allo Revolution DAC
20250412 105530 worker: ALSA card:     has not been reassigned
20250412 105530 worker: MPD config:    update not needed
20250412 105530 worker: ALSA output:   USB
20250412 105530 worker: ALSA mode:     Default (plughw)
20250412 105530 worker: ALSA mixer:    Revolution 
20250412 105531 worker: ALSA volume:   62% (-48.00dB)
20250412 105531 worker: ALSA maxvol:   100%
20250412 105531 worker: ALSA loopback: off
20250412 105531 worker: MPD mixer      Hardware
20250412 105531 worker: Integ audio:   vc4-kms-v3d
20250412 105531 worker: Audio formats: S16_LE, S32_LE, SPECIAL, DSD_U32_BE
20250412 105531 worker: CamillaDSP:    off
20250412 105531 worker: CDSP volume:   -51dB
20250412 105531 worker: CDSP volrange: 60dB

Audio Config
   
Debug showing the array thats used to populate the dropdown
Code:
20250412 105801 Array
(
    [0] => Allo Revolution DAC
    [1] => Pi HDMI 1
    [2] => empty
    [3] => empty
    [4] => empty
    [5] => empty
    [6] => empty
    [7] => empty
)

2. Power off the DAC
   
Code:
20250412 105834 Array
(
    [0] => empty
    [1] => Pi HDMI 1
    [2] => empty
    [3] => empty
    [4] => empty
    [5] => empty
    [6] => empty
    [7] => empty
)

3. Power on the DAC a few minutes later
   
Code:
20250412 110032 Array
(
    [0] => Allo Revolution DAC
    [1] => Pi HDMI 1
    [2] => empty
    [3] => empty
    [4] => empty
    [5] => empty
    [6] => empty
    [7] => empty
)
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#35
(04-12-2025, 03:15 PM)Tim Curtis Wrote: The alsactl save command is not used.

I'm not able to repro your issue by turning off my USB DAC then turning it back on a few minutes later.
moOde 930 | Pi-3B+ | Allo Revolution DAC
...
After some quick checking it seems that RPI3 and RPI5 are very different in terms of both USB and HDMI in both silicon-wise and kernel-drivers-wise. This might explain the ALSA driver index jump, and moOde changing of output due to some behavior change of the drivers.
Reply
#36
It works the same on pi5.

The one used for testing below already had an Allo Boss DAC (I2S) attached.

Starting configuration: Allo Boss DAC (I2S)
   

Plug in USB DAC (assigned to ALSA card 3)
   

Set it as the Output device, play some music
   

** Reboot (USB DAC still on)

After reboot (dynamic ALSA card reassignment 3 -> 0)
Play some music
   

Unplug USB DAC (ALSA card empty)
   

Plug USB DAC back in after some time
Play some music
   
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#37
(04-12-2025, 07:59 PM)Tim Curtis Wrote: It works the same on pi5.

...

First of all this problem is not that important at all. But here my findings just for the sake of it.

After understanding RPI5 should not be the main problem, on my system I enabled the HDMI 0 and 1 audio back, at this point DAC is at 0, HDMI 0 is at 1, and HDMI 1 is at 2, and enabled the debug logs. Now I close the DAC. Somehow HDMI 0 is 0, and HDMI 1 is 1 now. I did not check at that point if CARD index changed after the log line 

Code:
20250413 160311 worker: ALSA card:     is empty, reconfigure to HDMI 1

i.e. moOde caused it? or ALSA did it?, but somehow it is changed after all.

I believe the culprit is moOde trying its best to find a working sound card. Here is the relevant part of /var/moode.log. If possible this retrying can be disabled and the problem would go away for the same card index, but it would not be correct for ALSA index jump. To make correct for it I think moOode should drop card index usage and use the card names in the configurations, like (plug)hw:CARD=DX9,DEV=0; instead of (plug)hw:0,0. Since when the meaning of index 0 changes, the output changes. It would also be best if it allowed other plugin names like dmix, etc. I may be asking too much  Smile .

Code:
pi@moode:~ $ tail -f /var/log/moode.log
....
20250413 160211 worker: Mixers: 0:none            1:none            2:none            3:none
20250413 160211 worker:         4:none            5:none            6:none            7:none

20250413 160211 worker: Audio device:  0:DX9
20250413 160211 worker: ALSA card:     is empty, retry 1
20250413 160216 worker: ALSA card:     is empty, retry 2
20250413 160221 worker: ALSA card:     is empty, retry 3
20250413 160226 worker: ALSA card:     is empty, retry 4
20250413 160231 worker: ALSA card:     is empty, retry 5
20250413 160236 worker: ALSA card:     is empty, retry 6
20250413 160241 worker: ALSA card:     is empty, retry 7
20250413 160246 worker: ALSA card:     is empty, retry 8
20250413 160251 worker: ALSA card:     is empty, retry 9
20250413 160256 worker: ALSA card:     is empty, retry 10
20250413 160301 worker: ALSA card:     is empty, retry 11
20250413 160306 worker: ALSA card:     is empty, retry 12
20250413 160311 worker: ALSA card:     is empty, reconfigure to HDMI 1
20250413 160312 worker: MPD config:    updated
20250413 160312 worker: ALSA output:   HDMI
20250413 160312 worker: ALSA mode:     IEC958 (iec958)
20250413 160312 worker: ALSA mixer:    PCM
....

Now I know it is "not" the same thing, but @Tim Curtis I think you can fire this behavior like this:

1) Make it DAC at index 0, HDMI 0 at 1, and HDMI 1 at 2, (on RPI 3 HDMI 1 would not be present of course)
2) Select DAC as output in moOde
2) Power off DAC, and wait some short of a time
3) Reboot RPI (DAC NO open) when it is booted HDMI is at 0, and 1
4) At this stage moOde waits for configured time and would try the card change I believe.
Reply
#38
Yes if you reboot the pi while the USB DAC is off the startup process will fall back to HDMI after the "Device ready wait" has expired. The default wait period is 1 min but can be set to 2 or 3 mins.

In your post 33 describing the steps you stated "1. RPI always on forever" which is the scenario I tested.
https://moodeaudio.org/forum/showthread....1#pid63101

I think there is another scenario where at some time after the fallback to HDMI has occurred, the USB Audio device is turned on or plugged back in and rather than having to open Audio Config and manually set the Output device it is  automatically set when the USB Audio device is detected. Its could be doable but I'm not sure how much work is involved.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#39
With my Pi 4B and Moode 9.3, if I power up without the USB DDC plugged in, it will default to HDMI on 0 and 1.   Wait a few minutes and plug in the USB DDC, and shows up a 3: SMSL USB Audio.  The 0: HDMI is still the default, and have to change it in the Audio config.  If you just try to play, a warning pops up saying no device detected on HDMI, and will not play or see the USB Audio at that time and switch.  I assume that if the HDMI was connected to a display, it would just go on its merry way.

It didn't work that way in 8.x.x, and thanks for the explaination why.  

A possible work-around, H/W solution for the OP, is using a DDC and connecting to the DAC via SPDIF (coax or optical).  The SMSL PO100, $40, only draws 300mA from the USB bus.  Just a suggestion.
Reply
#40
(04-13-2025, 04:32 PM)SerbJ Wrote: With my Pi 4B and Moode 9.3, if I power up without the USB DDC plugged in, it will default to HDMI on 0 and 1.   Wait a few minutes and plug in the USB DDC, and shows up a 3: SMSL USB Audio.  The 0: HDMI is still the default, and have to change it in the Audio config.  If you just try to play, a warning pops up saying no device detected on HDMI, and will not play or see the USB Audio at that time and switch.  I assume that if the HDMI was connected to a display, it would just go on its merry way.

It didn't work that way in 8.x.x, and thanks for the explaination why.  

A possible work-around, H/W solution for the OP, is using a DDC and connecting to the DAC via SPDIF (coax or optical).  The SMSL PO100, $40, only draws 300mA from the USB bus.  Just a suggestion.

What do you have set for "Device ready wait"?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: