From alsa-devel-owner@alsa.jcu.cz  Tue Jan 12 15:46:31 1999
Received: from nic.funet.fi (nic.funet.fi [128.214.248.6])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id PAA27268
	for <alsa-devel@alsa.jcu.cz>; Tue, 12 Jan 1999 15:46:28 +0100
Received: from localhost (user: 'kouhia', uid#241) by nic.funet.fi id <2989-2279>; Tue, 12 Jan 1999 16:43:40 +0200
From: Juhana Sadeharju <kouhia@nic.funet.fi>
To: alsa-devel@alsa.jcu.cz
In-reply-to: <369B426F.D9C171FA@ife.ee.ethz.ch> (message from Thomas Sailer on
	Tue, 12 Jan 1999 13:39:11 +0100)
Subject: Re: Linux scheduler issues.
Message-Id: <19990112144344Z2989-2279+2024@nic.funet.fi>
Date: 	Tue, 12 Jan 1999 16:43:40 +0200
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

>From:	Thomas Sailer <sailer@ife.ee.ethz.ch>
>
>So my point is: In how far do computer music apps differ from
>my modem stuff? And given that my modem stuff works, why
>all the fuzz about the scheduler? Has anyone actually tried and
>had problems?

I have had following problem:

I made an int variable to shared memory. One process played the audiofile
from disk to D/A and wrote the current location to the shared memory.
Second process read the shared memory and draw a vertical line on the wave
graph at correct location.

When I printed the shared memory values, I found following: even the player
wrote all values (at sample rate 44100 with step 256), the second process
got values starting from a second (or such) from the beginning. Audio
played but the values written to the shared memory just didn't go to
the other process. The strange is that the second process did read the
initial value from the shared memory even the first process constantly
changed it. I even tried with "volatile" after my friend suggested it
but it didn't help. To me it looks like Linux's shared memory is not
a true shared memory. I'm not sure if this has nothing to do with
process scheduling.

 -*-

What about this latency problem. I printed some values when I wrote shmrec
and the two processes switched quite lazily. With such lazy switching
there is no way to do a realtime processing. Would the situation be
different if the read()/write() buffers would be much shorter? Would the
process switch after each read()/write()? Then it could be possible to do a
realtime processing but, for example, direct recording to disk would fail at
least in my system.

Yours,

Juhana

