Ubuntu 11.04 OSS doesn't start at boot time

OSS specific Linux discussion (x86/amd64)

Moderators: cesium, dev, kodachi, hannu

Ubuntu 11.04 OSS doesn't start at boot time

Postby Matti » Sun May 29, 2011 12:54 pm

I've first installed OSS in Ubuntu 10.10 and it was satrting normaly then I've tried to upgrade to 11.04 and I've end up with broken system. Than I've made a fresh install of Natty Narwhal
and installed OSS 4.2 2004 (package from OpenSound website) but it doesn't start sound system when booting. I remember that I have forgot to reboot after the reconfiguration of linux-sound-base and I also have my old home directory. Can this things have something to do with my problem.

I've also build OSS from Mercurial but that didn't solve that issue.

I can start Open Sound System with one of these commands:

sudo /etc/init.d/oss start

sudo soundon

I have also problems with VirtualBox kernel modules, each time when I want to run virtual machine I have to build kernel modules:

sudo /etc/init.d/vboxdrv setup

it points at some problems with permissions and I think that maybe OSS has the same problems.

This is the output of lsmod when sound is working:

Code: Select all
Module                  Size  Used by
oss_usb               116006  1
oss_hdaudio           148283  3
osscore               561377  2 oss_usb,oss_hdaudio
nls_utf8               12493  1
udf                    83179  1
lp                     13321  0
dm_crypt               22272  0
nv_tco                 13300  0
psmouse                64112  0
ppdev                  12813  0
serio_raw              12990  0
parport_pc             31999  1
usblp                  17721  0
i2c_nforce2            12869  0
parport                36651  3 lp,ppdev,parport_pc
k8temp                 12835  0
ufs                    77569  1
nvidia              10663066  70
firewire_ohci          35248  0
usb_storage            43741  0
firewire_core          55983  1 firewire_ohci
uas                    17527  0
crc_itu_t              12627  2 udf,firewire_core
forcedeth              57888  0
pata_amd               13762  1
sata_nv                22968  12
Matti
Member
 
Posts: 39
Joined: Sun May 29, 2011 12:34 pm

Re: Ubuntu 11.04 OSS doesn't start at boot time

Postby cesium » Sun May 29, 2011 6:04 pm

If you run "osstest" do you hear sound? What happens if you run "sudo soundon" and then osstest? What is the output of 'lsmod' in the event OSS has not started?
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: Ubuntu 11.04 OSS doesn't start at boot time

Postby Matti » Sun May 29, 2011 7:36 pm

If I run osstest when the Open Sound System didn't start I get this:

/dev/mixer: No such file or directory (no sound)

lsmod output:

Code: Select all
Module                  Size  Used by
nls_utf8               12493  1
udf                    83179  1
lp                     13321  0
dm_crypt               22272  0
nvidia              10663066  50
ppdev                  12813  0
nv_tco                 13300  0
i2c_nforce2            12869  0
parport_pc             31999  1
parport                36651  3 lp,ppdev,parport_pc
k8temp                 12835  0
ufs                    77569  1
usblp                  17721  0
psmouse                64112  0
serio_raw              12990  0
usb_storage            43741  0
firewire_ohci          35248  0
uas                    17527  0
firewire_core          55983  1 firewire_ohci
sata_nv                22968  12
pata_amd               13762  1
crc_itu_t              12627  2 udf,firewire_core
forcedeth              57888  0


When the OSS is up and running the osstest runs good. I can hear sound for pcm0 and spdout0 the rest is barely heard (pcm1 and pcm2) or to quiet (pcm3 and pcm4):

Code: Select all
Sound subsystem and version: OSS 4.2 (b 2004/201105051551) (0x00040100)
Platform: Linux/i686 2.6.39-bfq #1 SMP Sat May 21 22:15:14 CEST 2011

*** Scanning sound adapter #-1 ***
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front
- Performing audio playback test...
  <left> OK <right> OK <stereo> OK <measured srate 47987.00 Hz (-0.03%)>
/dev/oss/oss_hdaudio0/pcm1 (audio engine 1): HD Audio play rear
- Performing audio playback test...
  <left> OK <right> OK <stereo> OK <measured srate 47987.00 Hz (-0.03%)>
/dev/oss/oss_hdaudio0/pcm2 (audio engine 2): HD Audio play center/LFE
- Performing audio playback test...
  <left> OK <right> OK <stereo> OK <measured srate 47987.00 Hz (-0.03%)>
