LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-11-2006, 04:50 PM   #1
Hunter2
Member
 
Registered: May 2005
Distribution: Slackware 10.2
Posts: 43

Rep: Reputation: 15
ALSA troubles, triggered by CPU usage? [edit: CPUfreq]


Hey everyone... got some problems here getting sound working (in particular, mixing)

First:
-I've set up my 'default' ALSA device to use dmix/dsnoop, as well as my dsp0 (OSS) emulated device, although the situation was exactly the same without dsnoop.
-Kernel 2.6.16.17, ALSA compiled into kernel and OSS emulation modules compiled into kernel
-alsa-util 1.0.11rc2, alsa-lib 1.0.11rc2, alsa-oss 1.0.11rc3, all compiled from source (1.0.11rc2 chosen to match kernel ALSA version)
-esd.conf includes "-d default" as a startup option

OK, the problem is:
When an application uses the 'default' device, or else uses OSS and is launched using aoss (i.e. any application using dmix), any time the CPU load increases to 70% or higher for longer than about 0.5 second (maybe shorter, I don't know), all sound output is cut, and any application using dmix either:
a) hangs
b) gives an error
c) goes into sort of 'silent fast-forward'
If the application is then restarted (after CPU load goes back down), it can again output sound.

I think this may be related to another problem:
When NOT using dmix, i.e. selected device hw:0,0, and CPU usage rises to a similar level, sound output momentarily 'skips' (pauses for a split second; for xmms, music then skips ahead by around 30 seconds), and then resumes playing ordinarily after a moment. I tested this first by switching desktops using 3ddesk (3D pager, very cool), and then later using a shell script running a tight loop:
while [ 1 ]
do
echo SPAM
done

The sound skips for a moment, and then resumes playing smoothly/indefinitely while the 'SPAM' loop is still running. However, when using dmix, the sound simply cuts out.

Similarly, I have ESD configured to go through dmix, and when applications run through ESD, anytime the CPU load goes high, the applications simply hang; running 'killall esd' then restores sound/unhangs the applications, and 'ps -e' shows that ESD is again running. Attempting to run arts through ALSA gave an error message about not allowing input on 'default' (That's why I put dsnoop in, I haven't re-tried arts with ALSA yet), and running through ESD doesn't work: initializing arts puts CPU load up to 100% for a few seconds, and ESD hangs; killing ESD then causes arts to give an error about device/hardware configuration and quit.

Does anyone know what might be causing this problem? I'd REALLY appreciate any help/suggestions, I've been googling all day for info linking ALSA/dmix failures with high CPU usage, and I haven't found anything yet.. I've been trying to get Linux working on this laptop for a month now, and this is pretty much the last thing I need to have everything running smoothly.

Thanks in advance,
-Hunter2

Last edited by Hunter2; 06-12-2006 at 08:05 AM. Reason: More info
 
Old 06-11-2006, 05:15 PM   #2
Hunter2
Member
 
Registered: May 2005
Distribution: Slackware 10.2
Posts: 43

Original Poster
Rep: Reputation: 15
OK, while typing up my last post, talking about CPU usage and laptops gave me an idea; I have CPU frequency scaling set using the OnDemand governor. After some testing using the userspace and performance governors, it seems that the problem only occurs when setting CPU frequency higher. I have two steps available: 1.60ghz and 3.07ghz. When running at either one of these, using 3ddesk and dead-looping have no effect on sound playback. However, when running at 1.60ghz and then switching to 3.07ghz, the problem occurs (I'm now assuming that the skipping and cutting out are the same problem). Switching from 3.07ghz to 1.60ghz seems to have no negative effects.

So it *seems* that I'll have no problems as long as I keep a static CPU frequency... but I spent a really long time trying to get CPUfreq working, so I'm hoping there's another solution >.<

Any suggestions at this point are very welcome.. linux has been a b*tch to me so far, I just hope I can get everything sorted out before I give up and go back to Windoze (and lose whatever l33tness points I've gained so far ).

P.S.
In my kernel config, I currently have pre-emptible kernel set, as well as 'pre-empt the big kernel lock'... would this make a difference at all, do you think? Or perhaps should I be looking more toward ACPI and CPUfreq settings?

-Hunter2
 
  


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
Get CPU Usage ramicub Programming 3 11-02-2010 04:34 AM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 08:43 PM
CPU usage ElectroLinux Linux - General 2 12-03-2004 09:49 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM
Controlling CPU usage & memory usage Saravana babu Linux - Software 0 02-18-2004 05:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:14 AM.

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
Open Source Consulting | Domain Registration