Playing to arbitrary channel

Goran Mekić meka at tilda.center
Thu Jan 4 04:02:56 UTC 2018


Hello,

I know I can open all channels, set to zero ones I don't want to play
and set to something meaningfull those channels I want to be played. Is
there a better way of saying "I want one channel, but play it on
soundcard's channel 10"? If that is not possible, how can I get number
of channels? I tried this:


oss_audioinfo ai = {0, };
ai.dev = -1;
int fd = open(device, O_RDWR, 0);
ioctl(fd, SNDCTL_AUDIOINFO, &ai);
printf("%d\n", ai.max_channels);


I tried it on my laptop, and it works just fine, but I didn't test it
with virtual_oss. Is that appropriate call for virtual_oss, too?

Also, I don't understand SNDCTL_DSP_SETTRIGGER. I briefly looked at jack
using it, and it seams to me ioctl is set after every read or write.
I didn't get the impression I should do it more than once based on
http://manuals.opensound.com/developer/SNDCTL_DSP_SETTRIGGER.html. What
I want is that my read() and write() are in sync, and this ioctl looks
like the thing I'm looking for, but I'm not sure. I always thought read
and write are synced by driver, but I could be wrong. Can anyone tell me
how to properly use this call? Thanx!

Regards,
meka
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-multimedia/attachments/20180104/0e237916/attachment.sig>


More information about the freebsd-multimedia mailing list