Hi all,
this is a nice little posting from the Con Kolivas Linux interactivity patches list. Note that it is about Cedega, not Wine, but it might easily affect Wine, too.
Are we doing some big no-nos in the threading area here? (or maybe it's just done the way it is because we cannot do it a different, better way?)
For the whole discussion, please see http://bhhdoa.org.au/pipermail/ck/2004-August/000428.html
Andreas Mohr
----- Forwarded message from ck-request@vds.kolivas.org -----
Message: 12 Date: Mon, 16 Aug 2004 21:31:59 +1000 From: Con Kolivas kernel@kolivas.org Subject: Re: [ck] 2.6.8.1-ck1, cedega-cvs, ALSA sound (choppy) To: greblus@poczta.onet.pl Cc: ck@vds.kolivas.org Message-ID: 41209B2F.4030207@kolivas.org Content-Type: text/plain; charset="us-ascii"
Wiktor Grebla wrote:
On Mon, Aug 16, 2004 at 08:16:08PM +1000, Con Kolivas wrote:
It wont be a preempt threshold problem. See if it's a priority issue on the part of wine*. Be absolutely certain that wineserver, wine and the game are all run the _same_ priority and not a better priority than X. Send me the output of 'top -b -n 1' during the sound being choppy. Then try running _all_ the wine things at nice +19. This is a simple sanity check to see where the problem lies.
It's in fact as you say, all parts of wine have different priorities, and some of them are higher than X:
greblus@greblus:~$ top -n 1 -b | grep wine 1630 greblus 23 0 471m 230m 164m R 92.8 45.9 1:54.63 wine 1666 greblus 20 0 471m 230m 164m S 2.0 45.9 0:01.64 wine 1629 greblus 20 0 2400 1192 2176 S 0.0 0.2 0:00.00 winex 1633 greblus 20 0 6864 5056 6756 S 0.0 1.0 0:01.10 wineserver 1634 greblus 20 0 6864 5056 6756 S 0.0 1.0 0:00.15 wineserver 1659 greblus 20 0 471m 230m 164m S 0.0 45.9 0:00.00 wine 1660 greblus 21 0 471m 230m 164m S 0.0 45.9 0:00.00 wine 1662 greblus 20 0 471m 230m 164m S 0.0 45.9 0:00.06 wine 1663 greblus 33 0 471m 230m 164m R 0.0 45.9 0:00.41 wine
greblus@greblus:~$ top -b -n 1 | grep X 621 root 20 0 88092 18m 75m S 0.0 3.8 1:02.96 X
After renicing all of them there is no problem with choppy sound in all of time wasting programs I've on my disk :>, and overall (subjective) performance is better of course.
Full output of top -b -n 1 is here: http://unixforge.org/~greblus/ck/top_-b_-n_1.txt
Kindest Regards, W.
Thanks for details. You do not have different nice levels; that is PRI that is different, which is the "dynamic" priority that constantly changes by the scheduler. It is as I suspected, though - if you renice everything +19 and the problem goes away it is bad programming on the wine developers' part that use what's called sched_yield instead of proper locking between their threads. Don't concern yourself over the details, but at least you have a simple workaround... sigh
Cheers, Con
On Tue, 17 Aug 2004 10:06:46 +0200, Andreas Mohr wrote:
Are we doing some big no-nos in the threading area here? (or maybe it's just done the way it is because we cannot do it a different, better way?)
For the whole discussion, please see http://bhhdoa.org.au/pipermail/ck/2004-August/000428.html
Well, apparently we don't use sched_yield, so the problem must lie somewhere else. Maybe Con can help us out here? Alexandre says he doesn't know what the issue is either and somebody needs to investigate. I guess we do need to concern ourselves over the details :)