/dev/oss/oss_hdaudio0/pcm3 (audio engine 3): HD Audio play side
- Performing audio playback test...
  <left> OK <right> OK <stereo> OK <measured srate 47990.00 Hz (-0.02%)>
/dev/oss/oss_hdaudio0/pcm4 (audio engine 4): HD Audio play pcm4
- Performing audio playback test...
  <left> OK <right> OK <stereo> OK <measured srate 47990.00 Hz (-0.02%)>
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out
- Performing audio playback test...
  <left> OK <right> OK <stereo> OK <measured srate 47990.00 Hz (-0.02%)>
/dev/oss/oss_hdaudio0/pcmin0 (audio engine 6): HD Audio rec mix
- Skipping input only device
/dev/oss/oss_hdaudio0/pcmin1 (audio engine 7): HD Audio rec mix
- Skipping input only device
/dev/oss/oss_hdaudio0/spdin0 (audio engine 8): HD Audio rec spdifin
- Skipping input only device

*** All tests completed OK ***
Matti
Member
 
Posts: 39
Joined: Sun May 29, 2011 12:34 pm

Re: Ubuntu 11.04 OSS doesn't start at boot time

Postby cesium » Sun May 29, 2011 8:12 pm

OK, so it actually does not start. This is more of a distro issue:

A) Workaround: Add "soundon" to /etc/rc.local
B) Fixing this: I suspect you have leftovers of the old OSS install or that you removed it after installing the new version of OSS? Try purging all oss installs ('dpkg -l | grep oss' would show all. 'dpkg --purge (packagename)' would purge), and reinstalling oss.
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: Ubuntu 11.04 OSS doesn't start at boot time

Postby Matti » Sun May 29, 2011 9:16 pm

What exactly do I have to add to /etc/rc.local is it soundon or "soundon" or even something else.

I've tried purging OSS and installing it again before but it didn't solve starting problem. This time it also didn't work ('dpkg -l | grep oss' shows only oss-linux and libsdl1.2debian-oss). I've purge oss-linux and then rebooted and installed OSS again but sound still must be runned manually.
Matti
Member
 
Posts: 39
Joined: Sun May 29, 2011 12:34 pm

Re: Ubuntu 11.04 OSS doesn't start at boot time

Postby cesium » Sun May 29, 2011 9:31 pm

Just literally
soundon

before the exit 0 line (if it exists).
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: Ubuntu 11.04 OSS doesn't start at boot time

Postby Matti » Sun May 29, 2011 9:59 pm

Yes I have that and I remember that I aslo tried with /path to soundon.user in /etc/rc.local and that doesn't work.
Matti
Member
 
Posts: 39
Joined: Sun May 29, 2011 12:34 pm

Re: Ubuntu 11.04 OSS doesn't start at boot time

Postby cesium » Sun May 29, 2011 10:42 pm

It's not 'soundon.user' just soundon or /usr/sbin/soundon
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: Ubuntu 11.04 OSS doesn't start at boot time

Postby Matti » Mon May 30, 2011 3:19 pm

Still no success. I have tried both soundon and /usr/sbin/soundon. I also tried adding my username to src group because that's soundon group in my case (build from source).
Matti
Member
 
Posts: 39
Joined: Sun May 29, 2011 12:34 pm

Re: Ubuntu 11.04 OSS doesn't start at boot time

Postby igorzwx » Mon May 30, 2011 8:01 pm

Matti wrote:Still no success. I have tried both soundon and /usr/sbin/soundon. I also tried adding my username to src group because that's soundon group in my case (build from source).


If I understood you correctly, you simply wrote some words into /etc/rc.local script. Right?
Do you think that it is enough to make it work?
igorzwx
Supporter
 
Posts: 987
Joined: Sun Jun 28, 2009 9:31 pm

Re: Ubuntu 11.04 OSS doesn't start at boot time

Postby Matti » Mon May 30, 2011 8:07 pm

I have also made it executable. What else should I do with this script.
Matti
Member
 
Posts: 39
Joined: Sun May 29, 2011 12:34 pm

Re: Ubuntu 11.04 OSS doesn't start at boot time

Postby igorzwx » Mon May 30, 2011 8:09 pm

Matti wrote:I have also made it executable. What else should I do with this script.


Could you post the content of the script here?
igorzwx
Supporter
 
