hippy
Posts: 8084
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Latest update/full-upgrade broke my 3B set-up [amixer]

Thu May 28, 2020 12:11 pm

No serious breakage, just a heads-up.

Doing a 'sudo apt update' / 'sudo apt full-upgrade' has broken my previously working 3B (non-plus) configuration.

When it boots it speaks some status information, all done via various Python scripts started in rc.local . After the upgrade it doesn't, just leaves an error in my rc.local.log logging file -

Code: Select all

pi@Pi3B:~ $ cat /tmp/rc.local.log
+ hostname -I
+ _IP=
+ [  ]
+ /usr/bin/python2 /home/pi/apps/say/say.py -server hdmi intro 13
+ exit 0
+ /usr/bin/python2 /home/pi/apps/say/hotspot.py
+ /usr/bin/python2 /home/pi/apps/say/btn.py -26
+ /usr/bin/python2 /home/pi/apps/say/say.py -listen http 80
amixer: Cannot find the given element from control default

Traceback (most recent call last):
  File "/home/pi/apps/say/say.py", line 204, in <module>
    Main()
  File "/home/pi/apps/say/say.py", line 180, in Main
    elif Match(s, "-serve[r]"   ) : StartServer()
  File "/home/pi/apps/say/say.py", line 117, in StartServer
    say_server.StartServer(sys.argv[2:])
  File "/home/pi/apps/say/say_server.py", line 904, in StartServer
    Say("<pi>")
  File "/home/pi/apps/say/say_server.py", line 764, in Say
    if SayThis(s):
  File "/home/pi/apps/say/say_server.py", line 744, in SayThis
    RouteAudio()
  File "/home/pi/apps/say/say_server.py", line 106, in RouteAudio
    Log("Original audio routing is"+SPACE+routeName[routeWas])
KeyError: ''
Run: hostname -I
<nothing>
Run: hostname -I
<nothing>
Run: hostname -I
<nothing>
Run: hostname -I
<nothing>
Run: hostname -I
<nothing>
Run: hostname -I
<nothing>
Run: hostname -I
192.168.0.130
So it seems something about 'amixer' may have changed from what it was before I did the upgrade.

Will investigate and update.

Seems to be a consequence of ...

Code: Select all

pi@Pi3B:~ $ amixer cget numid=3
amixer: Cannot find the given element from control default
According to the comments within my source code for parsing what it used to return I would have been expecting something like ...

Code: Select all

pi@Pi3B:~ $ amixer cget numid=3
numid=3,iface=MIXER,name='PCM Playback Route'
  ; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
  : values=2
Where that last line would indicate how audio is currently routed; 0=Auto, 1=Analogue, 2=HDMI.

The odd thing is that the desktop sound icon on task bar shows HDMI is selected and when I use 'espeak "hello" --stdout | aplay' sound does emit via HDMI.

