scalesrc1
Posts: 2
Joined: Thu May 31, 2012 2:08 pm

Newbie User cannot get Audio out

Postby scalesrc1 » Thu May 31, 2012 2:21 pm

Please forgive me but although I started back in the days of CP/M I have only just started looking into the linux world, to be precise, for the last hour since the pi arrived!
I have hooked it all up, browsed the web, all very lovely. I am using the standard debian linux which I downloaded this morning.
I am failing to get any audio out of the 3.5mm jack. The HDMI is plugged in to a PC monitor. I am running the music player app and it does not even look like it is attempting to play the included audio clip. I have copied MP3 files from across my network onto the desktop and double clicked them. The Music player app loads but does nothing, it does not even reflect the details of the file that I am trying to play.
Just to confirm, this is fresh, out of of the box, all I did was log in and startx.
Can anyone point me in the right direction?
bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Newbie User cannot get Audio out

Postby bredman » Thu May 31, 2012 2:36 pm

The sound is disabled by default because the sound drivers are still experimental.

If you want to experiment with the sound, have a look at
http://elinux.org/R-Pi_Troubleshooting#Sound
scalesrc1
Posts: 2
Joined: Thu May 31, 2012 2:08 pm

Re: Newbie User cannot get Audio out

Postby scalesrc1 » Thu May 31, 2012 3:04 pm

Thank you for that, heading over there now...
Richard
puddingcook
Posts: 1
Joined: Thu May 31, 2012 11:22 pm

Re: Newbie User cannot get Audio out

Postby puddingcook » Thu May 31, 2012 11:24 pm

After logging in try:

sudo modprobe snd_bcm2835

It worked for me.
KevinD
Posts: 1
Joined: Fri Jun 01, 2012 10:57 am

Re: Newbie User cannot get Audio out

Postby KevinD » Fri Jun 01, 2012 11:08 am

I had the same issue and sudo modprobe snd_bcm2835 fixed it, as others have suggested.

Using the default music player in Debian I was able to play tracks via HDMI, but I wanted to be able to listen to music without having the TV switched on. However, I couldn't get the audio to play through the analogue connector. There is a solution for that in the wiki troubleshooting guide:

By default output will be automatic (hdmi if hdmi supports audio, otherwise analogue). You can force it with:
sudo amixer cset numid=3 <n>
where n is 0=auto, 1=headphones, 2=hdmi.

That solved it. I wasn't expecting the audio quality to be great on analogue, and it isn't (better than AM radio, but not by much) so the next job is to investigate USB sound cards.

Kevin
robotfunk
Posts: 45
Joined: Wed May 30, 2012 7:28 pm

Re: Newbie User cannot get Audio out

Postby robotfunk » Sun Jun 03, 2012 2:44 pm

sudo modprobe snd_bcm2835 does not seem to work for me, I get following errors:

root@raspberrypi:/home# sudo modprobe snd_bcm2835
WARNING: Error inserting snd (/lib/modules/3.1.9+/kernel/sound/core/snd.ko): Invalid module format
WARNING: Error inserting snd_timer (/lib/modules/3.1.9+/kernel/sound/core/snd-timer.ko): Invalid module format
WARNING: Error inserting snd_pcm (/lib/modules/3.1.9+/kernel/sound/core/snd-pcm.ko): Invalid module format
FATAL: Error inserting snd_bcm2835 (/lib/modules/3.1.9+/kernel/sound/arm/snd-bcm2835.ko): Invalid module format

if I try to play a file anyway I get

root@raspberrypi:/home# sudo aplay /usr/share/sounds/alsa/Front_Center.wav
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4170:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4170:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4170:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4649:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM default
aplay: main:654: audio open error: No such file or directory
root@raspberrypi:/home# amixer cset numid=3 1
amixer: Control default open error: No such file or directory


Any ideas what could be wrong?
morey8
Posts: 6
Joined: Sun Jun 03, 2012 5:48 am

Re: Newbie User cannot get Audio out

Postby morey8 » Sun Jun 03, 2012 4:38 pm

AviateX14 wrote:Grumpy Mike, I've found an easier way.

First of all, have you set a root user password yet? If not, go to step one, if you have, step two.

Step One
1) Logon to your pi as normal, open terminal and type:

Code: Select all

sudo passwd root

2) Enter a password of your choice, just make sure you know it.
3) Exit terminal and shutdown your pi.

Step 2
1) Turn on your pi, when it prompts you to login, type the username, root and the password as whatever you selected in step one.
2) Enter the command startx to bring up the GUI.
3) Open the file browser and go to the directory /etc/ and find the file 'modules' (You can do this quickly by just typing 'modu' in the etc folder
4) Right click the file, Open with > Other > Leafpad > OK
5) Create a new line beneath vchiq and type:

Code: Select all

snd_bcm2835

6) Save the file, reboot, login as normal, it should work.

Hope this helps!
-AvX



