#15 SNDCTL_DSP_GETCHANNELMASK ioctl Edit

open
nobody
Driver (17)
5
2012-07-08
2002-09-04
Anonymous
No

Greetings,

If at all possible, I would like to see the
SNDCTL_DSP_GETCHANNELMASK ioctl implemented.
Apparently it's not very well documented, but is
implemented in several sound drivers.
A grep of my kernel tree shows the ioctl in trident.c,
nec_vrc5477.c, ite8172.c, i810_audio.c, cmpci.c and
au1000.c.

This is currently being used by Ogle developers
(http://www.dtek.chalmers.se/groups/dvd/) as part of
the multichannel detection routine. Without it,
emu10k1 cards default to 2-channel output.

The code snippet that fails on the SB Live 5.1 card is:

if (ioctl(instance->fd, SNDCTL_DSP_GETCHANNELMASK,
&number) >= 0) {
if (!(number & DSP_BIND_FRONT))
perror("unable to get stereo devices !");
if (number & DSP_BIND_SURR)
rear = 2;
if (number & DSP_BIND_CENTER_LFE) {

sub = 1;
front = 3;
}
} else {
perror("unable to get stereo devices !");

front = 2;
rear = 0;

sub = 0;
}
}

Other than that, 5.1 surround output works great :)

thank you,
Greg

Discussion


Anonymous


Cancel   Add attachments