Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Sep 2007 22:47:47 -0700
From:      Chuck T. <freebsdfan@hotmail.com>
To:        Xiaofan Chen <xiaofanc@gmail.com>
Cc:        freebsd-usb@freebsd.org
Subject:   RE: snd_uaudio with libusb ?
Message-ID:  <BAY116-W245D862663F945A3204C2CC7B30@phx.gbl>
In-Reply-To: <a276da400709281906m28bacac2r80c27074e222c597@mail.gmail.com>
References:  <BAY116-W4072AA56B15EBD7B73FAC9C7B20@phx.gbl> <a276da400709281906m28bacac2r80c27074e222c597@mail.gmail.com>

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.
>=20
>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.

It's an (as yet unreleased) ham radio VoIP program called thelinkbox. =20
It connects ham radio repeater systems together using the Internet=20
(http:cqinet.sf.net).  Eventually it will support multiple radio ports=20
which is the reason for using USB audio dongles rather than audio cards.
The GPIO bits are connected to the push to talk (PTT) of the transmitter.
Other GPIO bits are used to interface to an DTMF decoder used to send
commands to the computer from the radio.
=20
>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).

I talk to the GPIO bits via vendor specific requests to the control pipe. =
=20
I do a usb_open() when my application loads and never close it.  When I nee=
d
to set a GPIO bit I use usb_control_msg().  I've never "looked under the=20
covers" to see why it works, but it does.

>=20
>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
>=20
>=3D=3D=3D[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
>=20
>=3D=3D=3D[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
>=20
>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.

Thanks for responding anyway!


_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=3Dwindows+vista&mkt=3Den-US&form=3DQBR=
E=



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