# No Sound on FreeBSD



## Johninlex (Mar 22, 2011)

I have tried for several days to get sound working. I have followed the handbook to a tea to get this working.

I have edited the /boot/loader.conf, added 
	
	



```
snd_emu10k1_load="YES"
```


```
#!/bin/sh
#
# Detect sound driver

for driver in /boot/kernel/snd_*; do
  driver=$(echo ${driver} | sed 's|/boot/kernel/snd_||')
  if [ ${driver} = "driver.ko" ]; then
    continue;
  fi

  kldload snd_${driver}
  if [ -c /dev/mixer0 ]; then
    echo "I'm smelling 'snd_${driver}'"
    echo "snd_${driver}_load=\"YES\"" >> /boot/loader.conf
    exit 0
  fi
  kldunload snd_${driver}
done
```

I have used this script to see if I could get it working. still no luck

I have done `cat /dev/sndstat`


```
FreeBSD Audio Driver (newpcm: 32bit 2009061500/i386)
Installed devices:
pcm0: <HDA Realtek ALC880 PCM #0 Digital> (play) default
pcm1: <HDA Realtek ALC880 PCM #1 Analog> (play/rec)
pcm2: <HDA Realtek ALC880 PCM #2 Analog> (play/rec)
pcm3: <HDA Realtek ALC880 PCM #3 Analog> (rec)
```

I have made sure that the sound card was supported in http://www.freebsd.org/releases/8.2R/hardware.html

I am lost if I can get any help please.

Thank you
Johninlex


----------



## SirDice (Mar 22, 2011)

You have snd_hda(4), not snd_emu10k1(4).


----------



## adamk (Mar 22, 2011)

Unless you want to use the digital output, make sure you set hw.snd.default_unit to 1.

Adam


----------



## Johninlex (Mar 22, 2011)

I have done a little more work I have and I still have the problem I know this is a lot. Please this is in no order of how I did thing, but I think it will help you help me. Thank you both adamk and sirdice.

http://pastebin.com/X7upP4xX


----------



## Johninlex (Mar 22, 2011)

Here is my *fstat* as well 

http://pastebin.com/aKBKPxzp


```
GhostBSD# sysctl hw.snd.default_unit=4                                          hw.snd.default_unit: 0
sysctl: hw.snd.default_unit: Invalid argument
GhostBSD# sysctl hw.snd.default_unit=3
hw.snd.default_unit: 0 -> 3
GhostBSD# sh /etc/rc.d/mixer stop
GhostBSD# sh /etc/rc.d/mixer start
GhostBSD# sysctl hw.snd.default_unit=2
hw.snd.default_unit: 3 -> 2
GhostBSD# sh /etc/rc.d/mixer stop
GhostBSD# sh /etc/rc.d/mixer start
GhostBSD# sysctl hw.snd.default_unit=1
hw.snd.default_unit: 2 -> 1
GhostBSD# sh /etc/rc.d/mixer stop
GhostBSD# sh /etc/rc.d/mixer start
GhostBSD# sysctl hw.snd.default_unit=0
hw.snd.default_unit: 1 -> 0
GhostBSD# sh /etc/rc.d/mixer stop
GhostBSD# sh /etc/rc.d/mixer start
```


----------



## flyweight (Mar 23, 2011)

It looks like your card is up and running. Sometimes the sound is muted by default. Run the command [cmd=]mixer pcm 90[/cmd] and [cmd=]mizer vol 90[/cmd] and turn on the volume. For an audio source you can use [cmd=]cat /dev/random > /dev/dsp[/cmd] to test.


----------



## Johninlex (Mar 23, 2011)

flyweight, 

I did try before but here is the output of everything:


```
[johninlex@GhostBSD /usr/home/johninlex]$ mixer pcm 90
Setting the mixer pcm from 100:100 to 90:90.
[johninlex@GhostBSD /usr/home/johninlex]$ mizer vol 90
bash: mizer: command not found
[johninlex@GhostBSD /usr/home/johninlex]$ mixer vol 90
Setting the mixer vol from 100:100 to 90:90.
[johninlex@GhostBSD /usr/home/johninlex]$ cat /dev/random > /dev/dsp
^C
[johninlex@GhostBSD /usr/home/johninlex]$ cat /home/johninlex/Music/Hardstyle\ Top\ 40\ Februari\ 2011\ DutchReleaseTeam/01.\ Tatanka\ and\ 
Zatox\ Pres.\ Wild\ ...\ -\ Hard\ Bass\ \(Official\ Hard\ Bass\ Anthem\ 2011\).mp3 > /dev/dsp
[johninlex@GhostBSD /usr/home/johninlex]$
```

The ... is censor for a bad word

DutchDaemon I hope I did it right this time for you?


----------



## flyweight (Mar 23, 2011)

If you run the *mixer* command, do you see anything with a value of "0"? If so turn that up also.  Are you sure the cables are connected and if you have a laptop that the volume pot is up?? I don't know what is wrong. Maybe you can try to load the sound modules one by one and see if you card needs another kernel module.

But first things first.


----------



## Johninlex (Mar 25, 2011)

flyweight,


```
GhostBSD# mixer
Mixer vol      is currently set to 100:100
Mixer pcm      is currently set to  75:75
GhostBSD#
```

I am still at a loss as to why I do not have sound. And I have no idea how to rebuild a kernel. Does anyone else have a idea for what I could try please? I am willing to learn something new, but I do need a little direction.

