Re: [linux-audio-dev] realtime audio i/o with disk input

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] realtime audio i/o with disk input
From: Maarten de Boer (mdeboer_AT_iua.upf.es)
Date: Wed Mar 20 2002 - 18:02:47 EET


Thanks Paul for your reply.

> don't ever run application threads at max priority. it makes it
> impossible to construct a watchdog for runaways.

Okay, I'll make that max-1

> you don't need to use mutexes for the buffer itself. when there is one
> reader and one writer, you can use a lock free ringbuffer. this will
> avoid blocking the audio thread when it goes to see if there is enough
> data.

Okay. Anyway, things are Wrong when there is not enough data.

> however, you probably do need to use mutexes to drive the disk input
> thread's operations. in ardour, the disk input thread gets woken
> periodically by the audio thread when the latter believes that work
> might be necessary. the disk input thread wakes up, checks on the
> current state of things, and then (maybe) gets busy.

Okay, so I understand that you use the audio thread check if the
buffer needs to be filled, the opposite of my approach, where the
disk in thread checks this. Any particular reason for this?

Ah, okay, in my approach the disk-in thread enters a while to see
if the readindex has moved enough. It checks all the time, even if
the readindex did move but not enough. With your approach, you only
signal when you _know_ it has moved enough. Is that it?

What is the wake-up mechanism you use? pthread_cond_signal/wait?

> never beta test applications with RT priority :) you don't need RT
> priority to get this to work.

But at some point I need to run in in RT priority to see if that works.

> are your IDE drives properly tuned with hdparm? there was a thread on
> alsa-devel about in the last 24 hours in which using hdparm completely
> fixed precisely this issue.

I believe I did. I run tunedisk from Benno's latencytest.

> several people have reported X Window issues. this seems to be
> specific to particular video adapters and/or motherboards. are you
> using a low latency kernel, and is low latency turned on? which

Yes (Andrew Morton), and yes (echo 1 > /proc/sys/kernel/lowlatency)

> version of XFree86 are you using, and which video adapter?

4.1.0 (debian woody), Matrox MGA 400

Maarten


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Wed Mar 20 2002 - 16:51:17 EET