# I'm back at FreeBSD still no sound



## joachin (Sep 5, 2017)

Hello guys, you helped me the last time with FreeBSD 11 that I have no sound, now I installed again and still have no sound, can someone help me please. I have xfce, and I can't play videos or music with vlc, mpv, parole.


----------



## Deleted member 9563 (Sep 5, 2017)

What was the problem last time?


----------



## Deleted member 30996 (Sep 5, 2017)

I looked over your other thread. It never did show that you had these lines in your /etc/rc.conf file:


```
snddetect_enable="YES"
mixer_enable="YES"
```
That's the only thing I ever do as far as sound is concerned on any of my laptops and have never had a problem getting sound out of any of them with multimedia/vlc, multimedia/xmms or youtube through on-board speakers or headphones.


----------



## joachin (Sep 5, 2017)

going to do that right now, thanks, do I still need the old configs? It's a fresh instalation, now I don't have edit or do anything else.


----------



## Deleted member 30996 (Sep 5, 2017)

joachin said:


> going to do that right now, thanks, do I still need the old configs? It's a fresh instalation, now I don't have edit or do anything else.



FreeBSD is not Linux and needs a lot of configuration. Right now I don't know what you've done besides install the base system.

Look over my tutorial, see if you missed doing anything and use the configurations I provide for different files. Then get back to us about whether or not you have sound and we can go from there.

https://forums.freebsd.org/threads/61659/

Edit: For instance, the /etc/devfs.rules configuration file I provide assumes you made yourself a member of the operator group during the installation process.


----------



## SirDice (Sep 5, 2017)

I would suggest starting here: Handbook: 7.2. Setting Up the Sound Card

Let us know if anything isn't clear or not working as explained in the handbook.


----------



## tobik@ (Sep 5, 2017)

Trihexagonal said:


> It never did show that you had these lines in your /etc/rc.conf file:
> 
> 
> ```
> ...


Are you sure about snddetect_enable="YES"? AFAICT it's an old PC-BSD thing that never did anything on FreeBSD. mixer_enable="YES" is the default, so there is no need to add it to /etc/rc.conf yourself.


----------



## joachin (Sep 5, 2017)

I did it, and still have no sound on my laptop, I don't know what else can I do


----------



## SirDice (Sep 5, 2017)

joachin please post any errors and/or some details. "It doesn't work" doesn't tell us much and provides no clues what could possibly be going wrong. We can continue shooting in the dark until we accidentally get it right but it'll be a lot quicker if you provide us some details about the hardware you have and what you already tried.


----------



## joachin (Sep 5, 2017)

Ok, I have an Intel Celeron N3060, 500gb of HDD, 4gb of ram, I said "It doesn't works" because I have no sound, I can't play videos on vlc and in, I can't play my music, with youtube I have the following: If playback doesn't begin shortly, try restarting your device. It's a fresh install, so I'm going to do what you tell me to do.

Thanks


----------



## Deleted member 30996 (Sep 5, 2017)

tobik@ said:


> Are you sure about snddetect_enable="YES"? AFAICT it's an old PC-BSD thing that never did anything on FreeBSD. mixer_enable="YES" is the default, so there is no need to add it to /etc/rc.conf yourself.



Actually, that's where I got them from. I got my start beta testing PC-BSD in 2005, when they were at FreeBSD 5.3 IIRC, and moved to vanilla FreeBSD in 2007. I still have all my old disks beginning at PC-BSD version 0.7.3 and will take a look at them someday when I'm going to rebuild my system anyway.

I am basically self-taught and carried a lot of things over from that period and probably do a lot of things in my own way that is not the general norm. It's worked for me over the years so I never changed it. I taught myself to use ports back then instead of the .pbi Push Button Installer system they had and why I prefer to use them over pkg.


----------



## SirDice (Sep 5, 2017)

joachin said:


> I have an Intel Celeron N3060, 500gb of HDD, 4gb of ram


And what kind of mainboard? Because that's usually where the soundcard is, it's not built into the CPU, HD or RAM. 


joachin said:


> I said "It doesn't works" because I have no sound


Yes, we already know that. But there are literally hundreds of different cards with a multitude of potential problems. We could list a million solutions and none of them may apply to _your_ situation.


joachin said:


> I can't play my music, with youtube I have the following: If playback doesn't begin shortly, try restarting your device.


Cause -> effect. If you build a house without foundation the house is going to collapse. It doesn't matter what type of house you build on top of it. Same for this, apparently your soundcard isn't detected (the foundation) so any type of application (house) on top of it will fail.

So, post the type of mainboard or soundcard (if known). Or model/type of laptop/PC (we can lookup what's inside). Alternatively post the output of `pciconf -lv` to Pastebin (or a similar service). And the post the output of `kldload snd_driver` and `cat /dev/sndstat`.


----------



## Deleted member 30996 (Sep 5, 2017)

Referencing this and his other thread about the same problem of not having any sound makes me wonder if he has configured all the files he should to get a fully functional desktop.



joachin said:


> I can't play videos on vlc and in, I can't play my music, with youtube I have the following: If playback doesn't begin shortly, try restarting your device. It's a fresh install, so I'm going to do what you tell me to do.



And why I mentioned the /etc/devfs.rules file.


----------



## SirDice (Sep 5, 2017)

Trihexagonal said:


> And why I mentioned the /etc/devfs.rules file.


The default rules should be fine. I've never needed to modify this in order to get the soundcard working.


----------



## Deleted member 30996 (Sep 5, 2017)

SirDice said:


> The default rules should be fine.



Is there even such a thing as a set of default rules? Because unless I'm mistaken they have to be created and referenced in /etc/rc.conf.


----------



## SirDice (Sep 5, 2017)

Trihexagonal said:


> Is there even such a thing as a set of default rules?


There is, /etc/default/devfs.rules. But they're typically fine and allow pretty much everything (within reason).


----------



## Deleted member 30996 (Sep 5, 2017)

Well I learned something new today.


----------



## joachin (Sep 23, 2017)

Hey sorry for the late post, there you go: https://pastebin.com/kVCL1vjk


----------



## Minbari (Sep 23, 2017)

Load the sound driver:

```
kldload snd_hda
```

to make it permanent add in /boot/loader.conf

```
snd_hda_load="YES"
```

Then check to see if the sound card was detected:

```
cat /dev/sndstat
```


----------



## joachin (Sep 23, 2017)

The kldload snd_hda says: can't load snd_hda: module already loaded or in kernel

cat /dev/sndstat says:

cat /dev/sndstat says
Installed devices:
pcm0: <Realtek ALC255 (Internal Analog)> (play/rec) default
pcm1: <Realtek ALC255 (Front Analog Headphones)> (play)
pcm2: <Intel (0x2883) (HDMI/DP 8ch)> (play)


----------



## macondo (Sep 23, 2017)

*Shot in the dark*
Launch alsamixer as USER and unmute your channels with the letter 'm'


----------



## joachin (Sep 23, 2017)

I did it, still no sound


----------



## joachin (Sep 24, 2017)

Hey I installed TrueOs and I have sound there, so I think I can have it in FreeBSD too, I did not configuration on TrueOS, can someone can tellme how can I configure it please? (I want to have FreeBSD and not TrueOS)


----------



## Minbari (Sep 24, 2017)

You need to see which driver TrueOs is using for sound (kldstat) so you can load it on FreeBSD too. If your hardware is newer keep in mind that TrueOS is based on FreeBSD-current (FreeBSD 12) and it is possible that that driver could not exists in FreeBSD 11.x series.


----------



## joachin (Sep 24, 2017)

I installed FreeBSD current, and TrueOS has the same driver, hda, same as the FreeBSD.


----------



## SirDice (Sep 25, 2017)

Regarding TrueOS: PC-BSD, FreeNAS, NAS4Free, and all other FreeBSD Derivatives
Regarding -CURRENT: Topics about unsupported FreeBSD versions



joachin said:


> ```
> cat /dev/sndstat
> Installed devices:
> pcm0: <Realtek ALC255 (Internal Analog)> (play/rec) default
> ...


