LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Why does xorg prevent audio apps from working and how does gnome fix it (https://www.linuxquestions.org/questions/linux-desktop-74/why-does-xorg-prevent-audio-apps-from-working-and-how-does-gnome-fix-it-761980/)

brian flachs 10-14-2009 10:25 PM

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

thanks for your help,

brian

i92guboj 10-14-2009 11:26 PM

Quote:

Originally Posted by brian flachs (Post 3719724)
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.

brian flachs 11-05-2009 07:49 PM

ok i have tried a few more things.
 
ok, i still think something i dont understand is up.
i start running flac123 from the command line from a virtual console. plays fine.

i changed .xinitrc to the following:

#!/bin/sh
LITTLECOM=1
export LITTLECOM
xterm -ls -n littlecom -sb -C -geometry 88x8-78-0

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

thanks in advance for any ideas.

brian

i92guboj 11-05-2009 07:55 PM

Then there must be some very rare conflict with your drivers going on. Let us know if this still happens with nv or vesa.

I assume you are using some kind of onboard audio chip, don't you? If so, do you have any spare pci audio card to test?

brian flachs 11-05-2009 08:32 PM

tried simple xorg.confs
 
tried without an xorg.conf (also turned my amp up a bit)

i got Nouveau as the default driver.
heard clicking noise on amp. assuming this happens when something alters sound state.

flac123 hangs

i hear more clicking when xserver exits.

gened up a new xorg.conf with system-config-display, it turns out to request nv. clicking and no luck with music.

edited this to request nonexistant driver. still clicks.
of course cant try flac123 as xserver really doesnt get going. clicks on the way out too.

vesa failed to get a intelligible display up, but clicking can be heard.

------------------------------

audio: yes my motherboard has audio built in. it is a realtek 889a and an intel e45 chipset

alsa 1.0.20

i dont have a spare audio card.

but i am real puzzled because in the good-ol days
the Xserver had nothing at all to do with audio.

brian flachs 11-05-2009 08:43 PM

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.

brian

i92guboj 11-05-2009 08:47 PM

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.

ps. it seems our posts crossed :)

brian flachs 11-05-2009 09:20 PM

ok,

i am trying a different player (/usr/bin/play) at console it works fine.

but under x (again w/o WM)

ALSA lib confmisc.c:768: (parse_card) cannot find card '0'
ALSA lib conf.c:4154: (_snd_config_evaluate) function snd_func_card_driver returned error: Permission denied
ALSA lib confmisc.c:392: (snd_func_concat) error evaluating strings
ALSA lib conf.c:4154: (_snd_config_evaluate) function snd_func_concat returned error: Permission denied
ALSA lib confmisc.c:1251: (snd_func_refer) error evaluating name
ALSA lib conf.c:4154: (_snd_config_evaluate) function snd_func_refer returned error: Permission denied
ALSA lib conf.c:4633: (snd_config_expand) Evaluate error: Permission denied
ALSA lib pcm.c:2211: (snd_pcm_open_noupdate) Unknown PCM default
/usr/bin/play formats: can't open output file `default': cannot open audio deviceok.

btw, i am going here because i notice both mplayer & flac123 are starting pulse audio and dbus. must be part of lib-pulse...

brian flachs 11-05-2009 09:22 PM

i didnt mean to imply that mouse action is related to noises. just that clicking noises can be heard when x starts/quits

i92guboj 11-05-2009 09:44 PM

What a thing.

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.

brian flachs 11-05-2009 10:09 PM

etc has asound.conf.pulse and asound.state

i dont have a ~/.asoundrc or .asoundconf

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.

brian flachs 11-05-2009 10:23 PM

ok, i have missed something.

i copied the /etc/X11/xinitrc to ~/.xinitrc

and moved my WM startup into ~/.Xclients and audio seems to be working.

more investigation tomorrow...

brian flachs 11-05-2009 10:24 PM

maybe i need to reboot between experiments...

i92guboj 11-05-2009 10:26 PM

Quote:

Originally Posted by brian flachs (Post 3746519)
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.

https://bugzilla.redhat.com/show_bug.cgi?id=501255


Just a random thought: did you try adding your user to the audio group and then re-login into? Does the sound work as root?

saurabh4lq 09-21-2010 11:50 AM

success
 
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.

Enjoy Coding
Saurabh


All times are GMT -5. The time now is 08:13 PM.