User avatar
keytor69
Posts: 6
Joined: Mon Jul 16, 2012 1:50 pm

No sound on vlc

Wed Jul 18, 2012 12:34 pm

untill today I was using the debian wheezy OS and installed ALSA-utils and VLC and everything was working fine with sound coming out of the headphone port.
This morning I switched to the Raspian OS and now I only get sound out of omxplayer and nothing out of VLC, can anyone help.

pholy
Posts: 46
Joined: Sun Jun 24, 2012 11:29 pm

Re: No sound on vlc

Wed Jul 18, 2012 1:36 pm

As I recall, Raspbian doesn't load the sound driver by default. Check by typing the lsmod command (list modules). If you don't see about half a dozen modules starting with snd - especially snd_bcm2835 - you need to 'sudo modprobe snd_bcm2835' which will get them all loaded. then go find or create the file /etc/modules and add snd_bcm2835 as the last line. Then you won't have to do the modprobe each time you reboot. That should give you sound out of the line out jack at least, and hdmi if you are lucky.

Or you could download the new Raspbian based image from the RPiF Downloads page, because it has all that, and a few other nice things, already done for you.

User avatar
keytor69
Posts: 6
Joined: Mon Jul 16, 2012 1:50 pm

Re: No sound on vlc

Wed Jul 18, 2012 8:08 pm

It is the new Raspian image I am having the sound problems with.

RoseMan
Posts: 4
Joined: Wed Jul 04, 2012 8:21 pm

Re: No sound on vlc

Mon Jul 23, 2012 12:08 pm

I can report the same symptoms. VLC worked O.K (for audio) on Squeeze, then Wheezy but not on the most recent Raspian. I installed lxmusic (which was previously pre-installed) and it does work. I'd certainly be interested in a solution to this problem with VLC on Raspian if any finds one.

RaspberrySmoothie
Posts: 9
Joined: Mon Jul 23, 2012 5:01 pm

Re: No sound on vlc

Mon Jul 23, 2012 5:59 pm

I'm having similar problems. I can play .wav files with aplay fine. (Apart from underruns if I try to run other software at the same time). After I read this thread, I installed lxmusic, and that works fine. aplay -l gives me the following output:

Code: Select all

$ aplay -l
**** 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
But,VLC and mplayer don't seem to be able to open alsa audio. Here's the output that I get from VLC. I don't get the error output until I try to play an mp3.

Code: Select all

$ vlc
VLC media player 2.0.2 Twoflower (revision 2.0.1-453-g40d9fef)
[0x1bea8f0] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0x1e21320] pulse audio output error: PulseAudio server connection failure: Connection refused
[0x1e21320] alsa audio output error: cannot commit hardware parameters: Invalid argument
[0x1e21320] oss audio output error: cannot open audio device (/dev/dsp)
[0x1e21320] main audio output error: no suitable audio output module
[0x1e01270] main decoder error: failed to create audio output
And here is the output I get from mplayer.

Code: Select all

