[HOWTO] How to duplicate USB audio output

Hans Petter Selasky hselasky at c2i.net
Tue Jun 26 15:35:23 UTC 2012


Hi,

You've maybe wondered how you can duplicate the USB audio output without too 
much hassle. Here is a quick HOWTO using 8-stable, 9-stable or 10-current.

1) su
2) usbconfig

Locate your USB audio device, for example ugen4.2.

ugen4.2: <USB Headset> at usbus6, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON

3) Locate output format for USB audio device

dmesg | grep -C 10 ugen4.2

uaudio0: Play: 48000 Hz, 2 ch, 16-bit S-LE PCM format.
uaudio0: Record: 48000 Hz, 1 ch, 16-bit S-LE PCM format.
uaudio0: No midi sequencer.

4) Install /usr/ports/audio/sox

5) Playback something on your USB device

6) Locate the USB audio endpoint used:

usbdump -i usbus4 -f 2 -v

usbus4.2 SUBM-ISOC-EP=00000001,SPD=FULL,NFR=8,SLEN=1536,IVAL=0
                            ^^ endpoint number in hex

7) Redirect audio output by use of usbdump from device 4.2 and endpoint 1 to 
another audio device in raw binary format:

usbdump -s 65536 -i usbus4 -f 2.1 -b /dev/stdout | \
env AUDIODEV=/dev/dsp1 play -c 2 -r 48000 -b 16 -t raw -s /dev/stdin

Good luck!

--HPS


More information about the freebsd-multimedia mailing list