LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   13.1 "VLC failed to initialize your sound output device" if opened after Firefox (http://www.linuxquestions.org/questions/slackware-14/13-1-vlc-failed-to-initialize-your-sound-output-device-if-opened-after-firefox-824788/)

RajahBrooke 08-07-2010 09:01 AM

13.1 "VLC failed to initialize your sound output device" if opened after Firefox
 
Hello,

I've been having a recurring problem on Slackware64 13.1. If I open VLC (or any other media player available for Slackware) before I open Firefox, then my sound works 100% and there's never any problem, however, if I open Firefox first, and there happens to be a flash video loading, then any other media player (mplayer-plugin, Amarok or VLC) will fail to play sound. VLC tells me:

Quote:

Potential ALSA version problem:
VLC failed to initialize your sound output device (if any).
Please update alsa-lib to version 1.0.24 or higher to try to fix this issue.
Now, I'm happy to do that if it will actually fix the problem, though I'll have to figure out how seeing as I'm something of a n00b. The thing is that I've not really done anything to alsa except run alsaconf on my first boot, so I'm not sure if that's really the problem

I've been using Slackware64 for a few months now, I'm on my first ever install and for the most part I'm loving it. Been working through the little things that have been annoying me, and for the most part I've managed to find solutions either by reading the Slackbook, by browsing LQ or by doing a quick Google search. However, I can't seem to find any reference to this specific problem anywhere and I'm not sure what I should do.

I'll give the output to any command you might find useful. Thanks for any help you can give.

amani 08-07-2010 09:14 AM

Which plugins/addons are you using in Firefox?

Installing alsa-lib from source should be easy... scripts should be available.

You can provide more verbose output (or through debug packages).

Post /var/log/user.log (relevant parts)

RajahBrooke 08-07-2010 09:32 AM

I've got mplayer-plugin and Flash player 10 installed, both using slackbuilds.org, and I've got Greasemonkey, Adblock Plus, and Compact menu addons installed. Though the problem has existed for as long as Flash has been installed.

Here is the output of vlc -v

Code:

VLC media player 1.1.0-rc The Luggage (revision exported)
Blocked: call to unsetenv("DBUS_ACTIVATION_ADDRESS")
Blocked: call to unsetenv("DBUS_ACTIVATION_BUS_TYPE")
Warning: call to signal(13, 0x1)
Error: call to XSetErrorHandler((nil))
Error: call to XSetIOErrorHandler((nil))
Blocked: call to setlocale(6, "")
Blocked: call to sigaction(17, 0x7f4323ac1b30, 0x7f4323ac1a90)
Error: call to XSetErrorHandler(0x7f4324be23a0)
Error: call to XSetIOErrorHandler(0x7f4324be2370)
Blocked: call to setlocale(6, "")
Warning: call to signal(13, 0x1)
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
(32627) KSycocaPrivate::openDatabase: Trying to open ksycoca from  "/var/tmp/kdecache-chris/ksycoca4"
Blocked: call to putenv("LANGUAGE=")
Warning: call to rand()
Blocked: call to signal(12, 0x7f4320630f10)
Warning: call to signal(13, 0x1)
Warning: call to rand()
Warning: call to rand()                                                                 
Warning: call to rand()                                                                 
Warning: call to sigaction(13, 0x7f4323abe210, (nil))                                   
Warning: call to rand()                                                                 
Warning: call to rand()                                                                 
Warning: call to rand()                                                                 
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
 m_el[mi_level] == NULL
 arrrrrrrrrrrrrg Up cannot escape itself
 m_el[mi_level] == NULL
 arrrrrrrrrrrrrg Up cannot escape itself
[0x952438] avcodec decoder warning: refusing to decode non validated subtitle codec
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Blocked: call to setlocale(1, "C")
Blocked: call to setlocale(1, "en_US")
Blocked: call to setlocale(1, "C")
Blocked: call to setlocale(1, "en_US")
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
[0x7f43140352a8] alsa audio output warning: audio device: default is already in use
[0x7f43140352a8] oss audio output error: cannot open audio device (/dev/dsp)
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
Blocked: call to sigaction(11, 0x7f430f4748a0, (nil))
Blocked: call to sigaction(7, 0x7f430f4748a0, (nil))
Blocked: call to sigaction(8, 0x7f430f4748a0, (nil))
Blocked: call to sigaction(3, 0x7f430f4748a0, (nil))
Warning: call to sigaction(14, 0x7f430f4748a0, (nil))
[0x7f43140352a8] main audio output warning: PTS is out of range (-9957), dropping buffer
[0x7f43140352a8] main audio output warning: PTS is out of range (-21907), dropping buffer
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
[0xbaf8d8] main video output warning: vlc_object_find_name(postproc) is not safe!
[0xbaf8d8] main video output warning: late picture skipped (258428 > -1592)
[0xbaf8d8] main video output warning: late picture skipped (218428 > -1592)
[0xbaf8d8] main video output warning: late picture skipped (178428 > -1592)
[0xbaf8d8] main video output warning: late picture skipped (58428 > -1592)
[0xbaf8d8] main video output warning: late picture skipped (98428 > -1592)
[0xbaf8d8] main video output warning: late picture skipped (18428 > -1592)
[0xbaf8d8] main video output warning: late picture skipped (30383 > -1319)
[0xbaf8d8] main video output warning: late picture skipped (16646 > -929)
[0xbaf8d8] main video output warning: late picture skipped (96646 > -929)
[0xbaf8d8] main video output warning: late picture skipped (56646 > -929)
[0xbaf8d8] main video output warning: late picture skipped (120069 > -890)
[0xbaf8d8] main video output warning: late picture skipped (160069 > -890)
[0xbaf8d8] main video output warning: late picture skipped (69 > -890)
[0xbaf8d8] main video output warning: late picture skipped (80069 > -890)
[0xbaf8d8] main video output warning: late picture skipped (40069 > -890)

It says that the sound device is already in use.

Also, I don't think updating to alsa-lib 1.0.24 will work, since on the alsa official site, the latest software source release is listed as 1.0.23.

amani 08-07-2010 09:51 AM

Go to system settings --> multimedia and fix the problem

Ilgar 08-07-2010 09:52 AM

Configure your software to use ALSA output. If it goes for OSS it will try to block the card, which is impossible if there is already another audio app running.

Ilgar 08-07-2010 09:57 AM

By the way, let me post my ~/.asoundrc file here: This is on EeePC 1005HA. The "convert_mic" device is created to workaround a problem of this computer's Intel HDA card when using certain software, so you probably won't need it, therefore you can use noconvert_mic instead.

Code:

pcm.convert_mic {
        type route
        slave {
                pcm "plughw:0"
                channels 2
        }
        ttable {
                0 {
                        1 1.0
                        1 1.0
                }
        }
}
pcm.noconvert_mic {
        type route
        slave {
                pcm "plughw:0"
        }
}

pcm.!default {
        type asym
        playback {
                pcm "swmixer"
        }
        capture {
                pcm "convert_mic"
        }
}

pcm.swmixer {
type dmix
ipc_key 1234
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
}


Ilgar 08-07-2010 09:57 AM

Edit: Deleted double post.

RajahBrooke 08-07-2010 10:36 AM

Sorry to be a pain, but I want to be as clear as possible about this so that I can at least avoid human error. In my experience I'm the most detrimental thing to my system's stability, so please forgive my caution :)