Thank you,
JohninLex


----------



## carlton_draught (Mar 25, 2011)

This thread is useful to go through. I have temporarily given up on sound in gnome, but I can play mp3s and flacs if I want to (not through gnome, through command line). Make sure that you *cat* stuff to all of your dsps, and for each dsp numbers test each output port of your soundcard/mobo, just in case.


----------



## zspider (Mar 25, 2011)

This sounds dumb but when I first came to FreeBSD, I loaded the appropriate module for the sound hardware, and spent hours trying to figure out how to get any sound, on my laptop there are 3 buttons along the top: mute, volume down, and volume up. Pushing volume up took it out of an apparent mute mode and the sound worked.:stud


----------



## Johninlex (Mar 25, 2011)

Zspider, you have to be kidding me do you think after three days, that it would just be a mute problem, you really have to be joking. Just to let you know it is a desktop not a stupid laptop.



			
				zspider said:
			
		

> This sounds dumb but when I first came to FreeBSD, I loaded the appropriate module for the sound hardware, and spent hours trying to figure out how to get any sound, on my laptop there are 3 buttons along the top: mute, volume down, and volume up. Pushing volume up took it out of an apparent mute mode and the sound worked.:stud





Thanks,
JohninLex


----------



## adamk (Mar 25, 2011)

Johninlex said:
			
		

> Zspider, you have to be kidding me do you think after three days, that it would just be a mute problem, you really have to be joking. Just to let you know it is a desktop not a stupid laptop.



Being rude to someone trying to help you is not going to make people want to help you.

Anyway, if the only mixer controls showing up are vol and pcm, you are still using the 
	
	



```
pcm0: <HDA Realtek ALC880 PCM #0 Digital> (play) default
```
 as the sound device.  Are you really trying to play audio from the digital output on your computer?

Adam


----------



## Johninlex (Mar 25, 2011)

adamk,

I have tried every way except for rebuilding the Kernel to get sound to work. I think I am just going to have to wait for sound. Because I will be honest I do not know how to rebuild the kernel. I have everything set up just how I like it on GhostBSD except for sound. I can live with out sound if I have to, as long as I am not forced to go back to windows I will be fine for ever 
I do not want to mark the thread solved because I love to have this fixed. I will continue to work on this and when I find the answer I will mark it solved and I will give how I fixed it.


----------



## flyweight (Mar 25, 2011)

first turn up all mixer channels and then:

`# cat /dev/random > /dev/pcm0`

`# cat /dev/random > /dev/pcm1`

`# cat /dev/random > /dev/pcm2`

or

`# cat /dev/random > /dev/dsp0`

Let each command run and then put the minijack from your speakers or amp in each possible hole from your dac.

Repeat them on all pcm or dsp devices listed in /dev/.

When you hear noise than you fixed it.  if not kick your computer 

You could also check the irq settings in the bios from your soundcard. (if it's one onboard)


----------



## flyweight (Mar 25, 2011)

I found this in the manual snd_hda


```
``GPIOs'' are a codec's General Purpose I/O
pins which system integrators sometimes use to
control external muters, amplifiers and so on.
If you have no sound, or sound volume is not
adequate, you may have to experiment a bit
with the GPIO setup to find the optimal setup
for your system.
```


----------



## jb_fvwm2 (Mar 26, 2011)

Johninlex said:
			
		

> adamk,
> 
> I have tried every way except for rebuilding the Kernel to get sound to work. I think I am just going to have to wait for sound. Because I will be honest I do not know how to rebuild the kernel. I have everything set up just how I like it on GhostBSD except for sound. I can live with out sound if I have to, as long as I am not forced to go back to windows I will be fine for ever
> I do not want to mark the thread solved because I love to have this fixed. I will continue to work on this and when I find the answer I will mark it solved and I will give how I fixed it.



While not solving this thread (snd_hda.ko), you might have sound anyway with my recently posted audio/oss HowTo in the HowTo subforum...


----------



## zspider (Mar 26, 2011)

adamk said:
			
		

> Being rude to someone trying to help you is not going to make people want to help you.
> 
> Anyway, if the only mixer controls showing up are vol and pcm, you are still using the
> 
> ...



Thank you Adam. 

Johninlex you were practically begging for solutions so I gave you one that _*might*_ have solved your problem. I could have said nothing, which is what I was going to do initially. The mute mode is so not obvious if you are not using one of the mainstream desktop enviroments and is not indicated with the *mixer* command either.


----------



## Johninlex (Mar 28, 2011)

Ok, problem solved, here is how I fixed it:

1. shutdown pc
2. unplug everything
3. open side cover 
4. insert another sound card
5. put cover back on 
6. plug everything back up
7. start computer

Yes, I have sound. problem solved.

Thank you everyone for the help.

Thanks, 
JohninLex


----------



## flipper_88 (Mar 24, 2018)

I have the sam issue witth a fresh install of FreeBSD 11.1 x86_64  accept in my case I've done it with a gpt /efi based Dell Precision Tower  3420 SFF, and would rathe not have to reset the bios to MBR as I have a 2TB  Enterprise grade hdd.


----------



## k.jacker (Mar 24, 2018)

You should rather start a new thread instead of posting to a 7 year old thread.
If you haven't already, read the Handbook first. Don't worry, the disk layout has nothing to do with sound


----------

