Linux Sound Problem

(please excuse me if this is off topic or has already been answered
somewhere)

Sometimes I get an error when starting SDL progs that says,

mcop: Warning - User defined signal found in SIGPIPE. Overriding

or something similar to that. The prog will start, but the sound will be
delayed by about 3 seconds. I seems to be linked to the aRTS sound server.

Any suggestions?

Well, this sounds like something is going wrong between SDL and aRts, but
either way, if you care about latency, don’t use any sound server at all.

The ones currently in existence aren’t designed for low latency, and if
they were, you’d still need a patched kernel to get what I’d call
"reasonable" latency. (Then again, IMHO, there’s no way at all to get a
similarly “reasonable” latency on Win32. There’s my standards, basically,
and the main reason why I dropped Windows as a target for serious hacking
in the first place.)

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Monday 15 April 2002 11:38, Sweeney, Steven (FNB) wrote:

(please excuse me if this is off topic or has already been answered
somewhere)

Sometimes I get an error when starting SDL progs that says,

mcop: Warning - User defined signal found in SIGPIPE. Overriding

or something similar to that. The prog will start, but the sound will
be delayed by about 3 seconds. I seems to be linked to the aRTS sound
server.

Any suggestions?

On Mon, Apr 15, 2002 at 02:18:55PM +0200, David Olofson wrote :> On Monday 15 April 2002 11:38, Sweeney, Steven (FNB) wrote:

(please excuse me if this is off topic or has already been answered
somewhere)

Sometimes I get an error when starting SDL progs that says,

mcop: Warning - User defined signal found in SIGPIPE. Overriding

or something similar to that. The prog will start, but the sound will
be delayed by about 3 seconds. I seems to be linked to the aRTS sound
server.

Any suggestions?

Well, this sounds like something is going wrong between SDL and aRts, but
either way, if you care about latency, don’t use any sound server at all.

The ones currently in existence aren’t designed for low latency, and if
they were, you’d still need a patched kernel to get what I’d call
"reasonable" latency. (Then again, IMHO, there’s no way at all to get a
similarly “reasonable” latency on Win32. There’s my standards, basically,
and the main reason why I dropped Windows as a target for serious hacking
in the first place.)

Then I don't quite understand how so many commercial games do
not have this latency problems ?! (or do I just miss
something here?)

- Markus


Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
"Mind if I MFH ?" “What QA did you do on it?” “the usual?” “ah… none :)”

On Mon, Apr 15, 2002 at 02:18:55PM +0200, David Olofson wrote :

(please excuse me if this is off topic or has already been answered
somewhere)

Sometimes I get an error when starting SDL progs that says,

mcop: Warning - User defined signal found in SIGPIPE. Overriding

or something similar to that. The prog will start, but the sound
will be delayed by about 3 seconds. I seems to be linked to the
aRTS sound server.

Any suggestions?

Well, this sounds like something is going wrong between SDL and aRts,
but either way, if you care about latency, don’t use any sound server
at all.

The ones currently in existence aren’t designed for low latency, and
if they were, you’d still need a patched kernel to get what I’d call
"reasonable" latency. (Then again, IMHO, there’s no way at all to get
a similarly “reasonable” latency on Win32. There’s my standards,
basically, and the main reason why I dropped Windows as a target for
serious hacking in the first place.)

Then I don't quite understand how so many commercial games do
not have this latency problems ?! (or do I just miss
something here?)

Are you sure they actually use aRts? On a reasonably modern sound card,
you can just use OSS or ALSA and grab another channel from the pool, so
you can use your favourite API even if aRts is “hogging” a channel.

Besides, what you’re describing sounds like something going wrong,
between SDL and aRts, or inside aRts. (Considering the mcop error, it
actually looks like the latter to me, but I don’t know enough about aRts
to say anything truly useful about this, I think.) You should never get a
3 second delay - sound daemon or no sound daemon.

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Monday 15 April 2002 15:16, Markus Fischer wrote:

On Monday 15 April 2002 11:38, Sweeney, Steven (FNB) wrote:

Sigh, you’d like to think so wouldn’t you? :slight_smile: I get 1-2 second delays or more if I
leave artsd enabled under KDE3 while running Tux Racer, it’s pretty sad, I had to
play with the buffer settings a while before it became an acceptable delay, even
then it was still pretty sad compared to straight OSS…

-eviltypeguyOn Mon, Apr 15, 2002 at 04:01:04PM +0200, David Olofson wrote:

On Monday 15 April 2002 15:16, Markus Fischer wrote:

On Mon, Apr 15, 2002 at 02:18:55PM +0200, David Olofson wrote :
to say anything truly useful about this, I think.) You should never get a
3 second delay - sound daemon or no sound daemon.