@ amani: I've tried going into System Settings > Multimedia, but I can't find a way of changing whether something uses alsa or OSS, and the order of the sound cards seems to be correct already, with "HDA Intel (STAC92xx Analog)" preferred over "HDA Intel, INTEL HDMI 0 (HDMI audio output)" and "Esound (ESD)" - with the second option making no sound when tested, and the latter falling back to "HDA Intel (STAC92xx Analog)." If there is a way of fixing this problem through System Settings in KDE, I can't figure it out.

@ IIgar: in VLC > Tools > Preferences > Audio, "Output module" is already set to "ALSA audio output" and "Device" is set as "HDA Intel: STAC92xx Analog (hw:0,0)" - with the other options being "HDA Intel: INTEL HDMI 0 (hw:0,3)" and "HDA Intel: STAC92xx Digital (hw:0,4)." Does this sound OK?

I don't currently have a ~/.asoundrc, should I make one as normal user or as root? And if I do this, would I need to point alsa to it manually, because if that's the case, I'm not entirely clear how to do that and I don't want to do anything that could make it harder to solve this problem in future.

Ilgar 08-07-2010 10:46 AM

Just create that .asoundrc file in your home directory (I think /etc/asound.conf is the global file if you want). You shouldn't need to do anything after that -- the new settings should take effect immediately (but you should restart your audio apps, of course).