Posts: 987
Joined: Sun Jun 28, 2009 9:31 pm

Re: Ubuntu 11.04 OSS doesn't start at boot time

Postby Matti » Mon May 30, 2011 8:16 pm

Here it is:

Code: Select all
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/usr/sbin/soundon
exit 0
Matti
Member
 
Posts: 39
Joined: Sun May 29, 2011 12:34 pm

Re: Ubuntu 11.04 OSS doesn't start at boot time

Postby igorzwx » Mon May 30, 2011 8:25 pm

Run on terminal:

Code: Select all
$ dmesg | grep oss


It may tell you something, if OSS failed to start.

You may also try to start something else with /etc/rc.local script to see, if it works
https://wiki.archlinux.org/index.php/Rc ... 2Frc.local

EDIT: You may want to read this: https://help.ubuntu.com/community/RcLocalHowto

Another exotic innovation: http://en.wikipedia.org/wiki/Upstart
It seems to be a kind of "backdoor", which might be used for installing trojans on Ubuntu, see: http://www.theregister.co.uk/2011/02/09 ... _problems/
Imagine a kind of Linux Stuxnet http://en.wikipedia.org/wiki/Stuxnet

Upstart is subject to Canonical's contributor agreement, requiring contributors to assign copyright to Canonical, and allowing Canonical to release it under a non-open source license. http://en.wikipedia.org/wiki/Upstart

It seems that Upstart is still "open-source", but the documentation for it is already "closed". It is a kind of "secret esoteric knowledge". You have "services" like in MS Windows, and you do not know how to enable or disable them, and you do not know, of course, which services are enabled. Some of those services might be trojans, rootkits, or bots, and such services should be "invisible" and "undetectable". Otherwise, they can be easily removed.

On Ubuntu 11.04, OSS4 should be one of such services, and you do not know how to enable it.

On Arch Linux, everything is still under your control https://wiki.archlinux.org/index.php/Arch_Boot_Process
To enable OSS4, you have to add "oss" to DAEMONS array in /etc/rc.conf script:

Code: Select all
DAEMONS=(... oss ...)


This should ensure that OSS4 starts automatically on boot https://wiki.archlinux.org/index.php/OSS#Install
If "oss" is in your DAEMONS array, it should be started with /etc/rc.d/oss script on boot.

Code: Select all
$ cat /etc/rc.d/oss
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
  start)
        stat_busy 'Starting Open Sound System'
   if /usr/sbin/soundon
   then
      add_daemon oss
      stat_done
   else
      stat_fail
   fi
        ;;
  stop)
        stat_busy 'Stopping Open Sound System'
   if /usr/sbin/soundoff
   then
      rm_daemon oss
      stat_done
   else
      stat_fail
   fi
        ;;
  restart)
        $0 stop
        $0 start
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}"
esac

The script /etc/rc.d/oss is in the OSS package for Arch Linux. It should be installed automatically, when you install OSS4 with pacman:

Code: Select all
# pacman -S oss

see: https://wiki.archlinux.org/index.php/OSS#Install

You can simply download the OSS package

Code: Select all
$ sudo pacman --sync --downloadonly oss

and open it with the Archive Manager, to see, if the script is on the place: ./etc/rc.d/oss
You can find the OSS package in pacman's cache, e.g. /var/cache/pacman/pkg/oss-4.2_2004-1-i686.pkg.tar.xz
if it is downloaded or installed.

The Arch developers seem to be going to adopt Upstart to make Arch Linux more flexible, modern and advanced.
Upstart is already in AUR https://aur.archlinux.org/packages.php?ID=24506

PulseAudio has already been adopted in Arch Linux. It had been tested in AUR too.
igorzwx
Supporter
 
Posts: 987
Joined: Sun Jun 28, 2009 9:31 pm

Re: Ubuntu 11.04 OSS doesn't start at boot time

Postby Matti » Tue May 31, 2011 5:07 pm

If I run:

Code: Select all
$ dmesg | grep oss


than I don't get any output relevant to OSS.

I have created the /etc/init.d/local file with this:

Code: Select all
#!/bin/sh
# Wait 20 seconds
sleep 20
gnome-terminal
/usr/sbin/soundon
exit 0


and in /etc/rc.local the same thing. Still it doesn't work (even GNOME Terminal doesn't start).
Matti
Member
 
Posts: 39
Joined: Sun May 29, 2011 12:34 pm

Next

Return to Linux

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest