View Full Version : pass parameter to kernel module
estellnb
February 15th, 2009, 21:27
I need to pass the following parameter to the snd_hda module in order to allow correct headphone support: model=fujitsu-pi2515
(Linux: /etc/modprobe.d/sound:
options snd-hda-intel model=fujitsu-pi2515) works
(FreeBSD: /boot/loader.conf
snd_hda_flags="model=fujitsu-pi2515") does not work
anything wrong in here?
SirDice
February 16th, 2009, 10:50
model= is a linux kernel module option, this obviously doesn't work with a freebsd kernel module as they are quite different.
You will need to set device.hints. Not sure which one as I don't have a hda soundcard.
http://www.freebsd.org/cgi/man.cgi?query=snd_hda&apropos=0&sektion=0&manpath=FreeBSD+8-current&format=html (the man page for 7.1 isn't updated, it should on your system)
http://www.freebsd.org/cgi/man.cgi?query=device.hints&apropos=0&sektion=0&manpath=FreeBSD+7.1-RELEASE&format=html
estellnb
February 16th, 2009, 13:10
How can I force a module reloading that takes device.hints into account without having to reboot?
estellnb
February 16th, 2009, 13:26
How can I get the 'verbose driver output'?
SirDice
February 16th, 2009, 13:26
kldload, kldunload and kldstat are the tools similar to linux' insmod, lsmod etc.
plamaiziere
February 16th, 2009, 14:13
How can I force a module reloading that takes device.hints into account without having to reboot?
You can't (i think), device.hints is read by the loader at boot time. For the verbose mode, put boot_verbose="YES" in /boot/loader.conf
What is the problem with snd_hda? You can start with the current version of snd_hda (just copy the /sys/dev/sound/pci/hda directory from FreeBSD-Current and rebuild the module).
SirDice
February 16th, 2009, 14:22
You may need to update your src tree..
From /usr/src/UPDATING:
20090107:
snd_hda(4) driver was updated to version 20081226_0122.
Due to added HDMI audio and logical audio devices support, updated
driver often provides several PCM devices. In some cases it can make
system default audio device no longer correspond to the users's
habbitual audio connectors. In such cases wanted device can be
specified in audio application setup or defined globally via
hw.snd.default_unit sysctl according to sound(4) and snd_hda(4)
man pages.
estellnb
February 16th, 2009, 20:22
The thing here is simply that the main speaker should be turned off if the headphones are plugged in. Under Linux there are two different volume control panels for the headphones and the main speaker. To achieve both (mainspeaker turned off, headphone volume control used) it is necessary to reconfigure the pins by specifying the given model id.
estellnb
February 16th, 2009, 20:24
kldload takes device.hints into account?
blah
February 16th, 2009, 20:45
How can I force a module reloading that takes device.hints into account without having to reboot?set kernel environment beforehand using kenv(1)
plamaiziere
February 17th, 2009, 13:55
The thing here is simply that the main speaker should be turned off if the headphones are plugged in. Under Linux there are two different volume control panels for the headphones and the main speaker. To achieve both (mainspeaker turned off, headphone volume control used) it is necessary to reconfigure the pins by specifying the given model id.
Ok. You may need to associate the headphone pin to the speaker. So the driver will mute the speaker.
The man page of snd_hda explains this:
The sequence number 15 has a special meaning for output associations. Output pins with this number and device type ``Headphones'' will duplicate (with automatic mute if jack detection is supported) the first pin in that association.
By instance I've got on my laptop:
hdac0: nid 20 0x90100140 as 4 seq 0 Speaker Fixed jack 0 loc 16 color Unknown misc 1
hdac0: nid 21 0x012b4050 as 5 seq 0 Headphones Jack jack 11 loc 1 color Green misc 0
To make the auto mute works, The headphone pin must be associate with the as '4' (the as of the speaker pin) with the sequence '15'). So I must add a quirk like:
hint.hdac.0.cad0.nid21.config="as=4 seq=15"
But be sure to have the latest version of the snd_hda driver.
Put somewhere the output of snd_hda and pcm in verbose mode if you need more help.
estellnb
March 16th, 2009, 18:37
Unfortunately simply adding
hint.hdac.0.cad0.nid21.config="as=4 seq=15"
seems to have no effect.
Unfortunately I do not understand what the 'nid', 'as' and 'seq' parameters are ment to be for.
estellnb
March 16th, 2009, 18:43
As I have not found out on how to post attachements I have simply uploaded /var/log/messages at http://wwwu.edu.uni-klu.ac.at/estellnb/freebsd-bugs/messages .
estellnb
March 18th, 2010, 14:45
How should I freshen the snd_hda kernel module?
/usr/src/sys/modules/sound/driver/hda solely contains a single Makefile which has not been updated in the HEAD release.
estellnb
March 18th, 2010, 17:27
OK; that is done:
cd /sys/modules
mv sound sound-old
svn co http://svn.freebsd.org/base/head/sys/modules/sound
cd /sys/dev
mv sound sound-old
svn co http://svn.freebsd.org/base/head/sys/dev/sound
cd /sys/modules/sound/driver/hda
make depend all install (make depend; make all; make install;)
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.