From owner-freebsd-usb@FreeBSD.ORG Sat Sep 29 02:06:08 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE82D16A418 for ; Sat, 29 Sep 2007 02:06:08 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by mx1.freebsd.org (Postfix) with ESMTP id 7C91313C474 for ; Sat, 29 Sep 2007 02:06:07 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so3822657waf for ; Fri, 28 Sep 2007 19:06:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=hpYFy4B75/FeSH/5FAQwaZrMhaE94yZwJlqWKcmKyUk=; b=GyWl4+5EhKJLka8Tp4OOV4TIaqlh04ZuEN9xECOPvM56kE0A9EZ8kjn0Hgh9kAtCdiOCdMFDuU1OFCTb31aacrCghbpqSZloG6lNOP+YbhnNJjik1oYu4izFzez7gtmzTgRkB81vwwYuTWGPUVb0MjjptSNOcRleiijE3mA58bs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=CfP00MQXd5M6XuDBwKUvWqrWO7bz2CTeV21HX+G4cw1lWw9Fo1e+vOM7IIOcoIcK5dRqtGGomDlGbZJLm/waz7mQdy22zOr0e33AKHSLu6Io/irfK4YhYmAy2aMhe8BsENqDRuxCgYsHzfUPKhzkRxNbxSgYE9g+5IiQTJuVaTo= Received: by 10.114.156.1 with SMTP id d1mr1169183wae.1191031567356; Fri, 28 Sep 2007 19:06:07 -0700 (PDT) Received: by 10.114.176.17 with HTTP; Fri, 28 Sep 2007 19:06:07 -0700 (PDT) Message-ID: Date: Sat, 29 Sep 2007 10:06:07 +0800 From: "Xiaofan Chen" To: "Chuck T." In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: freebsd-usb@freebsd.org Subject: Re: snd_uaudio with libusb ? X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Sep 2007 02:06:08 -0000 On 9/29/07, Chuck T. wrote: > > I have a Linux application that talks to an USB audio dongle > that I'm trying to port to FreeBSD. I have no problem with the > audio portion, but I'm also trying to use libusb to access the > GPIO bits on the chip. What is the Linux application? How does the Linux work with the audio and GPIO working at the same time? As far as I know, Linux in libusb needs to unbind the kernel driver using the non-portable usb_detach_kernel_driver_np function in order to have access to the usb device --to set the configuration and claim the interface. I think your device is a USB composite USB device with two interfaces (one for USB audio and the other for GPIO). How do you control the GPIO under Linux (by control transfer or interrupt/bulk transfer)? If the Linux application indeed works at the same time as the USB audio, then Linux does bind different driver to different interfaces (one for the usb audio interface and no driver for the GPIO interface). Ok I am now under FreeBSD and the following is the output from a USB composite device (audio and genric). I have the firmware burnt but I have not built the full USB soundcard. http://home.comcast.net/~armag1234/soundcard.html ===[mcuee] ~/Desktop/build/pyusb-0.4.1/samples # sudo ./usbenum.py Device: /dev/ugen0 Device class: 0 Device sub class: 0 Device protocol: 0 Max packet size: 8 idVendor: 4660 idProduct: 15 Device Version: 00.00 Configuration: 1 Total length: 133 selfPowered: 0 remoteWakeup: 0 maxPower: 200 Interface: 0 Alternate Setting: 0 Interface class: 1 Interface sub class: 1 Interface protocol: 0 Interface: 1 Alternate Setting: 0 Interface class: 1 Interface sub class: 2 Interface protocol: 0 Alternate Setting: 1 Interface class: 1 Interface sub class: 2 Interface protocol: 0 Endpoint: 0x2 Type: 1 Max packet size: 96 Interval: 2 Interface: 2 Alternate Setting: 0 Interface class: 0 Interface sub class: 0 Interface protocol: 0 Endpoint: 0x1 Type: 3 Max packet size: 64 Interval: 1 Endpoint: 0x81 Type: 3 Max packet size: 64 Interval: 1 ===[mcuee] ~ # sudo ls -la /dev/ugen* crw-r--r-- 1 root operator 0, 118 Sep 29 09:18 /dev/ugen0 crw-r--r-- 1 root operator 0, 117 Sep 29 09:18 /dev/ugen0.1 So it seems that ugen only binds the first interface for this USB composite device. Not so sure if there is a method to bind the other interfaces. I am also not so sure if libusb will work in this case. I am not that experienced with FreeBSD USB. Sorry no real help here. A bit strange that this USB soundcard is not recognized under FreeBSD. I am using an old version of HPS USB stack. Xiaofan http://mcuee.blogspot.com