LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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



Reply
 
Search this Thread
Old 05-27-2004, 01:08 AM   #1
thef0x82
LQ Newbie
 
Registered: Sep 2003
Location: Omaha, NE
Distribution: Redhat
Posts: 14

Rep: Reputation: 0
Audio Queued


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?

Edit: Audio card is a Soundblaster PCI 128

Last edited by thef0x82; 05-27-2004 at 01:15 AM.
 
Old 05-27-2004, 01:57 AM   #2
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
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.

Last edited by adz; 05-27-2004 at 06:26 AM.
 
Old 05-27-2004, 04:59 AM   #3
motub
Senior Member
 
Registered: Sep 2003
Location: The Netherlands
Distribution: Gentoo (main); SuSE 9.3 (fallback)
Posts: 1,607

Rep: Reputation: 46
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.

Hope this helps.
 
Old 05-27-2004, 10:49 AM   #4
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
I just found this in the GAIM FAQ:
Quote:
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'.
 
Old 05-27-2004, 12:29 PM   #5
np complete
Member
 
Registered: May 2004
Distribution: Fedora Core 2/3
Posts: 51

Rep: Reputation: 15
I'm having the same issue.

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.
 
Old 05-27-2004, 01:06 PM   #6
thef0x82
LQ Newbie
 
Registered: Sep 2003
Location: Omaha, NE
Distribution: Redhat
Posts: 14

Original Poster
Rep: Reputation: 0
You can fix the noise by turning down the PCM slider in the volume controls. It only takes a little though, too much and you loose your volume.
 
Old 05-27-2004, 09:43 PM   #7
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
Quote:
I am in Gnome, using alsa.
I've tried creating that libao.conf file and it did nothing.
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?
 
Old 05-28-2004, 12:23 AM   #8
np complete
Member
 
Registered: May 2004
Distribution: Fedora Core 2/3
Posts: 51

Rep: Reputation: 15
Quote:
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
Code:
default_drive=alsa
 
Old 05-28-2004, 01:25 AM   #9
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
I assume that's a typo and it in fact says "default_driver=alsa".

You can't get simultaneous sound just by using ALSA. You have to use either a sound server or the dmix plugin.

Last edited by adz; 05-28-2004 at 01:28 AM.
 
Old 05-28-2004, 05:55 AM   #10
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
In gaim select command in the sound settings. In the command box type something like "aplay -D plugin:dmix %s".
 
Old 05-28-2004, 11:04 PM   #11
thef0x82
LQ Newbie
 
Registered: Sep 2003
Location: Omaha, NE
Distribution: Redhat
Posts: 14

Original Poster
Rep: Reputation: 0
I'm not sure I mentioned it earlier, but I run KDE. I switched both XMMS and GAIM to arts, and they seem to work simultaneously now.
 
Old 05-29-2004, 02:21 AM   #12
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
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.

How did you go on the XMMS priority/skip problem?
 
Old 05-29-2004, 04:02 AM   #13
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Did you skim my post because on many of my systems using the command that I gave works.
 
Old 05-29-2004, 08:49 AM   #14
thef0x82
LQ Newbie
 
Registered: Sep 2003
Location: Omaha, NE
Distribution: Redhat
Posts: 14

Original Poster
Rep: Reputation: 0
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?

Last edited by thef0x82; 05-29-2004 at 08:55 AM.
 
Old 05-29-2004, 09:10 AM   #15
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
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.

Last edited by adz; 05-29-2004 at 09:13 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
jobs queued in cups but printer wont print samel_tvom Linux - Software 1 11-28-2004 10:03 PM
all sound queued while listening to music! SamerAdra Linux - Newbie 6 11-07-2004 06:23 PM
Transferring queued mail of postfix? jpassion Linux - General 2 10-28-2004 04:39 PM
Getting stat=queued for remote users msteudel Linux - Newbie 0 08-12-2004 12:44 PM
Can timer_interrup get queued up? SeanatIL Programming 2 07-06-2004 02:21 PM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration