[linux-audio-dev] Alsashmrec 1.0 released

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

Subject: [linux-audio-dev] Alsashmrec 1.0 released
From: Juhana Sadeharju (kouhia_AT_nic.funet.fi)
Date: Sat Sep 30 2000 - 16:15:14 EEST


Is this

  Overruns : 9
  Total overruns : 62

what your Alsa driver shows after a recording session? Have a bad day?
Don't worry! Now your recording sessions ends always to this:

  Overruns : 0
  Total overruns : 0

Specially if you grab and run a brand new Alsashmrec 1.0 which provides
previously unexperienced reliability for recordings. Grab it now!

 -*-*-*-*-*-*-

Yep, I'm happy to announce the first release of Alsashmrec which is
a simple recording program I now use instead of the 'arecord'. It is
available at "http://www.funet.fi/~kouhia/waves/" and released under
GNU license.

What is the difference? Why should you bother?

Alsashmrec gains its reliability by dividing the recording to two concurrent
tasks. First task reads the A/D converter and second task writes the audio
to disk. These tasks runs in two separate processes. The problem of 'arecord'
is that a write to disk freezes the reading of the A/D. By running the tasks
in separate processes, no freeze can happen.

The effect is that with 'arecord' I had to stop using Linux during recording
so that no any external disk use would freeze the recorder's disk use for
a too long time. Now with Alsashmrec, I'm able to copy a directory with 90
Mbytes of data, compare the two directories with diff, and finally remove
the copied directory --- without any overruns.

You should change if you used 'arecord' or any other recorder which performs
read()/write() loop in one process. They are unreliable.

 -*-

Alsashmrec is not complete: it records only to raw audiofiles and it supports
rather old Alsa driver (0.2 something). While these will be fixed, you could
pick up any other reliable recorder. There are better recorders out there
than Alsashmrec --- check Ardour which offers even more better reliability
because it additionally uses soft-realtime programming techniques. [Names
of other reliable recorders escape me, anyone?]

 -*-

Technical details:

(Alsa)shmrec was really not the first recorder which uses two processes.
A recorder named 'srec' is first such recorder I know of. While Alsashmrec
uses a lock-free buffer in delivering audio between the processes, 'srec'
used a buffer with multiple segments -- each segment was locked with
a semaphore. As has been demonstarted a lock-free approach is a far more
efficient (and don't consume all semaphores available in the system).

In Alsashmrec, the A/D reader is the main process. It runs continuously
and stops only for read() call while waiting new audio from A/D. The
disk writer is a secondary process. It puts it itself to sleep whenever
there are no new audio to be saved to disk, and it is woken up by the A/D
reader when A/D reader is sure there is enough new audio to be saved to
disk. Selfsleeping is implemented by sending SIGSTOP signal, and wake-up
is implemented by sending SIGCONT signal.

 -*-

I'm also working on a soft-realtime version of my recorder providing
also additional features. Until then, enjoy with Alsashmrec -- remember
check the '-l' option.

Requests:
Could somebody give a help in supporting some audiofile library?
Support for newer Alsa drivers?

And hey, feedback is always welcome!

Best Regards,

Juhana


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

This archive was generated by hypermail 2b28 : Sat Sep 30 2000 - 16:40:14 EEST