LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   modprobe OSS - not auto-loading module in Arch Linux (https://www.linuxquestions.org/questions/linux-newbie-8/modprobe-oss-not-auto-loading-module-in-arch-linux-4175521443/)

Andy_Crowd 10-08-2014 10:23 AM

modprobe OSS - not auto-loading module in Arch Linux
 
Hello!

I tested a lot but still it doesn't loading automatically on boot.

My /etc/modprobe.d/snd_pcm_oss.conf
Code:

alias  oss snd_pcm_oss
install snd_pcm_oss modprobe -i oss
#install snd_pcm_oss modprobe -i snd_pcm_oss
#snd_pcm_oss


bigrigdriver 10-08-2014 11:14 AM

You might find this helpful, from the Arch Wiki.

Andy_Crowd 10-08-2014 11:24 AM

I did all that, as you my commented part in file, file name and few ways to load, but still ...
I don't know how to use options command in *.conf files fpr snd_pcm_oss, it is not a kernel module as I understand too, or am I wrong? I was looking much and read in forums and wikis and tested but not working or am I doing something wrong?

Is my snd_pcm_oss.conf file correct?

szboardstretcher 10-08-2014 11:30 AM

Before I explain the config file, i would like to check a couple things with you. You mention it does not load automatically at boot,..
  • If you load the module from the command line, does it work?
  • When you do an lsmod, you can see the module loaded?
  • If so, what command are you using to load the modules from the commandline?

There is no sense in discussing the config file, if you cannot get it to work from the command line.

Andy_Crowd 10-08-2014 11:38 AM

* Yes, it works from a command line.
* Yes, I can see it if I load it from the command line.
* I am using modprobe snd_pcm_oss to load it.

I need make snd_pcm_oss load automatically at boot without need to use modprobe each time but I am lost.

szboardstretcher 10-08-2014 11:56 AM

Ok. Thank you.

Now, when you have this config:

Code:

/etc/modprobe.d/snd_pcm_oss.conf
snd_pcm_oss

It does not work? What do you see in the logs regarding it?

Setting the debugging level higher might help as well: https://wiki.archlinux.org/index.php/boot_debugging

Once we have an error to work with, it will be easier to debug the issue.

Andy_Crowd 10-08-2014 12:07 PM

No, it doesn't.

But when I loading from the command line then I it shows an error... it loads module but ignores line in the file.
Code:

$ modprobe snd_pcm_oss
libkmod: kmod_config_parse: /etc/modprobe.d/snd_pcm_oss.conf line 1: ignoring bad line starting with 'snd_pcm_oss'


Andy_Crowd 10-08-2014 12:12 PM

I have installed pulseaudio-alsa and alsa-oss for making some of my programs to work and I need oss module to load on boot. Some users are restricted to use sudo so only I can run modprobe and it's not a good alternative to be with computer each time someone need to use it.

szboardstretcher 10-08-2014 12:23 PM

I made a file called /etc/modprobe.d/sound.conf and added this:

Code:

install snd_pcm_oss modprobe -i snd_pcm_oss
And it loaded on startup. I also added my user to the 'audio' group. This seems to have worked.

Andy_Crowd 10-08-2014 12:35 PM

This doesn't work either... it might be a bug in Arch Linux or the sound program that I installed... I will look for another way to load it may be will make a service that will run it if possible... or another way where I can add it to autostart with system...

Thanks for your time! I will continue my researches...

szboardstretcher 10-08-2014 12:46 PM

Did you turn debugging on and find the error related to the module at startup?

I would rather debug that than create a workaround, but if you want a work around, you can do this:

Create a systemd service to run rc.local (do all of this as root please):

Code:

#unload the module if loaded
rmmod snd_pcm_oss
lsmod | grep snd_pcm (verify that it has been unloaded)

Code:

#create the rc-local systemd service
cat << EOF > /etc/systemd/system/rc-local.service

[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target
EOF

Then in rc.local, add your modprobe command:
Code:


echo #!/bin/bash > /etc/rc.local
echo /usr/bin/modprobe snd_pcm_oss >> /etc/rc.local
chmod +x /etc/rc.local

Activate the unit:
Code:

systemctl enable rc-local.service
Run the unit for testing:
Code:

systemctl start rc-local.service
Check for module loading, if it worked, try a reboot to see if it loads again:
Code:

lsmod|grep pcm
When you reboot, systemd will run the command in rc.local which should add the module to your kernel.

Andy_Crowd 10-08-2014 01:11 PM

Code:

systemctl start rc-local.service
Job for rc-local.service failed. See 'systemctl status rc-local.service' and 'journalctl -xn' for details.
[root@andy andy]# systemctl status rc-local.service
● rc-local.service - /etc/rc.local Compatibility
  Loaded: loaded (/etc/systemd/system/rc-local.service; static)
  Active: failed (Result: exit-code) since ons 2014-10-08 20:04:10 CEST; 16s ago
  Process: 1372 ExecStart=/etc/rc.local start (code=exited, status=203/EXEC)

okt 08 20:04:10 andy systemd[1]: rc-local.service: control process exited, code=exited status=203
okt 08 20:04:10 andy systemd[1]: Failed to start /etc/rc.local Compatibility.
okt 08 20:04:10 andy systemd[1]: Unit rc-local.service entered failed state.

I also tested to chmod +x /etc/rc.local
Here is "journalctl -xn" output
Code:

-- Subject: Process /etc/rc.local could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The process /etc/rc.local could not be executed and failed.
--
-- The error number returned while executing this process is 8.
okt 08 20:07:51 andy systemd[1]: rc-local.service: control process exited, code=exited status=203
okt 08 20:07:51 andy systemd[1]: Failed to start /etc/rc.local Compatibility.
-- Subject: Unit rc-local.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit rc-local.service has failed.
--
-- The result is failed.
okt 08 20:07:51 andy systemd[1]: Unit rc-local.service entered failed state.


szboardstretcher 10-08-2014 01:22 PM

I forgot the install section and the shebang line.

Code:

#create the rc-local systemd service
cat << EOF > /etc/systemd/system/rc-local.service

[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target
EOF

Then in rc.local, add your modprobe command with absolute path:

Code:

echo #!/bin/bash > /etc/rc.local
echo /usr/bin/modprobe snd_pcm_oss >> /etc/rc.local
chmod +x /etc/rc.local


Andy_Crowd 10-08-2014 01:22 PM

You answered before I wrote :D
I can start service with no problem now. I still need to do some checks...

szboardstretcher 10-08-2014 01:26 PM

Nice. If you found all this time and effort helpful,. you can always click 'i found this helpful' on the posts.


All times are GMT -5. The time now is 05:54 PM.