# Sound not working



## meaw229a (Oct 10, 2021)

I have problems to get sound working on a FreeBSD 13.0 release setup with KDE Plasma desktop.

Followed the instruction in the handbook and read lots of posts about sound here in the forum
but so far no luck.

Seems the system sees my sound card and the driver is installed.

```
Installed devices:
pcm0: <Conexant CX20952 (Analog 4ch/2.0)> (play/rec) default
pcm1: <Conexant CX20952 (Left Analog Mic)> (rec)
No devices installed from userspace.
```
dmesg | grep pcm shows this:

```
pcm0: <Conexant CX20952 (Analog 4ch/2.0)> at nid 29,23 and 26 on hdaa0
pcm1: <Conexant CX20952 (Left Analog Mic)> at nid 24 on hdaa0
pcm0: <Conexant CX20952 (Analog 4ch/2.0)> at nid 29,23 and 26 on hdaa0
pcm1: <Conexant CX20952 (Left Analog Mic)> at nid 24 on hdaa0
pcm0: <Conexant CX20952 (Analog 4ch/2.0)> at nid 29,23 and 26 on hdaa0
pcm1: <Conexant CX20952 (Left Analog Mic)> at nid 24 on hdaa0
[/cod]e
I tried the hw.snd.default_unit=X but no luck with that.
Also I think pcm0 must the right one. pcm1 is a microphone and there is nothing else.

Has someone an idea what else I can do?
```


----------



## sidetone (Oct 10, 2021)

Your sound driver looks like it's hda.

Try:
`kldload snd_hda`, then try it. Then, type `kldstat`, to see it and the sound driver it depends on loaded.


----------



## Alexander88207 (Oct 10, 2021)

> with KDE Plasma desktop



Please note that you when you change your default audio device, you have to kill pulseaudio with `pulseaudio -k`.


----------



## Alain De Vos (Oct 10, 2021)

You can try something like:

```
cat /dev/random > /dev/dsp0.3
cat /dev/random > /dev/dsp1.3
cat /dev/random > /dev/dsp2.3
```


----------



## grahamperrin@ (Oct 10, 2021)

Notebook or desktop? 


Part of <https://wiki.freebsd.org/Sound> might help you. 

I use KDE Plasma with OSS.


----------



## jammied (Oct 10, 2021)

I think I had to install OSS to get my sound working normally.


----------



## Alexander88207 (Oct 10, 2021)

jammied said:


> I think I had to install OSS to get my sound working normally.



OSS is the base sound system from freebsd and does not need to be installed afterwards.

Not to be confused with audio/ossv4.


----------



## meaw229a (Oct 12, 2021)

Thanks to everyone who try to help. 

>Your sound driver looks like it's hda.

>Try:
>kldload snd_hda, then try it. Then, type  kldstat, to see it and the sound driver it depends on loaded.

 When I try to load snd_stat I get the message: Module already loaded or in kernel.

The output of kldstat is:

```
Id Refs Address                Size Name
 1   87 0xffffffff80200000  1f11ef8 kernel
 2    1 0xffffffff82400000   31fd70 amdgpu.ko
 3    2 0xffffffff82320000    7f4c8 drm.ko
 4    3 0xffffffff823a0000     cbc8 linuxkpi_gplv2.ko
 5    1 0xffffffff823ad000     2328 lindebugfs.ko
 6    1 0xffffffff823b0000     e778 ttm.ko
 7    1 0xffffffff823bf000     9fc0 amdgpu_si58_mc_bin.ko
 8    1 0xffffffff823c9000     4358 amdgpu_verde_pfp_bin.ko
 9    1 0xffffffff823ce000     4358 amdgpu_verde_me_bin.ko
10    1 0xffffffff823d3000     4358 amdgpu_verde_ce_bin.ko
11    1 0xffffffff823d8000     41d8 amdgpu_verde_rlc_bin.ko
12    1 0xffffffff823dd000    11a18 amdgpu_verde_k_smc_bin.ko
13    1 0xffffffff823ef000     3378 acpi_wmi.ko
14    1 0xffffffff823f3000     3250 ichsmb.ko
15    1 0xffffffff823f7000     2180 smbus.ko
16    1 0xffffffff82720000    17310 if_iwm.ko
17    1 0xffffffff823fa000     2110 pchtherm.ko
18    1 0xffffffff82800000   207d78 iwm8000Cfw.ko
19    1 0xffffffff823fd000     2340 uhid.ko
20    1 0xffffffff82738000     4350 ums.ko
21    1 0xffffffff8273d000     3380 usbhid.ko
22    1 0xffffffff82741000     31f8 hidbus.ko
23    1 0xffffffff82745000     3320 wmt.ko
24    1 0xffffffff82749000     2a08 mac_ntpd.k
```
>You can try something like:

>       Code:    

>cat /dev/random > /dev/dsp0.3
>cat /dev/random > /dev/dsp1.3
>cat /dev/random > /dev/dsp2.3

This works only with ?dev/dsp0.3. There is no noise to hear.


> Notebook or desktop? 

Something in between I would say. It's a HP EliteOne G2 AIO (AIO = All in one). Looks like a Imac but is
a HP computer. No special hardware I would say. Intel I5-6500 - AMD Radeon M9 Graphics.


> Part of <https://wiki.freebsd.org/Sound> might help you. 

> I use KDE Plasma with OSS.

I installed the OSS package and enabled it in rc.conf but does not help.

Any other ideas?


----------



## grahamperrin@ (Oct 12, 2021)

meaw229a said:


> ဖ… I installed the OSS package …



Please recall: 



Alexander88207 said:


> OSS … does not need to be installed …



I use the OSS that's integral to FreeBSD. Not an installation of the OSS package.


----------



## schlitz (Oct 13, 2021)

meaw229a said:


> I have problems to get sound working on a FreeBSD 13.0 release setup with KDE Plasma desktop.
> 
> Followed the instruction in the handbook and read lots of posts about sound here in the forum
> but so far no luck.
> ...


I had a similar problem with sound. Eventually, I solved it by adding the correct device hint for my motherboard needed to map the port to the jack.
Here's one reliant discussion, there are many: https://forums.freebsd.org/threads/speaker-plugged-into-jack-not-working.81462/


----------



## tuxador (Oct 25, 2021)

stupd question: how to make this persistant ?
`sudo sysctl hw.snd.default_unit=5`
i've put this in the /boote/loader.conf :
hw.snd.default_unit=5

But it appears that another file is overwriting it to zero after each reboot.
Another issue is that sound works only with media players: VLC MPV Strawberry
Both dophin emulator and web browsers (Firefox and linux/google-chrome) dont output sound at all.


----------



## SirDice (Oct 25, 2021)

tuxador said:


> stupd question: how to make this persistant ?
> `sudo sysctl hw.snd.default_unit=5`
> i've put this in the /boote/loader.conf :
> hw.snd.default_unit=5


You put it in sysctl.conf(5): `echo hw.snd.default_unit=5 >> /etc/sysctl.conf`


----------



## tuxador (Oct 25, 2021)

SirDice said:


> You put it in sysctl.conf(5): `echo hw.snd.default_unit=5 >> /etc/sysctl.conf`


this was the culprit. Thank you for your preious advice.


----------