According to the official documentation( https://www.raspberrypi.org/documentati ... -config.md ) "The following command, entered in the command line, will switch the audio output to HDMI: amixer cset numid=3 2", buy no, same issue ...

Code: Select all

pi@Pi3B:~ $ amixer cset numid=3 2
amixer: Cannot find the given element from control default
Last edited by hippy on Thu May 28, 2020 6:47 pm, edited 2 times in total.

spl23
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 403
Joined: Fri Dec 26, 2014 11:02 am

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Thu May 28, 2020 1:03 pm

There will be more information about this in tomorrow's blog post, but basically...

Previously, all of the Pi's audio outputs (headphone jack, HDMI) were ALSA device 0, with the cset command being needed to switch between them.

Now, each output is a separate ALSA device. This makes things like managing the dual HDMI outputs on Pi 4 much easier, and is more the way ALSA is supposed to behave.

So on a Pi with a single HDMI connected, ALSA device 0 is HDMI and ALSA device 1 is the headphone jack, and you can select between them however you would switch between any other ALSA devices (.asoundrc, alsamixer etc).

The taskbar audio switcher now selects the relevant ALSA device and updates .asoundrc accordingly.

We would have mentioned this in a blog post at the same time as the new version was released, but we had something else to blog about today...

hippy
Posts: 8084
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Thu May 28, 2020 1:18 pm

spl23 wrote:
Thu May 28, 2020 1:03 pm
So on a Pi with a single HDMI connected, ALSA device 0 is HDMI and ALSA device 1 is the headphone jack, and you can select between them however you would switch between any other ALSA devices (.asoundrc, alsamixer etc).
I don't know what that means. Please can you or someone tell me exactly what commands to now use, where I should be looking for information which tells me what to do, what commands are the new equivalents to the old.

And someone might want to put updating the Official Documentation on the list of Things To Do.
spl23 wrote:
Thu May 28, 2020 1:03 pm
We would have mentioned this in a blog post at the same time as the new version was released, but we had something else to blog about today...
Sure, but I'm left here with a stuffed 3B from a normal apt update/full-upgrade, and it doesn't seem I'm the only one.

spl23
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 403
Joined: Fri Dec 26, 2014 11:02 am

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Thu May 28, 2020 1:38 pm

We are now (finally) using the Debian standard means of selecting an audio device, which means that Google is your friend...

https://www.alsa-project.org/wiki/Setti ... ult_device

https://superuser.com/questions/626606/ ... omatically

https://unix.stackexchange.com/question ... hdmi/93135

Alternatively, most audio command-line programs take the desired output device as a parameter.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26864
Joined: Sat Jul 30, 2011 7:41 pm

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Thu May 28, 2020 1:46 pm

hippy wrote:
Thu May 28, 2020 1:18 pm
And someone might want to put updating the Official Documentation on the list of Things To Do.
Updating official documentation is always on the list of things to do, and stuff gets updated almost every day. Why would you think otherwise?

This ALSA change will affect a few people, but like the libcamera work, it is pushing the entire Pi ecosystem towards LInux standard methods. There will be some breakages on the way, that cannot be helped. We will endeavour to make the process as painless as possible.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

hippy
Posts: 8084
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Thu May 28, 2020 2:25 pm

If anyone can tell me what the new command line equivalents are for "amixer cget numid=3" and "amixer cset numid=3 N", or what I have to do to implement their functionality, so I can go back to programmatically switching sound outputs on the fly, I would be very grateful. Otherwise I'll wait for tomorrow's blog and hope those are detailed in that.

spl23
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 403
Joined: Fri Dec 26, 2014 11:02 am

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Thu May 28, 2020 3:14 pm

Did you actually look at the links above? They tell you how to do that.

Create a file in your home directory called .asoundrc

To set the headphone output as the default, put

defaults.pcm.card 1
defaults.ctl.card 1

into the file and save it.

To set the HDMI output as the default, put

defaults.pcm.card 0
defaults.ctl.card 0

into the file and save it, or just delete it altogether.

If you want a single line command-line instruction to do it:

printf "defaults.pcm.card 1\ndefaults.ctl.card 1" > ~/.asoundrc

will do the first. I'm sure you can work out the equivalent for the second option...

Alternatively, use the audio switcher on the desktop taskbar, which does the same thing. (I had made the assumption that most people would be using the desktop and therefore could use the switcher, and that anyone running a command-line only system would know how to configure ALSA - clearly this was not the case, for which my apologies.)

hippy
Posts: 8084
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Thu May 28, 2020 5:57 pm

spl23 wrote:
Thu May 28, 2020 3:14 pm
Did you actually look at the links above? They tell you how to do that.
I did look but didn't comprehend what they were saying. They were talking about "default" and that seemed "configuration", different to me than "active" or on the fly "selecting".

I also didn't comprehend how the "two-liner" setting matched with the JSON-file version some were showing, or what that file meant.
spl23 wrote:
Thu May 28, 2020 3:14 pm
(I had made the assumption that most people would be using the desktop and therefore could use the switcher, and that anyone running a command-line only system would know how to configure ALSA - clearly this was not the case, for which my apologies.)
No problem. It's my always-on box and runs a background networked speech server for everything else. I've never worried about how it works because I simply read the docs I needed and followed what they said, executed the commands, they did as expected, job done, on with the rest of the project.

So thanks for explaining what I couldn't figure out from the links. It's a shame none of the posters there managed to put it so succinctly or clearly.

Not the most elegant proof of concept but seems to be working for me, Python 2 and 3 ...

Code: Select all

#!/usr/bin/python

import os

def GetAudioOutput():
  with open("/home/pi/.asoundrc", "r") as f:
    s = f.read()
  x = s.rfind("card ")
  n = s[x+5]
  if   n == "0" : return "HDMI", n
  elif n == "1" : return "JACK", n
  else          : return "Unknown", n

def SetAudioOutput(type,n=None):
  if not type.startswith("Current"):
    if type == "HDMI" : n = "0"
    else              : n = "1"
    with open("/home/pi/.asoundrc", "w") as f:
      f.write("defaults.pcm.card " + n + "\n")
      f.write("defaults.ctl.card " + n + "\n")
  print("Now using " + type + " (" + n + ")")
  s = os.popen('espeak "hello" --stdout | aplay').read().strip()
  print(s)

type, n = GetAudioOutput()
if type == "HDMI":
  SetAudioOutput("Current (HDMI)", n)
  SetAudioOutput("JACK")
  SetAudioOutput("HDMI")
else:
  SetAudioOutput("Current (JACK)", n)
  SetAudioOutput("HDMI")
  SetAudioOutput("JACK")

hippy
Posts: 8084
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Thu May 28, 2020 6:49 pm

Audio now working. So on to figuring out what broke my button handler.

Annoyingly it's no longer working when run from rc.local but does if started manually from the command line.

spl23
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 403
Joined: Fri Dec 26, 2014 11:02 am

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Thu May 28, 2020 7:14 pm

I don't know exactly what button handler you are referring to, but if you are using assistive technology (which a speech server sounds as if it may be) I have made one change which might possibly affect things. (Because I made said change to fix a problem with the Orca screen reader...)

Previously, the window manager (Openbox) could be in a state where no window had focus - if there were no windows open, for example. Orca really didn't like this, so I have tweaked the window manager code so that in that situation, the desktop (which is actually a file manager window) gets focus. This should make no difference at all to any behaviour other than that of Orca (which was refusing to say anything when focus changed from nothing to something; it only speaks when focus changes from something to something else), but I mention it just in case it gives any clue to problems you may be having...

spl23
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 403
Joined: Fri Dec 26, 2014 11:02 am

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Thu May 28, 2020 7:59 pm

Incidentally, while glancing at your Python code, just a suggestion - if all you are doing is calling aplay, it is probably easier to just use the -D argument to aplay to pass it the ALSA device you want to use for output, rather than fiddling about with .asoundrc.

hippy
Posts: 8084
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Fri May 29, 2020 11:40 am

spl23 wrote:
Thu May 28, 2020 7:14 pm
I don't know exactly what button handler you are referring to
Sorry I wasn't clear there. It's just another Python background program which monitors a button on the GPIO header through RPi.GPIO, with an FSM which sends to the speech server, so I can cycle through spoken status reports, rebooting and shutdown, etc.

I find it's a great way to interact with a headless Pi.
spl23 wrote:
Thu May 28, 2020 7:59 pm
it is probably easier to just use the -D argument to aplay
Good point. I will try that later as it sounds like it should work and would be easier.

The code I have was cobbled together I think about four years ago when I first got my 1B and knew little about Pi's, Linux, or even Python, so it's far from elegant, but has worked since then. A typical case of it's not broken; don't fix it. It's had a few tweaks, functionality added, but the core remained the same.

hippy
Posts: 8084
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Fri May 29, 2020 2:21 pm

The button handler issue is an odd one. It is a simple push to make button on pins 37 (GPIO26) and 39 (0V) of the GPIO header.

When run from the command line, my program initalises, determines GPIO26 as an input is floating, so the button must be normally open, so then it idles until it can determine whether GPIO26 is connected to 0V or 3V3 ...

Code: Select all

2020-05-29 14:06:25 Auto-detect button on GPIO26
2020-05-29 14:06:25 Button is normally open
2020-05-29 14:06:25 Need to push button to determine how it is wired
2020-05-29 14:06:25 ---
2020-05-29 14:06:25 Init_Init
2020-05-29 14:06:25 Idle_Loop
Them, when I push the button and short it to 0V, as expected and desired ...

Code: Select all

2020-05-29 14:06:44 Button push detected on GPIO26
2020-05-29 14:06:44 Button is normally open
2020-05-29 14:06:44 Button is connected to 0V
2020-05-29 14:06:44 Will use internal pull-up
2020-05-29 14:06:44 Button push will be read as 0
2020-05-29 14:06:44 ---
2020-05-29 14:06:44 IdentifyPi_Init
2020-05-29 14:06:44 Say: <pi>. <ip>
2020-05-29 14:06:44 IdentifyPi_Loop
2020-05-29 14:06:44 Idle_Loop
But, when run from /etc/rc.local, it starts off the same ...

Code: Select all

2020-05-29 14:10:25 Auto-detect button on GPIO26
2020-05-29 14:10:25 Button is normally open
2020-05-29 14:10:25 Need to push button to determine how it is wired
2020-05-29 14:10:25 ---
2020-05-29 14:10:25 Init_Init
2020-05-29 14:10:25 Idle_Loop
But three seconds later a read of GPIO26 with pull-down low returns a high, so it assumes the button is between GPIO26 and 3V3 ...

Code: Select all

2020-05-29 14:10:28 Button push detected on GPIO26
2020-05-29 14:10:28 Button is normally open
2020-05-29 14:10:28 Button is connected to 3V3
2020-05-29 14:10:28 Will use internal pull-down
2020-05-29 14:10:28 Button push will be read as 1
2020-05-29 14:10:28 ---
So it seems something is altering the GPIO configuration when it never has before, which is consequently borking my program. From then on it's expecting a high on a push when it can never get that with a button which shorts to 0V.

That behaviour is confirmed by adding a delay at the start of my program. When I do that the configuration stays as expected, and everything works. When I run a test program I can also see the floating input pin with a pull-down reading high.

So the challenge now is trying to discover what is affecting GPIO which didn't before.

spl23
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 403
Joined: Fri Dec 26, 2014 11:02 am

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Fri May 29, 2020 3:29 pm

Can't help you there, I'm afraid - it's presumably something firmware or kernel-y, and I don't get involved with that stuff!

Thimel
Posts: 2
Joined: Wed Jun 03, 2020 5:53 am

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Wed Jun 03, 2020 6:15 am

I have an incredibly similar problem I was pulling my hair out trying to fix.
I have a python program that plays sound files using aplay. It runs on raspberry pi 3 b+. I want the sound to come out the headphone jack. When running the python program by hand from the screen, it worked properly after I right clicked on the volume icon and selected headphones instead of HDMI.
Then I tried to start it from a cron job by doing “crontab -e” and putting in an @reboot line. No sound.
Adding an “amixer cset numid=3 1” to the python program resulted in the error message "amixer: cannot find the given element from control default". Googling that got me to this forum thread. I tried the fix given above.

I created a /etc/asound.conf file with content
defaults.pcm.card 1
defaults.ctl.card 1

and it worked when I rebooted! I was so happy.

Then I disconnected my monitor, keyboard and mouse and rebooted again. No sound again. Unhappy again.

I would happily add the -D switch to the play command as someone suggested, but don’t know what device name should be useD there.

Can someone help me either with the device name to use with aplay, or some other solution?

Thanks

hippy
Posts: 8084
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Wed Jun 03, 2020 11:52 am

Thimel wrote:
Wed Jun 03, 2020 6:15 am
I would happily add the -D switch to the play command as someone suggested, but don’t know what device name should be useD there.
As best I can tell, not being familiar with ALSA, is that you can get the device names from 'aplay -L'. That shows things like ...

Code: Select all

default:CARD=b1
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Default Audio Device
default:CARD=Headphones
    bcm2835 Headphones, bcm2835 Headphones
    Default Audio Device
hw:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct hardware device without any conversions
hw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct hardware device without any conversions
Those "default:CARD=b1" and "default:CARD=Headphones" appear to be the device names so one can then use ...

espeak "hello HDMI" --stdout | aplay --device=default:CARD=b1

espeak "hello analogue" --stdout | aplay --device=default:CARD=Headphones

The first worked and I suspect the second did too. I have no analogue currently connected to check output, but it did not error and HDMI remained silent.

As to whether those are the correct or ideal device names to use I have no idea. Both '--device=hw:b1,DEV=0' and ''--device=hw:b1' worked for me.

I would suspect 'hw:' devices are the ones to use, with 'DEV=' added on a Pi 4B to distinguish the two HDMI from each other -- Don't have a 4B powered-up, and don't have audio on my Pi 4B HDMI monitors anyway to test conclusively.

Thimel
Posts: 2
Joined: Wed Jun 03, 2020 5:53 am

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Thu Jun 04, 2020 12:33 am

That worked. Thank you so much!

hippy
Posts: 8084
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Sun Jun 21, 2020 11:57 pm

Just an update; programatically creating the .asoundrc file has been working but I just noticed that doesn't play well with the desktop audio applet on the task bar after rebooting. It may well have always been like that but I only recently noticed.

When my Pi boots it starts my speech server software running from rc.local which creates the .asoundrc file when run. That works and I can hear speech while it's booting, often while the desktop is not fully presented.

Once the desktop has appeared the audio applet on the task bar is greyed-out with a red cross through it.

Audio is played through HDMI as desired but the mouse-over pop-up says "No volume control on this device", right-click shows HDMI ticked. Clicking the already ticked HDMI option does return the audio icon to what's expected, pale blue for me with no red cross. Mouse-over pop-up becomes the expected "Volume control 100".

I have also noticed the audio app keeps showing as expected if .asoundrc is altered after the desktop is presented, so it may be that only early creation of .asoundrc causes a problem.

I'm guessing that the .asoundrc has to include more than 'defaults.pcm.card 0 / defaults.ctl.card 0", has to be what clicking HDMI creates, if the two are to play ball with each other ?

I'll experiment more at a future time but thought it worth noting if anyone else is just creating the two line .asoundrc file to set routing outside the desktop.


Update : The issue may be down to a bug where my code wasn't always correctly translating between old amixer values ( 0=Auto, 1=Jack, 2=HDMI ) to new ALSA values ( 0=HDMI, 1=Jack ) or rather vice-versa.
Last edited by hippy on Thu Aug 27, 2020 11:42 am, edited 1 time in total.

bacsom
Posts: 26
Joined: Mon Jan 02, 2017 11:31 am

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Thu Aug 20, 2020 10:17 am

I used to have a script which tampered with the volume control in a given time. Unfortunately, the command doesn't work in the new system. Can anyone help me?

The old code:

Code: Select all

amixer set PCM unmute && amixer set PCM 100%
Now, this works with the HDMI output:

Code: Select all

amixer set HDMI unmute && amixer set HDMI 100%
But this is not with the Analogue:

Code: Select all

amixer set Headphone unmute && amixer set Headphone 100%
Any help is greatly appreciated! :-)

