Analogue audio output gone with v136/JustBoom [SOLVED]

Hi,

can’t bring back my analogue audio since v136 with JustBoom included.
OrangePi PC using ympd as a player.

When I try to launch alsamixer, I get an “cannot open mixer: Invalid argument”.
Used to work fine before.
When I enable the equalizer in dietpi-config, I can launch alsamixer from there but it doesn’t keep my settings.
Anybody else who already found a workaround?

Thanks
Frans

Hi Frans,

Thanks for letting us know.

Is h3-analogue the selected soundcard in dietpi-config > audio options > soundcard ? (default is HDMI)

When I enable the equalizer in dietpi-config, I can launch alsamixer from there but it doesn’t keep my settings.

Which user account are you logged in as?
Can you also please paste results of the following:

ls -lha "$HOME"

yes, h3-analogue is the selected soundcard.
I’m logged in as root, ls output below.
Thank you for caring!

root@DietPi:~# ls -lha “$HOME”
total 88K
drwx------ 8 root root 4.0K Nov 6 21:33 .
drwxr-xr-x 23 root root 4.0K Sep 11 19:47 …
-rw-r–r-- 1 root root 824 Nov 6 21:33 .alsaequal.bin
-rw------- 1 root root 8.2K Nov 8 11:45 .bash_history
-rw-r–r-- 1 root root 591 May 6 2016 .bashrc
drwxr-xr-x 6 root root 4.0K Sep 9 22:41 .cache
-rwxr-xr-x 1 root root 496 Sep 11 23:47 checkusb
drwx------ 9 root root 4.0K Sep 11 17:13 .config
drwx------ 3 root root 4.0K Sep 9 21:32 .dbus
drwxr-xr-x 2 root root 4.0K Sep 9 21:25 Desktop
-rwxr-xr-x 1 root root 192 Sep 11 15:46 .gtk-bookmarks
drwx------ 4 root root 4.0K Sep 9 22:41 .mozilla
-rw------- 1 root root 12 Oct 13 22:10 .nano_history
-rw-r–r-- 1 root root 140 Nov 19 2007 .profile
-rw-r–r-- 1 root root 0 Sep 11 17:55 .selected_editor
drwx------ 4 root root 4.0K Sep 9 23:27 .thumbnails
-rw------- 1 root root 200 Sep 11 17:11 .Xauthority
-rw------- 1 root root 14K Sep 11 23:11 .xsession-errors

Hi

You found a bug, nice one :slight_smile:

Ok, you’ll need to grab the updated function script, copy and paste all into term:

wget https://github.com/Fourdee/DietPi/raw/1d14025c3aece5d39465867baec4c63a4fc62767/dietpi/func/dietpi-set_hardware -O /DietPi/dietpi/func/dietpi-set_hardware
dietpi-services stop
/DietPi/dietpi/func/dietpi-set_hardware soundcard h3-analogue
dietpi-services start

Sound should now be functional through 3.5mm analogue.

Interesting, onboard sound supports 192khz/32bit output, but no where near the sound quality of Odroid HiFi shield / JustBoom card:

root@DietPi:~# cat /proc/asound/card*/pcm0p/sub0/hw_params
access: MMAP_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 192000 (192000/1)

I’d rather say I stumbled upon something not working as intended and you found the bug.
Analogue audio is working again, thank you :smiley:

Frans

BTW, my output is not that talkative:
root@DietPi:~# cat /proc/asound/card*/pcm0p/sub0/hw_params
closed
closed

Hi Frans,

Command only works when a output stream is active (eg: playing audio).

Ah, I see, thank you!

Hello!
Has this been fixed?
I’ve installed LMS/Squeezelite on my OPi PC and I also receive the error:

root@DietPi:~# alsamixer 
cannot open mixer: Invalid argument

I can hear sound from the 3.5mm jack after modifying the /etc/asound.conf file, but still I would like to set up alsamixer properly.
I have updated tu v137 but it still gives the same error.
Should I follow the steps described above too?
Thanks

This has been fixed (at least for me).
The patch was built for v136 and fixed the issue.
After updating my installation from the patched v136 to official v137, my analogue audio is still working.

Analogue audio works for me too, but alsamixer still gives that error. :open_mouth:

Yep, think we did a little whoopsie for v136.

edit /etc/asound.conf and change ctrl.!default to ctl.!default. Save changes, alsamixer should now fire up.

Same here with alsamixer not starting on 137.
My /etc/asound.conf already is ctl’ed:

pcm.!default {
type hw
card 0
device 0
}
ctl.!default {
type hw
card 0
device 0
}

OrangePi PC? Any chance you can run aplay -l and paste results?

Yes, mine is an OrangePi PC.

This is the result of aplay -l:
**** List of PLAYBACK Hardware Devices ****
card 0: audiocodec [audiocodec], device 0: SUNXI-CODEC sndcodec-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: sndhdmi [sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

Regards
Frans

Yep, it seems to do that with all PCM52xx chips (possibly at kernel level). The following boards all fail to load alsamixer:

  • Allo Piano DAC
  • JustBoom DAC HAT
  • Odroid Hifi Shield 2

Although, amixer appears to work, so you can tweak options with that:

amixer -c 0 scontrols

I see. Just wanted to make it clear that this is happening on my “naked” Orange Pi PC with no HATs or any other add-on boards.
Not sure if it’s related, but I think it should be investigated.

I’m getting this problem on a Raspberry Pi 3, and DietPi 141, where the audio keeps defaulting to HDMI, when I actually want it to go to analog 3.5mm.

My aplay -l output gives me:

**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

And so my /etc/asound.conf file becomes, to the best of my ability:

pcm.!default {
    type hw
    card 0
    device 0
}
ctl.!default {
    type hw
    card 0
    device 0
}

but this doesn’t seem to solve the problem. Not sure where to go from here.

Hi,

The RPi will default to HDMI if its plugged in, else, 3.5mm analogue is used.

There was a command we could use previously to manually override that, but was removed as it no longer had any effect.

I’ll create a ticket and see if we can find a new solution: https://github.com/Fourdee/DietPi/issues/704

If I use

amixer -c 0 cset numid=3 1

followed by

speaker-test

I get sound come out of my 3.5mm. So that’s a good start.

Thanks Verm,

I’d imagine this needs to be applied during boot, so we’ll create a service for this to be applied, when enabled.