You have audio, the default is using the analog outputs. Where are your speakers attached to? If your speakers are built into the monitor you probably need to set hw.snd.default_unit. See 7.2.3. Troubleshooting Sound


----------



## joachin (Sep 29, 2017)

Thanks for your answer, they are attached to monitor, and I still have no sound.


----------



## Greg Fitzgerald (Nov 22, 2017)

Did you copy over a home dir from say a linux box? You may have some config files pointing to pulseaudio instead of oss. I had this happen once. Look for ~/.asoundrc and remove it if you see it. Maybe grep for files in home for the world "pulse". Just an idea.


----------



## ronaldlees (Nov 22, 2017)

Try:

`dd if=/dev/random of=audiotest.rnd bs=1k count=200

cat ./audiotest.rnd > /dev/dsp0`

Listen to determine whether or not you can hear noise.  Note: stay away from the speaker, as it's likely to be loud if it works.


----------



## Sensucht94 (Nov 23, 2017)

Hi,
If I'm not wrong snd_hda.ko is enabled  by default and subsequently loaded in kernel together with some other sound drivers, as stated in sound(4).

Hence, trying to reload snd_hda(4) and verifying that it's already loaded in kernel, basically doesn't add any new hint to sort your issue out

Also, all modules which are by default resident in kernel, are not listed in kldstat(8) output.

In order to check out the proper driver to load, you may try first to identify your sound card, in order to determine whether  or not the snd_hda.ko driver is the right one for you, by running:

`cat /dev/sndstat`

Your device should be associated to a pcmX device, where X is the number for your preferred sound card (usually 0/1). Now edit your /etc/sysctl.conf to assign the default output accordingly:

```
hw.snd.default_unit=X
```
, where X is the number of the device.
To prevent FreeBSD from resetting this value (system otherwise automatically assigns the default output to the best detected device), add also:

```
hw.snd.default_auto=0
```
. If you're sound card works, you can also set this value to *2, *for system to associate sound output to the last attached device.

If your /dev/sndstat doesn't provide the info you whished for, and/or you're unsure about what driver to load, check first on man pages of drivers listed in sound(4), than if you really haven't found a proper answer, add:

```
snd_driver_load="YES"
```
 to /boot/loader.conf, or simply `kldload snd_driver` for the current session.

[NOTE:  snd_driver will load* all out of the sound drivers *available under FreeBSD, so shouldn't be set as default].

This should do the trick as we know that at least one driver supports your card (or at least one driver in CURRENT,  as Minbari pointed out, since it worked on TrueOS).

Be also sure to *not * have enabled sndiod daemon in /etc/rc.conf, which could interfere with packages built by default with pulseaudio support.

Finally test your sound card with command:
`cat [I]anyfile[/I] > /dev/dsp`

or better test a mp3 file downloaded online with a program like audio/mpg123 or audio/cpp-xmms2.

Don't test sound with browsers, as they may have independent sound issues, unrelated to your sound card driver, which may be working  well even if browser produces no audio


----------



## tobik@ (Nov 23, 2017)

Sensucht94 said:


> Be also sure to *not * have enabled sndiod daemon in /etc/rc.conf, which could interfere with packages built by default with pulseaudio support.


This is complete nonsense. PulseAudio and sndiod are completly different things. They do not interfere with each other. Like at all.


----------



## Sensucht94 (Nov 23, 2017)

tobik@ said:


> This is complete nonsense. PulseAudio and sndiod are completly different things. They do not interfere with each other. Like at all.


Sorry, I had misread a couple of recent threads and based my statement on them. I saw your comment in one of them where you argue about wide confusion among users and explain how the sound system works. Guess I was one of those users. Now I understand though, so thank you


----------