bacsom
Posts: 26
Joined: Mon Jan 02, 2017 11:31 am

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Thu Aug 20, 2020 10:38 am

OK, I have found a workaround:

This one stores the settings of both HDMI and Analogue output

Code: Select all

alsactl --file ~/.config/asound.state store
And this one restores it to whatever settings were stored:

Code: Select all

alsactl --file ~/.config/asound.state restore

terraspace
Posts: 84
Joined: Mon Dec 03, 2018 3:56 pm

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Wed Aug 26, 2020 8:51 pm

I only just updated recently and I'm having a similar issue. Previously I've controlled the selected audio output via C/C++ code with this:

Code: Select all

void AlsaAudioPlayer::SetOutput(PTCore::AUDIO_OUT output)
	{
		snd_ctl_t*            handle = NULL;
		snd_ctl_elem_info_t*  info;
		snd_ctl_elem_id_t*    id;
		snd_ctl_elem_value_t* control;
		snd_ctl_elem_type_t   type;
		int err = 0;
		char* ptr;
		unsigned int idx, count;
		long tmp;

		snd_ctl_elem_info_alloca(&info);
		snd_ctl_elem_id_alloca(&id);
		snd_ctl_elem_value_alloca(&control);

		err = snd_ctl_open(&handle, "hw:0", 0);
		if (err < 0) {
			printf("Control device open error: %s", snd_strerror(err));
			return;
		}
		snd_ctl_elem_id_set_numid(id, 3);
		snd_ctl_elem_info_set_id(info, id);

		err = snd_ctl_elem_info(handle, info);
		if (err < 0) {
			printf("Control device info error: %s", snd_strerror(err));
			snd_ctl_close(handle);
			return;
		}

		snd_ctl_elem_info_get_id(info, id);
		type = snd_ctl_elem_info_get_type(info);
		count = snd_ctl_elem_info_get_count(info);
		snd_ctl_elem_value_set_id(control, id);

		if (output == PTCore::AUDIO_OUT::HDMI)
		{
			snd_ctl_elem_value_set_integer(control, 0, 2);
			err = snd_ctl_elem_write(handle, control);
			if (err < 0) {
				printf("Control device set error: %s", snd_strerror(err));
				snd_ctl_close(handle);
				return;
			}
			this->outputMode = HDMI;
		}
		else
		{
			snd_ctl_elem_value_set_integer(control, 0, 1);
			err = snd_ctl_elem_write(handle, control);
			if (err < 0) {
				printf("Control device set error: %s", snd_strerror(err));
				snd_ctl_close(handle);
				return;
			}
			this->outputMode = JACK;
		}
		snd_ctl_close(handle);
	}
