tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Trouble with azalia(4) and audio(4)



Hi.

I bought a new PeeCee and it has an azalia(4). It took me a while to
figure out how to set up the mixer(4) to get at least somthing out of
it. Now I can audiorecord(1) and then audioplay(1) from / to Line-In /
Line-Out.

Problem: I want to loop Line-In trough the mixer(4) to Line-Out. It
seems this is impossible. I used AZALIA_DEBUG and AZALIA_DEBUG_DOT to
get this dmesg and corresponding graph:
http://www.unixag-kl.fh-kl.de/~jkunz/tmp/dmesg.boot.azalia-debug
http://www.unixag-kl.fh-kl.de/~jkunz/tmp/azalia.gif

Am I right that there is no simple route Line-In - mixer(4) - Line-Out?

For now I tried to write a simple programm to echo Line-In to Line-Out:

dev_audio_fd = open ("/dev/audio", O_RDWR);
AUDIO_INITINFO( &audio_inf);
audio_inf.play.sample_rate = 44100;
audio_inf.play.channels = 2;
audio_inf.play.precision = 16;
audio_inf.play.encoding = AUDIO_ENCODING_SLINEAR;
audio_inf.record.sample_rate = 44100;
audio_inf.record.channels = 2;
audio_inf.record.precision = 16;
audio_inf.record.encoding = AUDIO_ENCODING_SLINEAR;
audio_inf.mode = AUMODE_PLAY | AUMODE_RECORD;
ioctl( dev_audio_fd, AUDIO_SETINFO, &audio_inf);
for (;;) {
        read( dev_audio_fd, buf, buf_size);
        write( dev_audio_fd, buf, buf_size);
}

I tried various values for buf_size and it does not work. Sometimes I
get distorted output (buf_size < audio_info.blocksize), somtimes I get
only a ticking sound (buf_size > audio_info.blocksize). If I use
buf_size = audio_info.blocksize it sometimes works OK, most of the time
the speaker stays silent and only the first block is audible.
(I querried audio_info.blocksize by ioctl(AUDIO_GETINFO).)

It seems I miss somthing essential about the semantics of audio(4).
Can someone enlighten me please?
-- 


tschüß,
       Jochen

Homepage: http://www.unixag-kl.fh-kl.de/~jkunz/



Home | Main Index | Thread Index | Old Index