RajahBrooke 08-07-2010 11:09 AM

OK, I did what you said, creating .asoundrc as normal user using vim, including everything after "pcm.noconvert_mic", then I closed all audio apps and restarted x for good measure, but the problem is exactly as before. If I have mplayer-plugin running in FF, with no flash videos using sound, then all other sound apps work fine, and if I open VLC first and play a file, then sound works fine regardless of if flash is running or not. However, if I open FF, go to youtube (for example) play a video, then pause and try playing a file in VLC, I get the exact same error message and no sound in any other multimedia apps either (only flash will play audio, though skype, and notification sounds also work fine). Flash seems to be the problem, so might upgrading to 10.1 help?

Ilgar 08-07-2010 11:57 AM

If you only copied the part after noconvert_mic, you should replace the line

pcm "convert_mic"

with

pcm "noconvert_mic"

If you didn't do that the .asoundrc script will give an error and won't take effect. Otherwise I don't understand why it's not working. This "dmix" solution has always worked for me.

RajahBrooke 08-07-2010 12:38 PM

OK, I did what you said, having copied your scrips starting with pcm.noconvert_mic (leaving out the first section) and changed

pcm "convert_mic"

to

pcm "noconvert_mic"

Leaving everything else exactly as written, closing all audio apps, restarting x, it seems to have made no difference whatsoever - if I open a flash video, no other audio apps work, either in FF or anywhere else.

I also tried copying the entire script, from the start and making the same change, but that makes no difference either. I created the ~/.asoundrc as normal user, rather than su-ing to root, I assume that's correct seeing as it's in /home. Should I have done it as root?

This is, literally, the only flaw left in a system that I'm otherwise extremely happy with, and it's not normally a big deal, I just make sure the first thing I do when I log into KDE is open a file with VLC, then everything works perfectly - it's just annoying.

[edit] actually, your script seems to have made things worse - now if I open VLC first, I get zero audio in flash in FF :S

[edit] oh, no. Even after deleting .asoundrc, the problem persists, now no flash videos play sound if VLC or mplayer is playing a file... I have no idea why that could possibly be. I'm properly confused.

Ilgar 08-07-2010 01:06 PM

Uhh -- I'm confused as well. Does the Flash plugin use OSS or alsa? If it tries to use OSS then it will fail even with this fix. Sometimes old software using OSS is upgraded to use ALSA, so you may consider upgrading the plugin. However I doubt that this is necessary for Flash, because I've used this sort of fix for several years now and it always worked.

One more (admittedly hopeless) attempt: Does running Firefox as

Code:

aoss firefox
any difference?

Edit: Btw, when you use that asoundrc, configure your software to use the "default" output device. If you explicitly tell them to use the card (hw0) it won't owrk.

RajahBrooke 08-07-2010 01:29 PM

OK, up until now, I've had things set to use hw0, so I'll try all the variations of your script with applications set to use default. If none of those work, I'll try "aoss firefox", and if that doesn't work, I think I'll uninstall flash 10 and upgrade to 10.1, since it doesn't seem likely that will make things worse. Plus, I've read on other forums that the new version of flash stops things from freezing up when you view videos in full screen, so even if it doesn't solve the sound problem, it'll be an improvement of some form :)

Ilgar 08-07-2010 02:50 PM

Good luck -- I'm about to set out for a week long trip, so this will probably be my last message for a while :).


All times are GMT -5. The time now is 10:12 AM.