New meaning oss_sysinfo.nummixers
- Reply: Christos Margiolis : "Re: New meaning oss_sysinfo.nummixers"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 04 Oct 2024 20:57:17 UTC
Hi guys!
I was inactive for months, one week ago I reinstalled CURRENT on my main
laptop (and others). The meaning of "struct oss_sysinfo.nummixers"
changed. Let's say:
#include <sys/soundcard.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
int main()
{
int fd;
struct oss_sysinfo si;
const char *mixer="/dev/mixer0"; //or your mixer
if ((fd = open(mixer, O_RDWR)) == -1) {
printf("Error open()\n");
return (-1);
}
if (ioctl(fd, SNDCTL_SYSINFO, &si) == -1) {
printf("Error SNDCTL_SYSINFO\n");
return (-1);
}
close(fd);
printf("nummixers: %d\n", si.nummixers);
return (0);
}
Output "nummixers: 7", But
% sysctl dev.pcm
... prints 6 devices dev.pcm.[0-5].*
% ls /dev/mixer*
/dev/mixer0 /dev/mixer1 /dev/mixer2 /dev/mixer3 /dev/mixer4 /dev/mixer5
6 mixers from 0 to 5. But now oss_sysinfo.nummixers is 7, it was 6 until
some months ago.
I thought the new value could be the max index, in the case some mixers
are closed, example /dev/mixer0 /dev/mixer2 /dev/mixer5. But in this
case 'nummixers' should be 5 not 7.
Maybe the hidden /dev/mixer is in the count (6 + 1 = 7).
Same situation on 3 laptops. So, what is the new meaning for
oss_sysinfo.nummixers?
Thank you in advance for any reply (now I am working/busy on another
subsystem, I hope to look at audio(4) again in the future).
Best regards,
Alfonso