Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So I recently made the complete switch over to Linux. I'm running White Box latest version (3.0?). I just downloaded the ISOs last week. I've been trying to get all the functionality as I had with Windows. In Windows I ran Winamp and AIM constantly. So now I've got XMMS and GAIM running, but there's an audio conflict. When I've got music going, GAIM can't play any sounds. When a song finishes, GAIM interrupts my music stream with a string of all the sounds it had queued. Then I'm unable to start my music again because it says a program is "blocking" the sound card.
Also, is there a way to increase the priority of XMMS so it doesn't skip everytime I open a new window of any kind?
Sound Queing
Under the old linux drivers (called OSS) you were only able to produce one sound at a time. The only way around it was to use a sound server. The new sound drivers (called ALSA) are much better and have an in-built plugin that can mix sound even if your soundcard doesn't directly support it. To find out which you're using type lsmod into the console and look at the output. If you see an "emu10k1" then you're using OSS. If you see a whole bunch of "snd-*" (and specifically an "snd-emu10k1" then you're using ALSA.
If you're using KDE then you're probably using the aRTs sound server by default and if it's GNOME then it's one called esound. To double check if one of them is running type ps -A and check the output for a line saying "artsd" or "esd". Arts especially is crappy but esd is no picnic either. If you check out XMMS Options -> Preferences -> Audio I/O Plugins down the bottom there will be a section called "Output Plugin". Check to see which plugin it's using and if you've got a sound server running then change the output to the appropriate plugin (aRTs or esound). Gaim also has to have the appropriate output plugin for both apps to be able to simultaneously produce sound. The sound server idea will work with both ALSA and OSS.
If you don't like the sound server idea then you can use ALSA's dmix plugin. It's pretty good but takes a little setting up (it's what I use). FIrst you have to get and install ALSA. Then you have to set up dmix and change the output of any app that produces sound (eg XMMS or GAIM) to its ALSA plugin. The dmix plugin really only works for ALSA aware apps. Sometimes you can trick OSS apps into thinking that they're using OSS when they're really using ALSA but most times you wont.
Those are your two options for that problem.
XMMS Priority
Yes you can set XMMS to have "real time" priority by going to Options -> Preferences -> Options and ticking the appropriate box. That's a little dangerous, though since if something stuffs up it can hang your computer or possibly can be a security risk since XMMS has to effectively run as root.
There is another possibility, though. It could be that your hard disc is not tuned fully under linux. Specifically that DMA is not turned on so it works a little slowly. Hence whenever you access the hard disc the song starts to skip because it can't read it fast enough. Become root and type hdparm -d /dev/hda to check the status of DMA on your hard disc (if it comes back with "command not found" then you'll have to get the hdparm package from somewhere). Obviously, if the hard disc you're using is not /dev/hda then substitute it into the command instead of hda. If the output says it's turned off then do an hdparm -d 1 /dev/hda to turn it on. You can also to an hdparm -tT /dev/hda before and after to give you an approximate indication of the difference DMA makes. Try this option before the real time thing.
If turning DMA on doesn't quite do it for you, you can try to increase the buffer size in the "Output Plugins" section by pressing the "Configure" button. If this option fails then try the real time priority idea.
You might also want to check if the sound server for your preferred desktop is running; if GNOME, you'd want esd (the Enlightened Sound Daemon, or eSound), if KDE you'd want artsd (the aRTs Daemon).
If you then change at least XMMS to use the output plugin of the sound server (it should have both available in Options=Preferences=>Output plugin-- I don't know if this can be set in GAIM, as I don't use it), then the sound server gets the ability to manage sound priority of one or both programs, which should solve the problem as well.
Q. How do I make Gaim use ALSA or OSS for playing sounds? What does the "Automatic" option do?
A. If you choose "Automatic", "ESD", or "Arts", Gaim uses libao to play sounds. Choosing "ESD" or "Arts" forces libao to play sounds using that method, while choosing "Automatic" lets it decide for itself.
If you choose Automatc, you can create a file, either /etc/libao.conf or ~/.libao, and put one of the following lines in it:
default_driver=alsa
default_driver=oss
Other drivers, like alsa09, arts, esd, irix, macosx, and sun might also be supported, depending on your platform, and how libao was compiled. See also 'man 5 libao.conf'.
I am in Gnome, using alsa.
I've tried creating that libao.conf file and it did nothing.
I am also using a soundblaster pci 128 card. wonder if the driver doesn't work properly(?)
I've also noticed that there is a lot of noise in my music.
Originally posted by adz Does your sound not work in gaim or does it not work simultaneously with other devices? What did you put into the file? Did you restart gaim?
I was getting no sound what-so-ever. I restarted gaim. Nothing, I logged out and back in, nothing. Finally did a complete shutdown. When I brought the system back up, I had sound again, but still no simultaneous sound :-\
the only thing i put in the conf file was the line
Wonderful. It's good that you did mention it since it tells anyone reading this thread that a solution was reached and not that we all just ran out of steam.
For the XMMS fix: Options > Preferences then the Audio I/O Plugins tab. Clicked on aRts option for Output Plugin then clicked on configure (button below). I set the buffer size to 5000 ms and the Pre-Buffer Percent to 50 ( default was 3000 and 25). I've noticed it still skips depending on what I'm doing, but not nearly as bad as before, so I might tweak it some more. Note: the window for Configure usually pops up behind the Preferences window, so you'll have to move that out of the way.
I'm sure other fixes you guys suggested works, but I'm a noob so I just tried the easiest thing first, and it worked.
Can someone provide a little more information on dmix and soundservers?
Well to get information on all things ALSA your best bet is the ALSA Wiki. Contained in there are some fairly good information and instructions regarding the Dmix plugin. That's all the information (also some trial end error) I needed to get dmix working for me.
As for sound servers I don't know that much since I never use them. The one that gets consistently the best wrap is JACK. Both aRTs and eSound are considered fairly poor by many but information about them would be best gleaned from their respective websites.
Quote:
I've noticed it still skips depending on what I'm doing, but not nearly as bad as before, so I might tweak it some more.
The hdparm app would be a good place to look first.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.