Crosspost from viewtopic.php?f=28&t=6586 . This is the fix I went with after trying a bunch of different things including typing in sudo modprobe snd_bcm2835 before startx, which does work but you have to type it in each time you boot.

I believe this is the best method and I'm 95% certain it will fix your issue, however it might only play through your HDMI which you'd have to combine this with another method above to get it playing through the audio jack. My quick fix for this would be to see if you have audio out on your TV and just connect it there instead of through the Pi.

Since you're new to Linux like myself here's a few things that the method above doesn't specify but maybe I'm just stating the obvious. root is the username, and what you're doing is creating an account sort of like administrator. I didn't log on using pi and password raspberry, and use terminal, I did it from the command line before startx. After setting the password (should ask you to verify the new password). Reboot and rather than logging in with pi, log in with root and then your new password. Then startx. Once in the GUI, open up file manager (this is the non-obvious I think) go to your home directory which is the /pi folder. Click the up arrow which brings you to a bunch of folders, this is where etc is and you can follow the steps from there. Hopefully this solves your problem as it did mine.
robotfunk
Posts: 45
Joined: Wed May 30, 2012 7:28 pm

Re: Newbie User cannot get Audio out

Postby robotfunk » Mon Jun 04, 2012 6:45 pm

Following up on my own post:

After updating the firmware, sudo modprobe snd_bcm2835 started to work!

added it to etc/modules and it works out of the box after each reboot :)
tipam
Posts: 44
Joined: Fri Dec 30, 2011 1:32 pm
Contact:

Re: Newbie User cannot get Audio out

Postby tipam » Tue Jun 05, 2012 12:38 am

I've been trying the above but can't get sound at all.
Doing a sudo modprobe snd_bcm2835 (before startx) reports ...

FATAL: Module snd_bcm2835 not found.

Is there something I can download to fix this? I've installed alsa-base and alsa_utils but this makes no difference.

I'm using Debian6-17-02-2012

Many Thanks
itimpi
Posts: 1069
Joined: Sun Sep 25, 2011 11:44 am
Location: Potters Bar, United Kingdom
Contact:

Re: Newbie User cannot get Audio out

Postby itimpi » Tue Jun 05, 2012 3:05 am

That sounds like an old version. The current one on the Downloads page is Debian6-19-04-2012 (which most users will therefore be using) and I have seen suggestions that even that one might shortly be superseded. Not sure whether that will solve your problem but it must be worth trying?
nbrok
Posts: 2
Joined: Tue Jun 05, 2012 7:45 am

Re: Newbie User cannot get Audio out

Postby nbrok » Tue Jun 05, 2012 7:54 am

Hello,

Your discription works, but using mplayer for playing an internet radiostream I get a few seconds audio and then it stops. The driver reports (in dmesg) that the driver has been stopped because a bufferoverflow or something.
I use the analogue audio output.

Is this caused by the experimental state of the driver?

Greetings,

Nick
j4cko
Posts: 2
Joined: Tue Jun 05, 2012 5:33 pm

Re: Newbie User cannot get Audio out

Postby j4cko » Tue Jun 05, 2012 5:37 pm

I'm having the same problem… tried to play audio, but stops after 0 to 1.5 s.
dmesg says the following:
snd_bcm2835_playback_open:97 Alsa open (0)
BUG: scheduling while atomic: VCHIQ-0/434/0x00000003
Modules linked in: snd_bcm2835 snd_pcm snd_page_alloc snd_timer snd soundcore nfsd exportfs ipv6
Backtrace:
Function entered at [<c0011870>] from [<c0474694>]
... (more backtrace, can post if helpful)
dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5087
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Newbie User cannot get Audio out

Postby dom » Tue Jun 05, 2012 6:15 pm

@j4cko
What version of kernel are you running (type "uname -a" to see).
If it is old try a kernel update (Hexxeh's rpi-update tool)
j4cko
Posts: 2
Joined: Tue Jun 05, 2012 5:33 pm

Re: Newbie User cannot get Audio out

Postby j4cko » Wed Jun 06, 2012 5:37 am

That was my first intention, too… I'm running Archlinux, thus an update is easily done. But still my kernel is 3.1.9, which is significantly older than the kernel on my desktop-computer (also with arch) runs…somehow, archlinux-arm is lagging behind the normal archlinux…
I probably will see if I can update the kernel "manually" or - if that still doesn't work - simply use an old usb-audio soundcard lying around here.
User avatar
Toad King
Posts: 157
Joined: Sun Dec 18, 2011 8:03 pm

Re: Newbie User cannot get Audio out

Postby Toad King » Fri Jun 08, 2012 4:43 am

I am able to load the snd_bcm2835 module fine, but I still can't get any sound to work. I get errors like robotfunk posted earlier:

Code: Select all

ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4170:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4170:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4170:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4649:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM default


Any idea what the problem could be?

EDIT: Nevermind, forgot to add my user to the "audio" group.