1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:57:35 +00:00

Kernel: Implement ioctl for the SB16 to change sample rate

Two new ioctl requests are used to get and set the sample rate of the
sound card. The SB16 device keeps track of the sample rate separately,
because I don't want to figure out how to read the sample rate from the
device; it's easier that way.

The soundcard write doesn't set the sample rate to 44100 Hz every time
anymore, as we want to change it externally.
This commit is contained in:
kleines Filmröllchen 2021-08-19 00:04:03 +02:00 committed by Ali Mohammad Pur
parent 2c9afaf5ac
commit d0ceaa24a6
3 changed files with 34 additions and 2 deletions

View file

@ -87,6 +87,8 @@ enum IOCtlNumber {
KCOV_SETBUFSIZE,
KCOV_ENABLE,
KCOV_DISABLE,
SOUNDCARD_IOCTL_SET_SAMPLE_RATE,
SOUNDCARD_IOCTL_GET_SAMPLE_RATE
};
#define TIOCGPGRP TIOCGPGRP
@ -128,3 +130,5 @@ enum IOCtlNumber {
#define FIBMAP FIBMAP
#define FIONBIO FIONBIO
#define FIONREAD FIONREAD
#define SOUNDCARD_IOCTL_SET_SAMPLE_RATE SOUNDCARD_IOCTL_SET_SAMPLE_RATE
#define SOUNDCARD_IOCTL_GET_SAMPLE_RATE SOUNDCARD_IOCTL_GET_SAMPLE_RATE