Solved Audio sounds very fast and screechy

I installed FreeBSD-11.1 on my laptop and updated to 11.1-RELEASE-P5 as per the handbook http://freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html. All went well, and my system seems to be happy.

Following through to "23.5.4.4. Building a Custom Kernel", I built and installed my custom kernel according to those instructions. Everything seems to be working fine, except for audio.

Audio seems very fast and screechy, everyone sounds like a little girl talking very fast. This seems to be an issue with my custom kernel.

I copied my config from GENERIC, which seems to have no problems. The relevant sound config in GENERIC is:
Code:
# Sound support
device          sound                   # Generic sound driver (required)
device          snd_cmi                 # CMedia CMI8338/CMI8738
device          snd_csa                 # Crystal Semiconductor CS461x/428x
device          snd_emu10kx             # Creative SoundBlaster Live! and Audigy
device          snd_es137x              # Ensoniq AudioPCI ES137x
device          snd_hda                 # Intel High Definition Audio
device          snd_ich                 # Intel, NVidia and other ICH AC'97 Audio
device          snd_via8233             # VIA VT8233x Audio
My custom kernel has:
Code:
device          sound                   # Generic sound driver (required)
device          snd_ich                 # Intel, NVidia and other ICH AC'97 Audio
Further troubleshooting makes me suspect some issue with my kernel and the sound module. I tried the following combinations:

1) Keeping only snd_hda + snd_ich in my custom config
audio issues as above

2) Keeping all devices in my custom config
audio issues as above

3) Keeping no devices in my custom config
no audio. but if I kldload snd_ich, audio is back and sounds normal just like with GENERIC kernel.

4) Keeping only device snd_ich in my custom config
audio issues as above

I kept this line in all four options above.
Code:
device         sound                   # Generic sound driver (required)
 
Last edited by a moderator:
You should boot the generic kernel and check dmesg for which driver is the right one. You need to know at least that. :)

P.S. the fact that you keep so many audio drivers in your custom kernel makes me think you are not enough familiar with the kernel building/stripping it down.
It's important to understand the buses and what they do. Read all the comments in the GENERIC kernel config to get an understanding. And... If you don't really have to add to, or stripp down your kernel. Don't do it ;)
 
generic kernel dmesg says:
Code:
pcm0: <Intel ICH6 (82801FB)> port 0x6100-0x61ff,0x6200-0x623f mem 0xd8481000-0xd84811ff,0xd8482000-0xd84820ff irq 17 at device 30.2 on pci0
pcm0: <Analog Devices AD1981B AC97 Codec>
in my custom kernel, i only have:
Code:
device sound
device snd_ich
but when sound was not clear, I tried the above combinations to try troubleshoot. option 3) confirms that my driver should be snd_ich(4). Initially, I had suspected it might be snd_hda(4), but that didn't work.
 
Last edited by a moderator:
According to your dmesg it looks like the right driver is attached with the GENERIC kernel and you wrote it sounds normal in your first post.
Now you write sound isn't clear...
Try to set mixer 80 just to make sure it's not clipping.
Is it simple stereo output you want from the green 3,5mm jack?

Can you explain what are you are trying to do?

Leave fiddling with the kernel alone and use the GENERIC kernel for now.
 
ok. i clarify again. all is ok (including audio) with my laptop, freebsd and generic kernel. nowt wrong with mixer either.

i'm having trouble with my custom kernel, which is what i describe above. it seems if i remove snd_ich from my custom kernel and kldload manually, audio is ok, which seems rather strange.. and i wonder if someone has seen something similar.
 
Last edited:
Ok, it's clear now.
That indeed doesn't make sense to me either.

- What FreeBSD version are you running, and are you sure you fetched the right sourcetree according to your FreeBSD version?

- Have you stripped off any other things from the kernel config than audio drivers?

If you really didn't strip off anything else than the audio drivers, try to build the GENERIC kernel from the sources you fetched, just to check audio would work.

Still, it makes no sense to run a stripped down kernel as long you're now very low on resources.
Since your laptop is rather old, you might be low in RAM. I'd rather try adding RAM, not stripping down the kernel.
 
I installed FreeBSD-11.1 on my laptop and updated to 11.1-RELEASE-P5 as per the handbook http://freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html. All went well, and my system seems to be happy.

Following through to "23.5.4.4. Building a Custom Kernel", I built and installed my custom kernel according to those instructions. Everything seems to be working fine, except for audio.

Audio seems very fast and screechy, everyone sounds like a little girl talking very fast. This seems to be an issue with my custom kernel.