Player svn r34540 (Debian), built with gcc-4.6 (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing 01_u_soul_me.mp3.
libavformat version 53.21.0 (external)
Mismatching header version 53.19.0
Audio only file format detected.
Clip info:
 Title: 01 U Soul Me
 Artist: Annie Crummer
 Album: Seventh Wave
 Year: 1996
 Comment:
 Track: 1
 Genre: Rock
Load subtitles in ./
==========================================================================
Requested audio codec family [mpg123] (afm=mpg123) not available.
Enable it at compilation.
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 53.35.0 (external)
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 53.35.0 (external)
Mismatching header version 53.32.2
AUDIO: 44100 Hz, 2 ch, floatle, 128.0 kbit/4.54% (ratio: 16001->352800)
Selected audio codec: [ffmp3float] afm: ffmpeg (FFmpeg MPEG layer-3 audio)
==========================================================================
AO: [pulse] Init failed: Connection refused
Failed to initialize audio driver 'pulse'
[AO_ALSA] Unable to set hw-parameters: Invalid argument
Failed to initialize audio driver 'alsa'
[AO SDL] Samplerate: 44100Hz Channels: Stereo Format floatle
[AO SDL] using aalib audio driver.
[AO SDL] Unsupported audio format: 0x1d.
[AO SDL] Unable to open audio: No available audio device
Failed to initialize audio driver 'sdl:aalib'
Could not open/initialize audio device -> no sound.
Audio: no sound
Video: no video


Exiting... (End of file
Any ideas of what to try next?

RoseMan
Posts: 4
Joined: Wed Jul 04, 2012 8:21 pm

Re: No sound on vlc

Mon Jul 23, 2012 8:08 pm

I found this thread:
http://www.raspberrypi.org/phpBB3/viewt ... =66&t=7107
The 11th post (by kadamski) has a solution that worked for me.

Briefly, you need to create a file called /etc/asound.conf with the following contents:

Code: Select all

pcm.!default {
        type hw
        card 0
}

ctl.!default {
        type hw
        card 0
}
Now VLC works for me!

cgul1
Posts: 3
Joined: Sun Jul 22, 2012 2:42 am

Re: No sound on vlc

Mon Jul 23, 2012 9:21 pm

Excellent!
That fixed my vlc audio problems
thanks 8-)

RaspberrySmoothie
Posts: 9
Joined: Mon Jul 23, 2012 5:01 pm

Re: No sound on vlc

Mon Jul 23, 2012 10:02 pm

Thanks RoseMan, that has fixed it for me as well.

JollyRoger
Posts: 154
Joined: Wed Feb 01, 2012 9:48 am

Re: No sound on vlc

Wed Aug 01, 2012 8:21 pm

I've got exactly the same problem reported by RaspberrySmoothie above, with the same error messages being reported by VLC. I created the /etc/asound.conf file as suggested, but still no joy. I also checked that the sound modules were all present with the lsmod command. I'd be grateful for any suggestions.

RoseMan
Posts: 4
Joined: Wed Jul 04, 2012 8:21 pm

Re: No sound on vlc

Fri Aug 03, 2012 12:29 am

JollyRoger: I don't have any good ideas. But one thing you might try is to install lxmusic. Both I and RaspberrySmoothie did install this before we tried the asound.conf fix. Did you read through the thread I referenced, which is where I found the asound.conf fix? Also are you SURE that your asound.conf file has no typo's in it?

JollyRoger
Posts: 154
Joined: Wed Feb 01, 2012 9:48 am

Re: No sound on vlc

Fri Aug 03, 2012 9:46 am

Thanks for your advice, RoseMan. I've now (in the last 10 mins) solved the problem, by running rpi-update to update my Raspbian firmware. VLC now works - though it still spews out error messages if I run it from a terminal. Sound is fine, though it has problems with video, showing only the first frame, suggesting in the error message that the computer is too slow. I am using a bog-standard SD card, so maybe I'll try burning the image onto a fast card.

In the meantime I'll take a look at lxmusic. Regards.

RoseMan
Posts: 4
Joined: Wed Jul 04, 2012 8:21 pm

Re: No sound on vlc

Fri Aug 03, 2012 10:41 pm

JollyRoger: Glad you got VLC going. I had run rpi-update as basically the first thing I did after booting the raspian image, so I guess that explains that. Lxmusic is not so special, but it does work. I wouldn't expect that a faster SD card will make much difference to video performance though. Until some further breakthroughs are made in allowing arbitrary application programs to access the accelerated graphics hardware present in the pi, the only video player will be omxplayer, which does access the (closed source) accelerated video hardware directly. I, too, am eagerly awaiting the day when VLC, and other "standard" video players, can run properly on the pi. i'd really love to be able to play .wtv files on the pi, and VLC looks like the only likely route.

xouns
Posts: 1
Joined: Sat Aug 11, 2012 7:15 am

Re: No sound on vlc

Sat Aug 11, 2012 7:17 am

I can confirm the solution for my problem (no sound on VLC, omxplayer worked, Raspian v3.1.9).

Wanderlei
Posts: 79
Joined: Tue Aug 21, 2012 2:01 pm

Re: No sound on vlc

Fri Aug 24, 2012 3:20 pm

I have tried everything but cant get sound out of vlc. I have a feeling it is using the analogue output not hdmi.

zyyzxx
Posts: 16
Joined: Sat Aug 18, 2012 1:11 pm
Location: Cheltenham

Re: No sound on vlc

Fri Aug 24, 2012 3:59 pm

I notice that /etc/modules has the last line:
snd-bcm2835
Notice - not _
Is this why I cant get sound either HDMI or earphones.
I am using 2012-07-15-wheezy-raspbian.
I have tried sudo modprobe snd_bcm2835 to no effect.

Regards Trevor

lerner
Posts: 645
Joined: Sun Mar 29, 2015 12:12 am

Re: No sound on vlc

Mon Jul 11, 2016 3:50 am

Trev'

Thanks.

The /etc/modules was the problem for me.

The line was
snd_bcm2835
and not
snd-bcm2835

Rebooted and all good.
(Ah, gotta love this O/S)

User avatar
rpdom
Posts: 20034
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: No sound on vlc

Mon Jul 11, 2016 5:09 am

lerner wrote:Trev'

Thanks.

The /etc/modules was the problem for me.

The line was
snd_bcm2835
and not
snd-bcm2835

Rebooted and all good.
(Ah, gotta love this O/S)
You're replying to a four year old post. The information in that post is out of date now. You shouldn't need to have anything in the /etc/modules file for standard sound support.

Instead you should have the following like in /boot/config.txt

Code: Select all

dtparam=audio=on

lerner
Posts: 645
Joined: Sun Mar 29, 2015 12:12 am

Re: No sound on vlc

Thu Jul 14, 2016 9:34 pm

rpdom wrote:
lerner wrote:Trev'


You're replying to a four year old post. The information in that post is out of date now. You shouldn't need to have anything in the /etc/modules file for standard sound support.

Instead you should have the following like in /boot/config.txt

Code: Select all

dtparam=audio=on
Ah,

but thatis in my /boot/config.txt file already.

So I was stuck and went on this "quest" to resolve it.

Weird how the resolution was so "simple", yet so convoluted.

TheLukaBoss
Posts: 12
Joined: Fri Feb 21, 2020 11:16 am

Re: No sound on vlc

Mon Apr 06, 2020 10:36 am

RoseMan wrote:
Mon Jul 23, 2012 8:08 pm
I found this thread:
http://www.raspberrypi.org/phpBB3/viewt ... =66&t=7107
The 11th post (by kadamski) has a solution that worked for me.

Briefly, you need to create a file called /etc/asound.conf with the following contents:

Code: Select all

pcm.!default {
        type hw
        card 0
}

ctl.!default {
        type hw
        card 0
}
Now VLC works for me!
Yep, now HDMI sound works! Was trying to play hls stream using it. Thanks! :D :D :lol: :lol: :P :P
:idea: Anyone with a light bulb moment should help me. I am not lucky enough to get them.

Also thanks to everyone for everything! Have a good day!

lerner
Posts: 645
Joined: Sun Mar 29, 2015 12:12 am

Re: No sound on vlc

Tue Apr 07, 2020 8:51 am

Good to hear!

Return to “Troubleshooting”