tech-kern archive

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

Trouble with azalia(4) and audio(4)


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 /

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:

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); = 44100; = 2; = 16; = 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?



Home | Main Index | Thread Index | Old Index