How do I get amixer PCM numid=3 to work on Raspberry Pi 4?

Viewed 6475

I have a Raspberry Pi 4 with speakers connected to the 3.5mm jack. I have no HDMI connected, but I have the standard 7 inch monitor connected. It runs raspbian.

Edit: I found out that this was normal behaviour due to an OS update, se my comment below.

If I run amixer cset numid=3 1 I get the error amixer: Cannot find the given element from control default.

If I run amixer contents there are no numid=3, I only get:

numid=2,iface=MIXER,name='Headphone Playback Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=1,iface=MIXER,name='Headphone Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0
  : values=0
  | dBscale-min=-102.39dB,step=0.01dB,mute=1

So PCM playback route with numid=3 is missing, and 1+2 say Headphone instead of PCM, that is the normal as far as I can tell from the interweb.

I can still play things with aplay and omxplayer (I'm not sure if it is mono or stereo).

But some other things fails, which I thought might be because of this. If I run espeak, and similar with pyttsx3 in python, I get screens full of errors, a few of the lines are:

ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
Cannot connect to server socket err = No such file or directory
jack server is not running or cannot be started

And that is what I actually would want to get to work. If that is caused by the first error I don't know. But when I search for rPi sound problems, the cset-numid=3 "solution" seems to appear everywhere, and I can't use that...

Edit: So that turns out not to be the reason, the espeak problem is still there even if I revert to the old way with options in boot.txt.

1 Answers

I needed three days to find out how to use it on Raspberry Pi. I created an Shell Command. When you want to use Audio via 3.5mm Jack just write. You can let the HDMI Cable connected.

sudo bash -c 'echo -e " defaults.pcm.card 1 \ndefaults.ctl.card 1" > /etc/asound.conf'

if you want to use the HDMI Audio output just change the number 1 to 0.

sudo bash -c 'echo -e " defaults.pcm.card 0 \ndefaults.ctl.card 0" > /etc/asound.conf'
Related