Lost sound in totem, vlc, mplayer, flash, banshee etc

Hi all,

I am running opensuse 11 (gnome), and somehow have lost my sound when playing video files in totem, vlc, mplayer or flash players (eg youtube). Vid files were fine in totem and flash player (ie sound was working fine) up to a couple of days ago, now I get nothing (video works fine, sound doesn’t).

I did install vlc-beta, but had some issues and reverted back to current vlc, but not sure if this has anything to do with my problem. I opened banshee for the first time the other day (since putting on suse 11) and loaded my music library, but when I try and play I get no sound (just skips through the playlist really fast as though it can’t ‘read’ the song).

I have no idea what happened - as far as I can tell all volume sliders are up (although the one in banshee looks muted, and won’t let me slide the volume control at all). If I right-click on the volume control in the bottom panel and go to ‘open volume control’ I get a pop-up saying “connection failed: connection refused”.

Anyone know where I should start?

As far as I can tell I have all gstreamer codec plugins installed (good, bad, ugly etc).

I had, and still occasionally have the same problem. I would consider this a workaround, that works at least for me.

  1. For each of these applications you may have to go and change audio output and try what is the best one for you (usually the old OSS will work).

  2. What also works: as a root, type alsa-init, as most likely something killed alsa.

I’ll be back to see if this helped, and also to see if somebody has a better solution.

If it were me, I would check for basic sound …

Please run the following sound test (copy and paste into an xterm/konsole), and advise of any audible output:
speaker-test -Dplug:front -c2 -l5 -twav

Don’t forget to check your mixer settings, while it is trying to play audio.

Thanks for your replies.

@oldcpu: I ran the command you suggested but got no sound. Output from terminal was:

user@opensuse-laptop:~> speaker-test -Dplug:front -c2 -l5 -twav

speaker-test 1.0.16

Playback device is plug:front
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy
(this continued repeatedly until i closed the terminal window)...

The funny thing is when I first log in after a reboot I get the usual ‘login’ sound playing fine. Also, immediately after logging in I can right click on the icon in the panel and open volume control, which gives me the pulseaudio volume control window. However try again a few minutes later (after opening totem or something) and it crashes trying to open pulseaudio volume control and I can’t get sound.

It seems like something is killing my system’s sound after logging in?

@ivom66: I tried sudo alsa-init in terminal but got

sudo: alsa-init: command not found

Am I missing something? Also I opened an avi in VLC and tried playing around with audio settings, but had no success with OSS or ALSA.

I’m still stuck!

Oh yeah… I was using skype today, just going through my laptops built in mic and speakers, and the sound worked fine. This just confuses me even more!

Ok, … so the snd device is busy, because some other app has control and has not released control (at least thats how it looks to me). What is this “other” app? Please look for it.

Maybe run that sound test again, and while getting that error, type this in a second xterm/konsole:
lsof /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*

Ok latest development…

I thought I’d fiddle around a little bit, so opened system monitor to see what was running. The only audio related thing I could see was pulseaudio (pulseaudio -D), so I thought I should try restarting this process.

Here’s what I did from terminal:

sudo pulseaudio -k (…nothing happens)
pulseaudio --check (…nothing happens)
pulseaudio -k (pulseaudio disappears from system monitor - seems as though I had to not be root to kill the process)

Then I tried “pulseaudio -D” and got:

W: core-util.c: setpriority(): Permission denied

“sudo pulseaudio -D” and got:

W: main.c: This program is not intended to be run as root (unless --system is specified).
E: main.c: daemon startup failed.

Then finally “sudo pulseaudio -D --system”

and pulseaudio pops back in to system monitor. I open VLC and voila, sound is working again!

To me, it looks like pulseaudio should be running as a systemwide process to work, but instead it was running at the user level (which is why I could only kill it initially as normal user but not as root). When I started it again as root with the system wide option things seemed back to normal (although I still had troubles using ALSA in mplayer, but OSS was ok. ALSA seems fine in VLC though.)

Anyway, obviously there is still a problem with my system and I don’t want to run these commands everytime I log in. Not sure where-to from here though…