This no longer works.. What would the best solution be to do this the same (similar) way from C?

terraspace
Posts: 84
Joined: Mon Dec 03, 2018 3:56 pm

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Thu Aug 27, 2020 8:38 am

It appears to have affected Alsa raw midi input too as I can no longer open my midi devices via ALSA.

even amidi -l seems borked.

This was *NOT* a good update...

terraspace
Posts: 84
Joined: Mon Dec 03, 2018 3:56 pm

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Thu Aug 27, 2020 10:54 am

why does amixer not expose the headphone device, how should you set the volume via command line for the jack output ?

mikeszi
Posts: 2
Joined: Mon Aug 31, 2020 2:31 am

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Mon Aug 31, 2020 3:08 am

This update also seems to have broken multi channel support.

This used to work:

Code: Select all

speaker-test -D hw:0,1 -c 8 -t wav
I updated the device portion for the new addressing method, but still get this error:

Code: Select all

speaker-test -D hw:0 -c 8 -t wav

speaker-test 1.1.8

Playback device is hw:0
Stream parameters are 48000Hz, S16_LE, 8 channels
WAV file(s)
Channels count (8) not available for playbacks: Invalid argument
Setting of hwparams failed: Invalid argument
Some diagnostic data:

Code: Select all

tvservice -a
     PCM supported: Max channels: 8, Max samplerate: 192kHz, Max samplesize 24 bits.
     AC3 supported: Max channels: 6, Max samplerate:  48kHz, Max rate  640 kb/s.
     DTS supported: Max channels: 6, Max samplerate:  96kHz, Max rate 1536 kb/s.
  DTS_HD supported: Max channels: 8, Max samplerate: 192kHz, Max rate    8 kb/s.


aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3

aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=b1
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Default Audio Device
sysdefault:CARD=b1
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Default Audio Device
dmix:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct sample mixing device
dsnoop:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct sample snooping device
hw:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct hardware device without any conversions
plughw:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Hardware device with all software conversions
default:CARD=Headphones
    bcm2835 Headphones, bcm2835 Headphones
    Default Audio Device
sysdefault:CARD=Headphones
    bcm2835 Headphones, bcm2835 Headphones
    Default Audio Device
dmix:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct sample mixing device
dsnoop:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct sample snooping device
hw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct hardware device without any conversions
plughw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Hardware device with all software conversions

mikeszi
Posts: 2
Joined: Mon Aug 31, 2020 2:31 am

Re: Latest update/full-upgrade broke my 3B set-up [amixer]

Mon Aug 31, 2020 4:20 am

Running this to roll back to before these changes resolved my issue.

Code: Select all

sudo rpi-update e1050e94821a70b2e4c72b318d6c6c968552e9a2

Return to “Raspberry Pi OS”