On Tue, Aug 16, 2005 at 01:26:05PM -0300, Lost Reality wrote: > So...it's a bug ? > > # audioctl play.rate > play.rate=8000 > # audioctl play.rate=44100 > audioctl: set failed: Invalid argument > # audioctl play.rate > play.rate=44100 > # > > I made a little prog (a "DSP"), where (like in audioctl.c), this ioctl > ALWAYS returns -1: > if (ioctl(ES, AUDIO_SETINFO, &Inf) < 0) err(0, "AUDIO_SETINFO");
obviously, some steps missing here. are you doing AUDIO_INITINFO(&Inf); AUDIO_GETINFO(&Inf); Inf.foo = bar; AUDIO_SETINFO(&Inf); or just AUDIO_INITINFO(&Inf); Inf.foo = bar; AUDIO_SETINFO(&Inf); if you are doing the first, like audioctl does, try the second. does that work properly? > (audioctl.c) > if (writeinfo && ioctl(fd, AUDIO_SETINFO, &info) < 0) > err(1, "set failed"); > > I think it's related to some device-independent driver...I don't have the > skills and time to go ahead, sorry :( I spent some time looking into this last week. I found at least two things that cause this with emu(4). first is 'record.port=0x0'. this always causes an EINVAL in sys/dev/audio.c::au_set_port(). I can get past this error by setting a valid source. perhaps emu(4) (and possibly and other drivers) should set a (valid) default recording source? second is in sys/dev/audio.c::au_set_lr_value(), which is actually caused by sys/dev/ic/ac97.c::ac97_mixer_set_port(), but I didn't figure out why this is returning EINVAL. -- <[EMAIL PROTECTED]>