EDIT: After writing this I tried totem but still no sound there. Not sure how to set audio preferences in totem - there is nothing in the preferences dialogue.

@oldcpu

Sorry didn’t see your 2nd post.

Running “speaker-test -Dplug:front -c2 -l5 -twav” now works after my fiddling from the last post, so I will reboot and, assuming I get the same problem as before, will try and find what ‘other’ app is not releasing control.

You cannot run sudo alsa-init. It is in /usr/sbin, so you would
have to run:


sudo /usr/sbin/alsa-init

if you don’t want to run as a root.
To become a root, type:


su -

If you still don’t find that command (which just does this:


/usr/bin/set_default_volume -f $1 >/dev/null 2>&1
exec /usr/sbin/alsactl -F restore $1 >/dev/null 2>&1

then you might consider installing alsa-tools and alsa-utils.

**oldcpu: **
I’ll keep an eye on this thread as I’ve already tried many things, and restoring alsa was the only thing that helped me.

Oh, I wrote my post without seeing that you already have a solution.

I believe for totem you have the settings in Gstreamer Properties.

I wouldn’t say that I have a solution just yet, although I do believe we are making some progress ;).

Ok, rebooted and same problem as before. Running “speaker-test -Dplug:front -c2 -l5 -twav” gives “device or resource busy” error as before.

I tried “lsof /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*” while it was going and got:


user1@opensuse-laptop:~> lsof /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /var/lib/gdm/.gvfs
      Output information may be incomplete.
COMMAND    PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
pulseaudi 3599 user1   29u   CHR  116,9      0t0 4301 /dev/snd/controlC0
pulseaudi 3599 user1   36u   CHR  116,9      0t0 4301 /dev/snd/controlC0
skype     3769 user1  mem    CHR  116,5          4277 /dev/snd/pcmC0D0p
skype     3769 user1   32u   CHR  116,5      0t0 4277 /dev/snd/pcmC0D0p
mixer_app 3834 user1   22u   CHR  116,9      0t0 4301 /dev/snd/controlC0

It looks like skype may be the culprit! I quit skype and ran your speaker test at cl again and this time it worked. Opened a file in VLC again and sound was working there as well.

Ok, now we are getting somewhere. Sound is working in VLC using ALSA, but I still have a few problems:

  1. Totem still has no sound. I don’t know if this is skype related or a different problem. I’ve tried changing settings in gstreamer properties but get no sound regardless of if I set it to ALSA, OSS or pulseaudio.
  2. Although its not essential, I would still like to use skype. Don’t know if there is a workaround to stop it from taking over?
  3. Mplayer crashes if I set it to ALSA. If I set it to OSS it plays video, but says “could not open/initialise audio device” and I get no sound.
    EDIT: If no other apps are using sound, mplayer works using OSS. Mplayer wasn’t able to initialise the audio device as I had a test youtube video loading. Once I closed the browser it worked.

Anyway, looks like we are part way there. I can live without skype and VLC is working, so I can at least play video through that. Also flash player has sound again so youtube etc is usable again.

As for the other problems, I’m still not sure whats going on. ivom66: I tried /usr/sbin/alsa-init but this didn’t seem to do much for totem or mplayer using alsa (I got no output from this at all on the command line, and same sound problems were still there after). I tried the more complex commands you suggested as well but same result.

I am really a Ubuntu user who is trying openSUSE, and so far, after initiall glitches, things seem to work except for the occasional sound problems.

Instead of playing CLI sound test (which looks obscure and difficult to remember), I click on Test buttons either on Gstreamer Properties or on Sound Preferances window.

If I hear a tone, I know the sound works.

The following scenario always worked for me for totem:

  1. On Gstreamer set audio to ALSA (everywhere).
  2. alsa-init

I do not know what is causing ALSA to fail, there must be some application that does that. It never happened to me on Ubuntu. When I look at /var/log/messages I see a lot of alsa related errors:


k.c: Error opening PCM device front:0: Device or resource busy
Jun 28 11:30:19 CPE001a9229e9e6-CM001225dff0aa pulseaudio[9922]: module-alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Jun 28 11:32:35 CPE001a9229e9e6-CM001225dff0aa pulseaudio[9922]: module-alsa-sink.c: Error opening PCM device front:0: Device or resource busy
Jun 28 11:32:35 CPE001a9229e9e6-CM001225dff0aa pulseaudio[9922]: module-alsa-sink.c: Error opening PCM device front:0: Device or resource busy

What sort of file are you trying to play? What sound engine is totem using with those files? I never use totom, so I can’t give advise, … only ask questions that YOU should be asking. Do you have w32codec-all installed?

I have my mplayer set to xv and alsa. I use smplayer as a front end to mplayer. And I never run 3D desktop effects. But if you are using 3D desktop effects you may have to set this to x11.

Now, if you wish to play multiple sound players (or devices that use sound) at once, then I have read you must make sure all sound apps use the device name alsa or default and NOT hw nor OSS nor plughw:0,0 because these do NOT allow mixing. Hence you must get your players functioning with alsa.

I’m having the exact same problem. After I installed Opensuse 11 on Monday I had sound. I lost sound in Gnome and KDE 4.X. As I began to patch the system and install additional software. I noticed I lost sound Totem and then VLC in gnome. I could still get sound in KDE 4. Then after a few days I lost sound in KDE4 so I went into KDE3. After about a two days I lost sound there also. So far I have tried various things I’ve seen posted and I still haven’t found anything that works. I can’t wait to see what the bug is. :rolleyes:

I don’t think there is a bug that completely blocks sound. I have the latest updates to my test box with openSUSE-11.0 and KDE-3.5.9, and sound “just works” with vlc, mplayer, flash, xine … etc …

Maybe you need to disable pulse audio? Try the solution of this user:
sontek ( John M. Anderson ) » Achieve Zen with openSUSE 11.0 (i.e Get rid of pulse audio)
which is to remove alsa-plugins-pulse

I may give that a TRY. I will also use my 90 day installation support. I haven’t made a support call since suse 9.0. or 9.1. but I might make one on this problem to see what the official word from Novell support is on this.

My guess on the cause may have to do with user hardware. I have an ASUS m3a MB which has an on board 8ch HD Audio system (Azalia ). Especially if this isn’t happening across the board. On the other hand it worked after initial installation before I began updating the system and adding the abilities to play all types of multimedia.

@ivom66 - I am also a ubuntu user who is giving suse a try. It’s a shame about these audio problems because I never had them in ubuntu. Despite these I am really liking suse so far so I’m reluctant to throw in the towel, although a desktop without sound is not of great use to me.

@olcpu

I never use totom, so I can't give advise, ... only ask questions that YOU should be asking. Do you have w32codec-all installed?

I wish I knew more of the kinds of questions I should be asking to get this working but unfortunately Im still a bit of a newb :wink:

However - I did not have w32codec-all installed previously but do now, although it made no difference. I was hoping that was why I was having trouble playing mp3’s in Banshee but it must be the same issue thats preventing totem and possible mplayer.

I have my mplayer set to xv and alsa. I use smplayer as a front end to mplayer. And I never run 3D desktop effects. But if you are using 3D desktop effects you may have to set this to x11.

I think I am just running mplayer (if starting from command line I type ‘gmplayer’). I do have compiz running, but if i start mplayer from cl and open an .avi with audio set to ALSA, the error msgs seem to be audio related not video related. I can post some output if your interested.

I think for the moment I will try removing alsa-plugins-pulse as suggested in the last few posts and see if that works. Otherwise, I will probably do a fresh install (thank God I installed /home on a separate partition this time ;)), and then carefully reinstall codecs and software and see if there is a particular package that causes these sound crashes (assuming I get the same problem).

I’ll update further if I have any success.

nimajiman: I do not think you need to re-install everything.

If you read the following thread:
openSUSE problems - a short list - openSUSE Forums
You will see the steps I went through:

  1. Remove VLAN repository and keep packman only
  2. Set alsa instead of automatic in the audio properties (I’m using Gnome)
  3. Set VLC to OSS, everything else is set more or less to ALSA, with the exception of Realplyer, which you may want to download and install version 11 anyway - version 11 uses Alsa.