Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amixer controls are configured incorrectly in raspbian 16/12/2012 #139

Closed
KenT2 opened this issue Jan 23, 2013 · 11 comments
Closed

amixer controls are configured incorrectly in raspbian 16/12/2012 #139

KenT2 opened this issue Jan 23, 2013 · 11 comments

Comments

@KenT2
Copy link

KenT2 commented Jan 23, 2013

In the latest issue of raspbian it is not possible to switch between analogue and hdmi output using amixer cset numid=3 x. Also when amixer cset numid=3 x is used the volume control is set to a low value. The cause seems to be mis-configuration of alsa CTL

In the previous correctly working image 'amixer controls' reports:
3 = playback route, 1= playback volume

in the current broken image it reports:
3 - master playback volume 1 - capture volume

in both images /var/lib/alsa/asound.state which is the saved state of the controls shows
3 - PCM playback route 1 - PCM playback volume

I've been unable to find where these values are set up.

@popcornmix
Copy link
Contributor

I've just tried:
amixer cset numid=3 1
and audio comes out of analogue and:
amixer cset numid=3 2
and the audio comes out of hdmi. I'm using:
uname -a
Linux raspberrypi 3.6.11+ #362 PREEMPT Tue Jan 22 14:52:21 GMT 2013 armv6l GNU/Linux

So I'm not convinced it is a kernel issue. Does deleting asound.state affect it?
Can you try a fresh sdcard image and see if that works for you?

@KenT2
Copy link
Author

KenT2 commented Jan 24, 2013

Hi Thanks for looking so quickly, I''ve done what you said and more, the only thing that makes sound work is to remove pulseaudio:

I used the python game gemgem to try the sound

New SD card from 16/12/2012 image
uname -a gives 18 October 2012 !!! but its the right image as it has Pistore and issue.txt is correct
gemgem - no sound. Used alsamixer to increase volume - no difference
apt-get update
apt-get upgrade
No sound
uname -a still shows 18 Oct
Deleted asound.state and reboot - no difference

sudo apt-get remove pulseaudio
get a click but no sound
reboot
amixer controls now reports correctly (same as October Raspbian)
sound OK on gemgem

reinstall - pulseaudio
amixer controls reports incorrect settings again
clicks but no sound
Delete asoundstae and reboot
clicks but no sound

Several other people on the forum have reported the same with the 16/12/2012 image. Only sure way to get sound going seemed to be to remove pulseaudio

Not sure which github I should have reported this in asb/spindle raspberrypi/linux or raspberrypi/firmware; happy to move it if you want.

@asb
Copy link

asb commented Jan 24, 2013

Thanks for the report Ken, I'll look in to it.

@cjordan84
Copy link

I can confirm the same behavior Ken has described. I can play audio through omxplayer, but not through aplay. Running amixer from a freshly downloaded image of 12/16/2012 shows the "master" and "capture" controls, not the PCM controls of previous builds. The "amixer cset numid=3 1" command has no effect on audio output, nor does removing asound.state and rebooting.

uname -a output:
Linux MegaPiI 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux

In order to get audio to work properly, I had to perform the following steps:

  1. sudo apt-get --yes purge pulseaudio (as described here: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=26936&p=254225&hilit=pulseaudio#p254225)
  2. sudo reboot
  3. login
  4. sudo amixer cset numid=3 1 (setting to 0 did not produce audio).

At that point "aplay /usr/share/sounds/alsa/Noise.wav" works properly through analog out.

I do agree that it doesn't seem to be a kernel issue, but there seems to be an issue with pulseaudio's interaction with alsa.

@gsenna
Copy link

gsenna commented Feb 5, 2013

Hi,
I installed Raspbian a few days ago and it was very frustrating because doing what the wiki said did not work. But there is no need to remove pulseaudio
The problem is that with pulseaudio the default device is pulseaudio itself. So, to change between analog and hdmi you have to do: amixer -c 1 cset numid=3 'n'
I suggest someone updates the wiki also.
Cheers.

@popcornmix
Copy link
Contributor

I've edited
http://elinux.org/R-Pi_Troubleshooting#Sound_does_not_work_at_all.2C_or_in_some_applications
Is this missing from any other wiki pages?

@gsenna
Copy link

gsenna commented Feb 6, 2013

Sorry, I made a mistake. The correct command is: amixer -c 0 cset numid=3 'n'
I am not aware of any other wiki. I read it from the one you mentioned.
Google only reveals a couple of blogs and a thread from the Raspberry pi forum which I will reply to now.

@popcornmix
Copy link
Contributor

Okay changed to "-c 0" in wiki.

@KenT2
Copy link
Author

KenT2 commented Feb 9, 2013

Tried gsenna's fix all working fine, many thanks. Before I close the Issue a question, is this change going to be permanent, if so I will change the code in launcher.sh for Python Games?.

However, sound is now broken in Python Games, comes back when removing pulseaudio. See here for details

asb/spindle#133

@maggiekean
Copy link

@gsenna & others thanks so much for the fix -- I had this working on a previous version of Raspbian & was puzzled as to why it was suddenly not working ... finally found this page!! For some reason it didn't work for me until I rebooted. HDMI sound MUCH better ... using HDMI2AV connected to computer speakers with 3.5mm coupler ... is that what you are using, or is there a better way? Thx.

@KenT2
Copy link
Author

KenT2 commented Mar 7, 2013

Pulseaudio is not in later images and Dom has fixed popping without having to use Pulseaudio (fantastic result Dom) so closing.

@KenT2 KenT2 closed this as completed Mar 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants