Kernel module not autoloading as tunable or in loader.conf

Status
Not open for further replies.

Degeulars

Cadet
Joined
May 29, 2016
Messages
5
Hello,

I am running Freenas 9.3 and I am in the process of getting MusicPd running inside a jail, I have successfully found and installed the sound.ko and snd_hda.ko modules and manually loaded them with kldload and run MusicPd in my jail. I pulled the modules from a FreeBSD 9.2 install which works fine.
The sound interface is an Intel 8 series C220 series chipset high definition audio / Reltek ALC3220 which is integrated in the Dell T20.

The next obvious step was of course to get the kernel module to autoload during bootup, so I followed the FreeBSD documentation for snd_hda and added the line
Code:
snd_hda_load="YES"

to /boot/loader.conf
This did not load the module, there was nothing in dmesg about pcm0 and pcm1
After furthermore research I tried using a tunable which I defined and enabled as follows
Code:
Variable = snd_hda_load
Value = YES
Type = Loader
Comment = audio
Enabled = check


I hope someone can help with this.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
It's very possible that the infrastructure to do that isn't included in FreeNAS, which is an appliance and not intended to support random sound, video, joystick, etc., drivers.

You can probably make a script to do it (Tasks->Init/Shutdown).
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
There are no audio drivers in FreeNAS. Not even the PC speaker!
 

Degeulars

Cadet
Joined
May 29, 2016
Messages
5
Thanks, I know there are no audio drivers included, but I have sourced them from FreeBSD, tested them and manually loaded them and run audio inside a jail smoothly.
My question is more related the the FreeNAS "Tunables" system which is specifically made in order to automatically load kernel modules at startup. From what I can read in the FreeNAS documentation 5.7 Tunables
"FreeBSD loaders: a loader is only loaded when a FreeBSD-based system boots and can be used to pass a parameter to the kernel or to load an additional kernel module such as a FreeBSD hardware driver."
Which is exactly what I am looking for since snd_hda is a FreeBSD Hardware driver kernel module.
I suspect that FreeNAS simply ignores this as from what is specified two lines below in the documentation for rc.conf tunables
"not all of the services mentioned in rc.conf(5) are available for configuration."
I don't think this is necessarily a problem as I only need to go in and manually type in kldload snd_hda after a new boot which I almost never do.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Thanks, I know there are no audio drivers included, but I have sourced them from FreeBSD, tested them and manually loaded them and run audio inside a jail smoothly.
My question is more related the the FreeNAS "Tunables" system which is specifically made in order to automatically load kernel modules at startup. From what I can read in the FreeNAS documentation 5.7 Tunables
"FreeBSD loaders: a loader is only loaded when a FreeBSD-based system boots and can be used to pass a parameter to the kernel or to load an additional kernel module such as a FreeBSD hardware driver."
Which is exactly what I am looking for since snd_hda is a FreeBSD Hardware driver kernel module.
I suspect that FreeNAS simply ignores this as from what is specified two lines below in the documentation for rc.conf tunables
"not all of the services mentioned in rc.conf(5) are available for configuration."
I don't think this is necessarily a problem as I only need to go in and manually type in kldload snd_hda after a new boot which I almost never do.

Suggest you disregard canine halitosis and go read what I wrote. It's the "fix" for your problem.
 

Degeulars

Cadet
Joined
May 29, 2016
Messages
5
Hahahaha canine halitosis !
I did look into what you suggest, and I do think it would be a solution, however since I'm not fluent in shell script I think I'll wait until either the manual loading of the module really starts to annoy me or I finally get around to learning shell scripting... Thanks for the suggestion!
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Looks like you can also run an individual command through that technique now, just set "Command" and probably "Post-Init". In Cyberjock's defense I'll reiterate that this isn't supported and is rather frowned upon.
 

Degeulars

Cadet
Joined
May 29, 2016
Messages
5
Thanks, that worked like a charm now that I got an opportunity for a reboot to test it out.
And yes, I do know that sound on FreeNAS isn't supported and is frowned upon, I definitely found that out whilst researching this to get it to work. :)
In my case I don't run anything mission critical, plus FreeNAS/FreeBSD is so stable that I haven't hand any kind of problem, hang, or glitch with MusicPD running in a jail for a month and a half now.

Thank you!
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Glad to hear it. Make sure that you take care when doing updates because that's when this is most likely to go sideways somehow.
 

Degeulars

Cadet
Joined
May 29, 2016
Messages
5
Yes I do suspect that updates could make this type of thing go wrong, as I have experienced with other systems. But if it ain't broke why fix it ?
 
Status
Not open for further replies.
Top