It is very weird. Basically if I start KDE (I’m running RH7.2 and KDE 2.2.1)
with aRts activated at startup I get the mcop problem. If I don’t start aRts
at startup then I don’t get the problem. However, if I don’t start aRts at
startup but then run any prog that runs aRts then I get the mcop problem
again.

Well, no worries. It seems to have only affect me… I’m fairly new to Linux
so it’s probably something I’ve done! :slight_smile:

Thanks.> -----Original Message-----

From: David Olofson [SMTP:david.olofson at reologica.se]
Sent: Monday, April 15, 2002 3:01 PM
To: sdl at libsdl.org
Subject: Re: [SDL] Linux Sound Problem

On Monday 15 April 2002 15:16, Markus Fischer wrote:

On Mon, Apr 15, 2002 at 02:18:55PM +0200, David Olofson wrote :

On Monday 15 April 2002 11:38, Sweeney, Steven (FNB) wrote:

(please excuse me if this is off topic or has already been answered
somewhere)

Sometimes I get an error when starting SDL progs that says,

mcop: Warning - User defined signal found in SIGPIPE. Overriding

or something similar to that. The prog will start, but the sound
will be delayed by about 3 seconds. I seems to be linked to the
aRTS sound server.

Any suggestions?

Well, this sounds like something is going wrong between SDL and aRts,
but either way, if you care about latency, don’t use any sound server
at all.

The ones currently in existence aren’t designed for low latency, and
if they were, you’d still need a patched kernel to get what I’d call
“reasonable” latency. (Then again, IMHO, there’s no way at all to get
a similarly “reasonable” latency on Win32. There’s my standards,
basically, and the main reason why I dropped Windows as a target for
serious hacking in the first place.)

Then I don't quite understand how so many commercial games do
not have this latency problems ?! (or do I just miss
something here?)

Are you sure they actually use aRts? On a reasonably modern sound card,
you can just use OSS or ALSA and grab another channel from the pool, so
you can use your favourite API even if aRts is “hogging” a channel.

Besides, what you’re describing sounds like something going wrong,
between SDL and aRts, or inside aRts. (Considering the mcop error, it
actually looks like the latter to me, but I don’t know enough about aRts
to say anything truly useful about this, I think.) You should never get a
3 second delay - sound daemon or no sound daemon.

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -’


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

On Mon, Apr 15, 2002 at 02:18:55PM +0200, David Olofson wrote :

to say anything truly useful about this, I think.) You should never
get a 3 second delay - sound daemon or no sound daemon.

Sigh, you’d like to think so wouldn’t you? :slight_smile:

Seems like I’m being overly optimistic. :slight_smile:

Anyway, I got the impression that this only happened sometimes

I get 1-2 second delays

Ouch! I knew there were issues with aRts and latency, but not that it was
that bad…

or more if I leave artsd enabled under KDE3 while running Tux Racer,
it’s pretty sad, I had to play with the buffer settings a while before
it became an acceptable delay, even then it was still pretty sad
compared to straight OSS…

Well, it’s possible to achieve very low latency with networks of
separate processes - but you have to make them SCHED_FIFO, and you have
to be rather careful about how you implement synchronization and
buffering. The traditional “circular buffers” will not work. The whole
network must be running in “hard sync”; ie one buffer at a time. (It’s
the interference between threads blocking and waking up that causes the
need for more buffering, and thus higher latency.)

Check out “JACK Audio Connection Kit” for an example of how this should
be done:

http://jackit.sourceforge.net/

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Monday 15 April 2002 18:00, EvilTypeGuy wrote:

On Mon, Apr 15, 2002 at 04:01:04PM +0200, David Olofson wrote:

On Monday 15 April 2002 15:16, Markus Fischer wrote:

Okay, I got it sorted. This may be of some use to anyone who does sometimes
get this problem… Or even to the SDL developers themselves…

(using Red Hat 7.1 and KDE 2.2.1)

If I run SDL progs immediately after any program has been (or is) using
aRts, I will get an mcop warning which results in the sound in my game being
delayed by up to 3 seconds. However, if I wait for aRts to autosuspend then
when I run an SDL prog, the sound if fine.

There appears to be a conflict with aRts and SDL somewhere (or even
sdl_mixer).

I’ve now set my aRts autosuspend timeout to 20 seconds… and if I’m just
patient then I get no problems (listen for the pops when aRts suspends).

Hope someone finds this useful.

Okay, I got it sorted. This may be of some use to anyone who does sometimes
get this problem… Or even to the SDL developers themselves…

(using Red Hat 7.1 and KDE 2.2.1)

If I run SDL progs immediately after any program has been (or is) using
aRts, I will get an mcop warning which results in the sound in my game being
delayed by up to 3 seconds. However, if I wait for aRts to autosuspend then
when I run an SDL prog, the sound if fine.

