From owner-freebsd-multimedia@freebsd.org Thu Jan 4 04:02:56 2018 Return-Path: Delivered-To: freebsd-multimedia@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 917B5E81CAA for ; Thu, 4 Jan 2018 04:02:56 +0000 (UTC) (envelope-from meka@tilda.center) Received: from mail.tilda.center (tilda.center [45.77.138.211]) by mx1.freebsd.org (Postfix) with ESMTP id 5CE92782C4 for ; Thu, 4 Jan 2018 04:02:56 +0000 (UTC) (envelope-from meka@tilda.center) Received: from thinker.my.domain (unknown [87.116.176.251]) by mail.tilda.center (Postfix) with ESMTPSA id EC23A127BA for ; Thu, 4 Jan 2018 04:56:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=tilda.center; s=mail; t=1515038195; bh=VGldDLS5ly1mZDE6eqpTuU4nRGNLkxqLB3M3vEgH59I=; h=Date:From:To:Subject; b=SbQE3KY8Nr+l5kXxb0X+sBOA3Q4dEPW6S0E8QM1oUBKo3wF1wWqwPx2WVg9ISJHKW FRpWXEnnivmePr/9cMPSneADPd7Bb2iD9xATXZ51sc+Wn5SH4Z1PIKEVnDEqxul+4K LaOws6tfEjUIFCo3SyKII4XYldCUypiN5qu/W7zs= Date: Thu, 4 Jan 2018 04:56:33 +0100 From: Goran =?utf-8?B?TWVracSH?= To: freebsd-multimedia@freebsd.org Subject: Playing to arbitrary channel Message-ID: <20180104035633.vp55wxjwaeidubix@thinker.my.domain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dlwmhj4ffmsynde2" Content-Disposition: inline User-Agent: NeoMutt/20171208 X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jan 2018 04:02:56 -0000 --dlwmhj4ffmsynde2 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 --dlwmhj4ffmsynde2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE1WIFkXy2ZeMKjjKEWj1TknovrLYFAlpNpe4ACgkQWj1Tknov rLYvARAAhUny30LO0TpLYWvW0qBJJJAI719ahzxWFMu/XUAKg8wcuqEeZTJEW0Rr P9PGAB1hBywHnF8XfTy54gtYixd9ymQj7QQ9AkE9Ren7k27VtCo73+ujXtsN9o5y RHtKZfzSu31F8ALu9MA8XfPMSoNmPYBLbhY1RWwhvcMlzI6pwG/GUXQQ55UzInLE ILiy8RAPU5/PZeioQudmAPRcCEG4VPLrvWZ7bf0NeNg1PRHSv6ejRj+Bkg8RhfP2 j9zoTknFgE6Asl67fOKD572yHSSPEIufatxcy/7IJHk3y1nTRSab5vu4LGHbgM1d QDNZ+gHzyMQ+bwL98HVg2ToTHD0WQLDtojDe8bMyIch0LfxQFI9XQXoQt/B9A75S /K3Xp0DrRNBiulSkkTMdzEgfom8VkFh5VsBu89rWey8+Qr+zR/WMUpQci+GAQWsb qfeJ6HyflKC1SM/pyUzhum7vBroPC87yZErOYy5fAbSVUSAGYCOD3fp9poUJTyXY tQUYmulxMCYSYi1TZSqDfVNNWJyUHHUASgz2/FNf+s9N7qgkGMrPXLGApdq1zbRA bNhYZR5U8qW4XiWG0JXA5DOW0aFk461zpSPCE1454aWd+Ij/SJjrkeN/xCk3p3Iu /3WgWhLQlYJ/+83KQIsz/hCP1MJVepOEAsqo08x7XBxSD2Dvr28= =lKnB -----END PGP SIGNATURE----- --dlwmhj4ffmsynde2--