Re: impact on audio playback on high cpu usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andreas Hennig posted on Thu, 22 Jul 2010 22:02:43 +0200 as excerpted:

> since i installed KDE 4.5 on my kubuntu 10.4 i experience an impact on
> audio playback on hight cpu usage. When i playing an audio file and my
> cpu usage raises the playback gets slower or clicky in worse cases. e.g.
> when i scroll the photo widget in amarok or open a new heavily loaded
> web page (kde.org with the picture changing widget at top)
> 
> I think it was fine before i installed KDE 4.5, but not sure.

While you do mention kde 4.5 and kubuntu 10.4, your problem has as much to 
do with hardware (sound device, cpu, possibly data buses) as with the 
software.  Unfortunately, you don't tell us anything about that.  So what 
CPU, speed, single/dual/quad/etc core, etc?  And what sound device 
hardware are you using?

There's also certain software aspects that fellow kubuntu users might have 
some idea on, but those using other distributions don't know what you're 
running.  Like, kde's sound system is phonon, but it has several possible 
back-ends, xine, vlc, gstreamer, etc.  Which are you using?  And are you 
using pulse-audio or another sound server, or the (presumably) alsa 
drivers directly?

Also, you don't mention what you're using to play the file, amarok, as you 
mention it, or something else?  Does using a different player make a 
difference?  Does using a kde vs non-kde based player make a difference?

In some players and with some sound drivers, you can increase the buffers, 
both the raw sound data buffer (post-software processing, ready for the 
hardware), and cached file data (file or net socket read-ahead buffer).  
If that's available in your players, does that make a difference?

Here, I have a somewhat older dual socket dual-core Opteron 290 (so two 
separate CPUs, each dual-core, quad-core but on two separate sockets) 
system.  The sound driver is alsa, no pulse-audio or other sound server.  
Sound hardware is AD19818 (AMD8111 chipset).  I use the phonon xine 
backend, and am running Gentoo Linux ~amd64.  Because the mobo and chipset 
is a bit older (2003 vintage), it's still PCI/PCI-X with AGP video.  None 
of the newer PCI-E.

For quite some time I had issues with sound slow-down not when CPU usage 
got high (with four cores @ 2.8 GHz, if that's a problem, something's 
terribly wrong), in fact, I could have a load average over 100 without 
issue, but with heavy disk I/O, as when trying to rebuild the kernel/md 
based RAID.  Sound playback would get slllooowww and dragged out.  I tried 
a number of things including rebuilding my kernel with fully preemptive 
multitasking and a tick rate of 1000 Hz (where I normally use the more 
moderate voluntary preemption and 300 Hz).  It turned out that in my case, 
the problem was that the on-chip sound hardware buffer was small, and I 
was running too high a PCI bus latency in the BIOS.  When I shortened that 
to the minimum possible 32 clocks, the issue disappeared, even with more 
server oriented settings in my kernel (no preemption, 100 Hz clock).  But 
increasing the PCI latency even a single notch, to 64 clocks, would bring 
back the slow audio during heavy disk I/O.

So in my case, it wasn't software at all, including the kernel, but 
rather, the small audio chip buffer in hardware, requiring the minimum PCI 
latency setting possible, 32 clocks.

Something else you might try, particularly if you have older video, is to 
temporarily toggle off desktop effects.  That's in kcontrol (wrongly aka 
system settings, as it's mostly per-user kde settings NOT general system 
settings), Look & Feel, Desktop, Desktop Effects.  On the General tab, 
simply hit the Suspend Compositing button, and see if that helps.  If your 
system is doing a lot of its video rendering in the CPU due to older video 
hardware or not having a good video driver, that can make a big 
difference.  My entire desktop was quite slow (too slow to be usable until 
I tweaked things) with my old r2xx based Radeon 9200 video card.  I 
updated to a far newer r7xx based Radeon hd4650, and can enable whatever 
effects I want now, without issue, altho the drivers aren't quite stable 
yet and I experience occasional crashes, even with the latest kernel,
xf86-video-ati driver, mesa, and xorg-server.  (I had to run a couple 
components compiled straight from git sources, when I first installed it, 
as there wasn't even a beta release available yet, with the necessary 
hardware support.)

If that helps, you can try changing the animation speed on the general 
tab, tweaking settings on the advanced tab, or turning off some effects 
(like shadows or transparency which will be on all the time, not just when 
switching windows) on the all effects tab.  That might allow you to keep 
some effects on, instead of disabling them all at once.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.


[Index of Archives]     [Trinity (TDE) Desktop Users]     [Fedora KDE]     [Fedora Desktop]     [Linux Kernel]     [Gimp]     [GIMP for Windows]     [Gnome]     [Yosemite Hiking]
  Powered by Linux