Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jun 2012 17:34:59 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-multimedia@freebsd.org
Subject:   [HOWTO] How to duplicate USB audio output
Message-ID:  <201206261734.59309.hselasky@c2i.net>

next in thread | raw e-mail | index | archive | help
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



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