Re: [LAD] Realtime threads and security

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Robin Gareus <robin@...>
Cc: <linux-audio-dev@...>
Date: Thursday, February 24, 2011 - 7:09 pm

On 02/24/2011 07:01 PM, Robin Gareus wrote:

I don't think there are spin locks, which would say loop until some data becomes
available, etc.. The libaudio implementation is provided by the device and/or
the harware platform (main chip) manufacturer(s), so it's rather opaque. Some of
these implementations are open source (http://android.git.kernel.org/), but they
can differ a lot.

But to prevent problem in case some libaudio implementations use a spin lock,
then the audio server, audioflinger, could have limited realtime runtime, with
sched_rt_runtime_us, as you mention (at first I was only thinking about this for
the audio clients, not the server).

I don't know about a select function exposed by libaudio. There are only
blocking read() and write() functions AFAIK.

> If the i/o block waits for a signal (e.g. IRQ), it will work just fine.

That sounds good.

In the implementations that I saw so far, when it's not ALSA, it seems to be
some kind of OSS file-based interface. So I think that's quite safe to assume
that read/write operation are backed by an interrupt.

The one catch is that in all libaudio implementations that I saw, some mutexes
get locked in both read() and write(). Is this a problem?

I just looked into JACK1, and I see some pthread mutex being locked in
oss_driver_read(), in drivers/oss/oss_driver.c. What happens in case of a mutex
lock? Is there a context switch?

--
Olivier

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAD] Realtime threads and security, Olivier Guilyardi, (Thu Feb 17, 8:40 pm)
Re: [LAD] Realtime threads and security, Daniel Poelzleithner, (Fri Feb 18, 1:43 pm)
Re: [LAD] Realtime threads and security, Olivier Guilyardi, (Wed Feb 23, 10:10 am)
Re: [LAD] Realtime threads and security, Daniel Poelzleithner, (Wed Feb 23, 5:24 pm)
Re: [LAD] Realtime threads and security, Olivier Guilyardi, (Fri Feb 25, 3:23 pm)
Re: [LAD] Realtime threads and security, Paul Davis, (Fri Feb 25, 3:29 pm)
Re: [LAD] Realtime threads and security, torbenh, (Fri Feb 25, 3:56 pm)
Re: [LAD] Realtime threads and security, Olivier Guilyardi, (Fri Feb 25, 3:54 pm)
Re: [LAD] Realtime threads and security, Paul Davis, (Fri Feb 25, 4:32 pm)
Re: [LAD] Realtime threads and security, Olivier Guilyardi, (Fri Feb 25, 4:40 pm)
Re: [LAD] Realtime threads and security, Olivier Guilyardi, (Fri Feb 25, 4:31 pm)
Re: [LAD] Realtime threads and security, Paul Davis, (Fri Feb 25, 4:33 pm)
Re: [LAD] Realtime threads and security, Olivier Guilyardi, (Fri Feb 25, 4:49 pm)
Re: [LAD] Realtime threads and security, Paul Davis, (Fri Feb 25, 4:54 pm)
Re: [LAD] Realtime threads and security, Paul Davis, (Thu Feb 17, 8:48 pm)
Re: [LAD] Realtime threads and security, Olivier Guilyardi, (Thu Feb 17, 9:27 pm)
Re: [LAD] Realtime threads and security, Robin Gareus, (Thu Feb 17, 9:54 pm)
Re: [LAD] Realtime threads and security, Olivier Guilyardi, (Wed Feb 23, 10:22 am)
Re: [LAD] Realtime threads and security, Robin Gareus, (Wed Feb 23, 7:28 pm)
Re: [LAD] Realtime threads and security, Olivier Guilyardi, (Thu Feb 24, 2:59 pm)
Re: [LAD] Realtime threads and security, Robin Gareus, (Thu Feb 24, 6:01 pm)
Re: [LAD] Realtime threads and security, Olivier Guilyardi, (Thu Feb 24, 7:09 pm)
Re: [LAD] Realtime threads and security, Fons Adriaensen, (Thu Feb 17, 10:04 pm)
Re: [LAD] Realtime threads and security, Olivier Guilyardi, (Fri Feb 18, 12:17 pm)
Re: [LAD] Realtime threads and security, torbenh, (Fri Feb 18, 11:19 am)
Re: [LAD] Realtime threads and security, Paul Davis, (Thu Feb 17, 9:55 pm)