The following code is from an stable release of a project, and compiles fine, but fails with "mixer set to mic: Invalid Argument".
I'm running Fedora 11, and am using the v4.2 RPM from this site's download page.
I don't understand this. OSS is running fine for me, and Audacity can record just fine without any error of this sort.
Why is this happening?
Thanks
- Code: Select all
if ((mixerFD = open("/dev/mixer", O_RDONLY)) < 0) {
if (errno == EBUSY) {
fprintf(stderr, "%s %d: mixer device busy.\n",
__FILE__, __LINE__);
fprintf(stderr, "%s %d: Using current setting.\n",
__FILE__, __LINE__);
}
else {
fprintf(stderr, "%s %d: %s\n", __FILE__, __LINE__,
strerror(errno));
exit(1);
}
}
int32 sourceMic = SOUND_MASK_MIC;
if (ioctl(mixerFD, SOUND_MIXER_WRITE_RECSRC, &sourceMic) < 0) {
if (errno == ENXIO)
fprintf(stderr,
"%s %d: can't set mic source for this device.\n",
__FILE__, __LINE__);
else {
fprintf(stderr,
"%s %d: mixer set to mic: %s\n",
__FILE__, __LINE__, strerror(errno));
exit(1);
}
}
