Why does xorg prevent audio apps from working and how does gnome fix it
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Why does xorg prevent audio apps from working and how does gnome fix it
i have upgraded from f9 to f11 and now am having difficulties with audio. i prefer to run vtwm w/o
gnome or kde. if i exit xorg, from the console i can run mplayer/flac123 and get audio. If i startx w/o gnome sound does not work. if i switch back to a virtual console sound starts working again. if i startx w/ the default gnome setup audio works.
so the question i have is what is new about the x-server
that affects audio? and what can i put into xorg.conf to return it to previous behavior?
another question might be: what is gnome doing to reenable audio and how can i mimick this without running the gnome desktop?
a few possibly relevant details...
X.Org version: 1.6.3.901 : nvidia driver
Advanced Linux Sound Architecture Driver Version 1.0.20.
f9 had X.Org version 1.4.99.901 also with nvidia driver
i have upgraded from f9 to f11 and now am having difficulties with audio. i prefer to run vtwm w/o
gnome or kde. if i exit xorg, from the console i can run mplayer/flac123 and get audio. If i startx w/o gnome sound does not work. if i switch back to a virtual console sound starts working again. if i startx w/ the default gnome setup audio works.
so the question i have is what is new about the x-server
that affects audio? and what can i put into xorg.conf to return it to previous behavior?
Nothing in xorg should affect audio at all. I'd rather try running the applications in X from a terminal and seeing exactly what's what doesn't work, if are there error messages, if alsamixer volumes are ok, etc. etc. etc.
If you have previous configurations for vtwm or whatever you are using, check the configs and see if you are launching some audio daemon or something strange from there, like jackd. Also, if you use startx, check ~/.xinitrc and see what's in there.
Quote:
another question might be: what is gnome doing to reenable audio and how can i mimick this without running the gnome desktop?
Your audio is based on alsa, when you enter gnome you are probably using pulseaudio on-top of alsa, but your audio works with alsa alone at the command line, so alsa is not the problem (and if it was pulseaudio wouldn't work either).
Unless there's some highly odd conflict in there, your problem must be somewhere in the init files of your wm or in your ~/.xinitrc.
while playing some music. as soon as the xserver starts, sound stops. after exiting music begins again where it left off. notice i am running just xserver and an xterm, no window manager no desktop. switching back to the virtual console resumes playback.
if i let the console flac123 finish. and try to run a player from xterm it hangs asthough it is waiting for the audio device. i assume it is busy, but why?
i have also tried runnning
/usr/bin/Xorg
now no xclients at all -- stops the audio
switch to virtual console 1 -- audio begins again from
where it stopped. i can start an xterm from a virtual console and attempt to run flac123 and it hangs.
i think the xserver is doing something. again this is with the nvidia proprietary drivers. i will try again with nv
also it still bothers me that starting gnome gets it going again
something gnome is doing is making audio workable again. i assumed it was starting the pulse-audio stuff, so i tried to do that manually and havent had success.
Ugh, there must be something really wrong about either your sound driver or your hardware. The fact that you hear noises when clicking suggests that something is not ok.
X has nothing to do with the sound (at least still, thanks dog), and you are not using an WM that could be interfering. I assume that X is not starting a sound daemon via xinitrc or something, you seem to be aware of what you are doing as per your posts above, so I assume all these trivial things are ok.
Back to your first post, what gnome does is to launch pulseaudio, I guess. Gnome programs might also be running using the gstreamer media layer. You can try to force the pulse backend in command line as long as your player supports it. You will have to check the documentation for each program to know how to force the pulseaudio backend. You can try mplayer as a test, it would be something like
Code:
mplayer -ao pulseaudio filename.mp3
Each program is different. Most should detect pulse if it's installed and use it though. But you can force them in any case to see if there's any problem, if they work ok, etc.
Can you check a couple of things? See if /etc/asoundrc exists, if so, move it elsewhere, or rename it. Then look for a file called .asoundrc in your home (with a dot in front of the name, ~/.asoundrc). If it exists, move it elsewhere. I suspect it must be some really silly thing that fedora does with pulseaudio. Remember to move it/them back if that changes nothing.
Can you also check if pulse is running before and after launching X with top, htop or a similar tool? If it's not running before but it's running after, then try killing it and check if that re-enables your sound.
lots of things seem to start /bin/dbus-daemon and /usr/bin/pulseaudio if they arenot already running. but not the xserver. i imagine that firefox has pluggins that want sound and inits libpulse which starts them up.
killing them does not re-enable sound.
is gentoo better? is a pain to get sendmail/mailx/dhcpd/httpd etc setup, but i am pretty stuck.
is gentoo better? is a pain to get sendmail/mailx/dhcpd/httpd etc setup, but i am pretty stuck.
That's the question of the million dollar.
It certainly is not for the lazy, and it takes a bit of a learning curve at the beginning. Besides that, it's just like everything else in life, it has its lovers and detractors. The support is superb, that alone makes it great for me. In other distros you have very poor support, that includes some paid ones.
The problem with binary distros like fedora of ubuntu is that they are a complete mess. They are cool when they work out of the box for you, but if you have to get your hands dirty then you don't know where the problem are coming from, which is the case now.
I haven't ever seen your problem. It's weird to say the least, however on a quick google I see that you are not the only one having that problem in Fedora.
I was facing the same problem.
In default gnome setup sound was working fine.
But as soon I swithced to openbox,and started doing startx manually.
mpg321 played the audio but no sound came out of speakers.
I did following
Code:
$alsactl restore
Audio works fine now.
Thanks guys.
Though mine is a late reply but still I am posting it hoping it may
help someone in need.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.