ioctl to set mixer volume

Alain De Vos devosalain at ymail.com
Fri Apr 16 22:05:35 UTC 2021


I had to copy over a downloaded ioctl.d to the directory 
./core/sys/posix/
I don't know why. But with this dub seems to work. Weird ???

I had forgotten I needed also an integer file handle to provide 
to ioctrl; cfr this code which puts the volume on maximum on my 
PC.
So I need if fact this to dlang ... somehow ...
```
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/soundcard.h>
char *mixerdev="/dev/mixer";
int main(int argc,char *argv[])
{
int mixfd=open(mixerdev,O_RDWR);
int left=255*255+255;
unsigned int x=3221507328U;
ioctl(mixfd,x,&left);
close(mixfd);
exit(0);
}
```


More information about the Digitalmars-d-learn mailing list