# Trouble with sound



## NEW (Feb 17, 2012)

I recently installed freebsd FreeBSD 9.0 on an empty partition and followed the sound setup procedures in the documentation but unfortunately I have not been able to get any sound working.  I primarily use a Logitech USB headset for sound but I also tested all my analog ports and nothing seemed to work.  

My loader.conf contains 

```
sound_enable="YES"
snd_hda_load="YES"
snd_uaudio_load="YES"
```

My /dev/sndstat contains

```
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <HDA Realtek ALC888 PCM #0 Analog> (play/rec)
pcm1: <HDA Realtek ALC888 PCM #1 Analog> (play/rec)
pcm2: <HDA Realtek ALC888 PCM #2 Digital> (play/rec) default
pcm3: <USB audio> (play/rec)
```

I'm pretty inexperienced and all the other topics I've looked at haven't had a solution that worked for me.


----------



## bbzz (Feb 17, 2012)

PCM2 is default sound unit (as you can deduce from output).

Try
`# sysctl hw.snd.default_unit 3`

To try and set USB as default. Don't be afraid to test with 0 and 1 as well.


----------



## NEW (Feb 17, 2012)

I tried this before as it was a solution for someone else in a similar thread, I tried it again just now and unfortunately I still have no sound in my headset or from analog sources.


----------



## bbzz (Feb 17, 2012)

Tested how? Be specific. Boot verbose and post dmesg.


----------



## NEW (Feb 17, 2012)

I rebooted verbose but the dmesg output is gigantic, should I grep something specific or post a link to the entire dmesg?


----------



## DutchDaemon (Feb 17, 2012)

Post to pastebin.com and link here.


----------



## NEW (Feb 17, 2012)

Ok, here is the entire dmesg http://pastebin.com/1t9LQjMg.


----------



## NEW (Feb 17, 2012)

bbzz said:
			
		

> Tested how? Be specific. Boot verbose and post dmesg.



Well, I plugged a headset into my two available analog ports and then tried all four hw.snd_default options to see if any of the headsets would produce sound, none of them did. I also tried the same thing with my USB headset.


----------



## mav@ (Feb 18, 2012)

First some comments about your setup: pcm0 -- rear 7.1 outs and two mic inputs, pcm1 - headphones and line-in, pcm2 - digital in/out, pcm3 - USB headset.

If you can't make any sound from any of them, I would suppose there may be something wrong your higher level applications. Just try `# cat /dev/random >/dev/dspX`, where X is 0-3. If you hear loud noise in some cases, then sound driver is working.

Also you may want to check mixers. You have 4 of them. use `# mixer -f /dev/mixerX`, where X is also 0-3.


----------



## NEW (Feb 18, 2012)

Using the first command produced sound on my headsets, and the mixer level for each device was 75:75 in all fields except for mic which was always 0:0. I'm not sure what that means, I am using an xfce4 desktop right now and was wondering if that might be the problem?


----------



## NEW (Feb 18, 2012)

Whoo, so I added 
	
	



```
hw.snd.default_unit=3
```
 to /etc/sysctl.conf and rebooted and now my sound works.  Thanks for the help.


----------



## grep2grok (Sep 8, 2012)

Just adding that putting hw.snd.default_unit=<n = my device number> in sysctl.conf worked for me as well.


----------

