# BOSE Companion 5 (USB) WORKING!!!



## trh411 (Jan 7, 2013)

To set the stage, initially my Bose Companion 5 USB was not working after a new install of FreeBSD-9.1-RELEASE. Here are the relevant lines from *dmesg*, which reported a uaudio BOSE device capable of doing nothing, and the output of /dev/sndstat, which did not report any uaudio devices:

```
# dmesg | grep uaudio
uaudio0: <Bose Corporation Bose USB Audio, class 0/0, rev 1.00/1.00, addr 4> on usbus0
uaudio0: No playback.
uaudio0: No recording.
uaudio0: No midi sequencer.

# cat /dev/sndstat:
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <Realtek ALC889A (Internal Analog 3.1/2.0)> (play/rec) default
pcm1: <Realtek ALC889A (Rear Analog)> (play/rec)
pcm2: <Realtek ALC889A (Rear Digital)> (play/rec)
```

The solution turned out to be trivial; there were no USB uaudio default channels set: 

```
# sysctl hw.usb.uaudio.default_channels
hw.usb.uaudio.default_channels: 0
```

So, let's set the USB audio default channels (since this Bose is a 5.1 system, let's use 6 channels) and see if USB audio appears in /dev/sndstat:

```
# sysctl hw.usb.uaudio.default_channels=6
hw.usb.uaudio.default_channels: 0 -> 6

# cat /dev/sndstat:
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <Realtek ALC889A (Internal Analog 3.1/2.0)> (play/rec) default
pcm1: <Realtek ALC889A (Rear Analog)> (play/rec)
pcm2: <Realtek ALC889A (Rear Digital)> (play/rec)
pcm3: <USB audio> (play)
```

It does. We now have USB audio listed, so let's set the default sound device to 3. After this /dev/sndstat should list *pcm3 <USB audio>* as the default device:

```
# sysctl hw.snd.default_unit=3
hw.snd.default_unit: 0 -> 3

# cat /dev/sndstat:
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <Realtek ALC889A (Internal Analog 3.1/2.0)> (play/rec)
pcm1: <Realtek ALC889A (Rear Analog)> (play/rec)
pcm2: <Realtek ALC889A (Rear Digital)> (play/rec)
pcm3: <USB audio> (play) default
```

At this point I had sound!

I put the following statements in /etc/sysctl.conf so they will be executed automatically upon [re]boot:

```
hw.usb.uaudio.default_channels=6
hw.snd.default_unit=3
```

Thought this post might be helpful to someone else since it took me some time before I stumbled upon this solution to my sound problem.


----------



## trh411 (Jan 16, 2013)

Turns out that after setting the default USB uaudio channels, the USB device needs to be unplugged and re-plugged in order for the device to appear in /dev/sndstat. So using /etc/sysctl.conf is not a completely automated solution, as the second statement always fails and has to be performed manually after reboot.

After some investigation, I found that using usbconfig(8) to power off and power on the USB device simulates the unplugging and re-plugging of the device. So I removed the sysctl(8) statements from /etc/sysctl.conf and wrote a Perl script to completely automate the process. I ran the script successfully today and will run it manually for a few days before making it part of the automated boot process. The script is attached.


----------

