Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Sep 2007 10:06:07 +0800
From:      "Xiaofan Chen" <xiaofanc@gmail.com>
To:        "Chuck T." <freebsdfan@hotmail.com>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: snd_uaudio with libusb ?
Message-ID:  <a276da400709281906m28bacac2r80c27074e222c597@mail.gmail.com>
In-Reply-To: <BAY116-W4072AA56B15EBD7B73FAC9C7B20@phx.gbl>
References:  <BAY116-W4072AA56B15EBD7B73FAC9C7B20@phx.gbl>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9/29/07, Chuck T. <freebsdfan@hotmail.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a276da400709281906m28bacac2r80c27074e222c597>