There appears to be a conflict with aRts and SDL somewhere (or even
sdl_mixer).

Ah, it sounds like any program that uses aRts will show the same message
if you run it from the command line.

I’ve now set my aRts autosuspend timeout to 20 seconds… and if I’m just
patient then I get no problems (listen for the pops when aRts suspends).

You can also use a fairly well hidden dialog in the multimedia menu to
suspend aRts manually. I’m not running KDE right now, so I’m not sure
exactly where it is, but it’s the aRts monitoring functionality.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Well, I still can’t use arts with SDL but besides that problem what I see
about what are you telling is that when arts is suspended I guess that it
drops its lock on the OSS device (/dev/dsp) and then your application can
access the device directly without using the arts sound server and for that
reason you aren’t experimenting the delay.

So, my question here is: can you play another sound simultaneously after you
start the SDL application?, if you can’t, that is because the application is
not using arts and then you will hear whatever sound you try to play when the
application ends and drops the OSS device lock.

Just a guessing. I’m using KDE 3 with arts 1.0.0

Greettings.
Ernesto.

El Mi? 17 Abr 2002 08:38, Sweeney, Steven (FNB) escribi?:> Okay, I got it sorted. This may be of some use to anyone who does sometimes

get this problem… Or even to the SDL developers themselves…

(using Red Hat 7.1 and KDE 2.2.1)

If I run SDL progs immediately after any program has been (or is) using
aRts, I will get an mcop warning which results in the sound in my game
being delayed by up to 3 seconds. However, if I wait for aRts to
autosuspend then when I run an SDL prog, the sound if fine.

There appears to be a conflict with aRts and SDL somewhere (or even
sdl_mixer).

I’ve now set my aRts autosuspend timeout to 20 seconds… and if I’m just
patient then I get no problems (listen for the pops when aRts suspends).

Hope someone finds this useful.

I have found that if you use smpeg and rely on smpeg to initialise the sound
that if a sound occurs just before the mpeg plays you will get a frame rate
of about 1 per second :slight_smile: I found this out when using Kdevelop and placing a
beep escape code into the console after starting my aplication :wink: Took ages
to work that one out :wink:

Paul.

That’s a very good question and to be honest I haven’t actually tried it the
other way around. Hmmmmm. :)> -----Original Message-----

From: Ernesto Domato [SMTP:ernesto at domato.com.ar]
Sent: Wednesday, April 17, 2002 5:25 PM
To: sdl at libsdl.org
Subject: Re: [SDL] Linux Sound Problem

Well, I still can’t use arts with SDL but besides that problem what I see
about what are you telling is that when arts is suspended I guess that it
drops its lock on the OSS device (/dev/dsp) and then your application can
access the device directly without using the arts sound server and for
that
reason you aren’t experimenting the delay.

So, my question here is: can you play another sound simultaneously after
you
start the SDL application?, if you can’t, that is because the application
is
not using arts and then you will hear whatever sound you try to play when
the
application ends and drops the OSS device lock.

Just a guessing. I’m using KDE 3 with arts 1.0.0

Greettings.
Ernesto.

El Mi? 17 Abr 2002 08:38, Sweeney, Steven (FNB) escribi?:

Okay, I got it sorted. This may be of some use to anyone who does
sometimes
get this problem… Or even to the SDL developers themselves…

(using Red Hat 7.1 and KDE 2.2.1)

If I run SDL progs immediately after any program has been (or is) using
aRts, I will get an mcop warning which results in the sound in my game
being delayed by up to 3 seconds. However, if I wait for aRts to
autosuspend then when I run an SDL prog, the sound if fine.

There appears to be a conflict with aRts and SDL somewhere (or even
sdl_mixer).

I’ve now set my aRts autosuspend timeout to 20 seconds… and if I’m
just
patient then I get no problems (listen for the pops when aRts suspends).

Hope someone finds this useful.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Ah! I expiriences this too as I wrote the smpeg bindings for
PHP. First I thought my linux is broken (well, because I
don’t had a soundcard, it’s a vmware :stuck_out_tongue: ) but then the same
was under win32 too. Good to know what’s happening here.

On Thu, Apr 18, 2002 at 06:31:04PM +1000, Paul wrote :> I have found that if you use smpeg and rely on smpeg to initialise the sound

that if a sound occurs just before the mpeg plays you will get a frame rate
of about 1 per second :slight_smile: I found this out when using Kdevelop and placing a
beep escape code into the console after starting my aplication :wink: Took ages
to work that one out :wink:

Paul.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
"Mind if I MFH ?" “What QA did you do on it?” “the usual?” “ah… none :)”