I copied my config from GENERIC, which seems to have no problems. The relevant sound config in GENERIC is:
# Sound support
device sound # Generic sound driver (required)
device snd_cmi # CMedia CMI8338/CMI8738
device snd_csa # Crystal Semiconductor CS461x/428x
device snd_emu10kx # Creative SoundBlaster Live! and Audigy
device snd_es137x # Ensoniq AudioPCI ES137x
device snd_hda # Intel High Definition Audio
device snd_ich # Intel, NVidia and other ICH AC'97 Audio
device snd_via8233 # VIA VT8233x Audio

My custom kernel has:
device sound # Generic sound driver (required)
device snd_ich # Intel, NVidia and other ICH AC'97 Audio

Further troubleshooting makes me suspect some issue with my kernel and the sound module. I tried the following combinations:

1) Keeping only snd_hda + snd_ich in my custom config
audio issues as above

2) Keeping all devices in my custom config
audio issues as above

3) Keeping no devices in my custom config
no audio. but if i "kldload snd_ich", audio is back and sounds normal just like with GENERIC kernel.

4) Keeping only "device snd_ich" in my custom config
audio issues as above

I kept this line in all four options above.
device sound # Generic sound driver (required)



maybe you have to change the output rate of your pcm device

Code:
dev.pcm.5.play.vchanrate

the default is 48000, change it to 44100 and try again
better in /etc/sysctl.conf and reboot, I think the reboot is not necessary
 
Ok, it's clear now.
That indeed doesn't make sense to me either.
thank you. sorry for any confusion.

- What FreeBSD version are you running, and are you sure you fetched the right sourcetree according to your FreeBSD version?
Code:
$ uname -v
FreeBSD 11.1-RELEASE-p6 #2 r326734: Sun Dec 10 01:45:59 GMT 2017     [email]josephg@nc4200.compaq.gb[/email]:/usr/obj/usr/src/sys/GENERIC
$ svnlite info /usr/src
Path: /usr/src
Working Copy Root Path: /usr/src
URL: [URL]https://svn.freebsd.org/base/releng/11.1[/URL]
Relative URL: ^/releng/11.1
Repository Root: [URL]https://svn.freebsd.org/base[/URL]
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 326734
Node Kind: directory
Schedule: normal
Last Changed Author: gordon
Last Changed Rev: 326722
Last Changed Date: 2017-12-09 03:44:26 +0000 (Sat, 09 Dec 2017)

- Have you stripped off any other things from the kernel config than audio drivers?
yes i have stripped off quite a few lines from generic config. and everything else seems to be working.
but you are giving me ideas now.. perhaps i only strip off audio lines from generic and try again.. only it takes a very long time to compile :(

If you really didn't strip off anything else than the audio drivers, try to build the GENERIC kernel from the sources you fetched, just to check audio would work.
i am running generic kernel, as you can see above. everything works.

Still, it makes no sense to run a stripped down kernel as long you're now very low on resources.
Since your laptop is rather old, you might be low in RAM. I'd rather try adding RAM, not stripping down the kernel.
well i'm low on resources, and it makes no sense to load everything if they are not being used. upgrading hardware is not a solution atmo. yes my laptop is rather old, but fully functioning. i have installed & fine tuned zfs root, and everything seems to be smoothly working. any ram/cpu the kernel could free up would be very useful.
 
Last edited:
maybe you have to change the output rate of your pcm device

Code:
dev.pcm.5.play.vchanrate

the default is 48000, change it to 44100 and try again
better in /etc/sysctl.conf and reboot, I think the reboot is not necessary
thank you. i will try that.. but i have a question: why does 48000 sound ok on the generic kernel?

mine is
Code:
dev.pcm.0.ac97rate: 48000
dev.pcm.0.rec.vchanrate: 48000
dev.pcm.0.play.vchanrate: 48000
 
if i boot GENERIC kernel where audio sounds ok, i see this
Code:
dev.pcm.0.ac97rate: 48000
dev.pcm.0.rec.vchanrate: 48000
dev.pcm.0.play.vchanrate: 48000

if i boot my custom kernel where audio sounds not ok, i see this instead :(
Code:
dev.pcm.0.ac97rate: 32719
dev.pcm.0.rec.vchanrate: 3327
dev.pcm.0.play.vchanrate: 3327

i wonder this happens? and these values seem to change every boot. :eek:

so now i do this
Code:
# sysctl dev.pcm.0.play.vchanrate=44100
dev.pcm.0.play.vchanrate: 3327 -> 44098

and i see this
Code:
dev.pcm.0.ac97rate: 32719
dev.pcm.0.rec.vchanrate: 3327
dev.pcm.0.play.vchanrate: 44098

now audio sounds ok :) success!
That indeed doesn't make sense to me either.
 
Back
Top