From owner-freebsd-usb@FreeBSD.ORG Thu Oct 10 06:34:44 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5162DDEF for ; Thu, 10 Oct 2013 06:34:44 +0000 (UTC) (envelope-from hps@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id 0F09F226D for ; Thu, 10 Oct 2013 06:34:43 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id 34A467A1B3; Thu, 10 Oct 2013 08:34:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 9FD5F8F8A7A; Thu, 10 Oct 2013 08:35:06 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zfeWu1Jj4X5f; Thu, 10 Oct 2013 08:35:05 +0200 (CEST) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id BA3188F8A79; Thu, 10 Oct 2013 08:35:05 +0200 (CEST) Message-ID: <52564ACE.30401@bitfrost.no> Date: Thu, 10 Oct 2013 08:35:58 +0200 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130522 Thunderbird/17.0.6 MIME-Version: 1.0 To: Bertrand Petit Subject: Re: Using a C-Media multichannel USB DAC References: <20131010031324.GM3765@memo2.memo.frmug.org> In-Reply-To: <20131010031324.GM3765@memo2.memo.frmug.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Oct 2013 06:34:44 -0000 On 10/10/13 05:13, Bertrand Petit wrote: > > Here on my desktop lies a new cheap multichannel brand-less USB DAC. I > suppose it is based on a C-Media CM6206 chip. [1] From what I read in the > datasheet [2] signals must properly be routed using HID requests before > anything goes out of the connectors. How could this be done? My use case is to > use four channels consisting of independent stereo signals. One pair is to be > routed either to a jack or the S/PDIF output while the second pair is to be > routed to a headphone. > > When plugged-in snd_uaudio recognises this device only a as stereo > one: > > ugen1.2: at usbus1 > uaudio0: on usbus1 > uaudio0: Play: 48000 Hz, 2 ch, 16-bit S-LE PCM format > uaudio0: Record: 48000 Hz, 2 ch, 16-bit S-LE PCM format > uaudio0: No midi sequencer > pcm1: on uaudio0 > uhid0: on usbus1 > > I've not yet managed to understand how the 8 channels of the device can be > exposed to userland. Could this be done? How? If it helps I've attached the > output produced by lsusb on this device. Hi, Your device is a FULL speed device, and 8 channels is on the edge of what full-speed can do, so 2-channels is selected over 8-channels. Run this before plugging: sysctl hw.usb.uaudio.default_channels=8 The uaudio.c driver has support for talking directly to the USB HID interface for USB audio devices (/dev/uhid0) if you need to do some special programming for your device. Typically this is used for volume controls and such. "find /usr/src/sys/dev -name uaudio.c" --HPS > > > [1] > [2]