Difference between revisions of "Open Sound System"

From ArchWiki
Jump to: navigation, search
m (Testing: phrasing)
(Suspend and Hibernation)
(30 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[Category:Sound]]
 
[[Category:Sound]]
 
[[Category:Audio/Video]]
 
[[Category:Audio/Video]]
 +
[[de:OSS]]
 
[[es:Open Sound System]]
 
[[es:Open Sound System]]
 
[[fr:OSS]]
 
[[fr:OSS]]
Line 14: Line 15:
 
* Per-application volume control.
 
* Per-application volume control.
 
* Some legacy cards have better support.
 
* Some legacy cards have better support.
* Initial response time in audio applications is usually better.
+
* Lower latency. Initial response time in audio applications is usually better.
  
 
=== OSS Advantages (developers) ===
 
=== OSS Advantages (developers) ===
 
* Support for drivers in userspace.
 
* Support for drivers in userspace.
 
* Cross-platform (OSS runs on BSDs and Solaris).
 
* Cross-platform (OSS runs on BSDs and Solaris).
 +
* Cleaner and easier to use API.
  
 
=== ALSA advantages over OSS ===
 
=== ALSA advantages over OSS ===
Line 37: Line 39:
 
Install {{Pkg|oss}} from the [[Official Repositories|official repositories]].
 
Install {{Pkg|oss}} from the [[Official Repositories|official repositories]].
  
This will install the OSS files and run the OSS install script (temporarily disabling the ALSA modules) and install the OSS kernel modules. Since ALSA is enabled by default in the boot scripts, you need to disable it so it does not conflict with OSS. You can do this blacklisting the module:
+
There is also a development version of OSS available in the [[AUR]] with the {{AUR|oss-hg}} package.
  
{{hc|/etc/modprobe.d/alsa_blacklist.conf|
+
{{Note|{{AUR|oss-hg}} does not yet have a [[systemd]] unit file, but you can use the one from [https://projects.archlinux.org/svntogit/community.git/tree/trunk/oss.service?h=packages/oss oss]. For this you need to copy it to {{ic|/usr/lib/systemd/system/oss4.service}}.}}
install soundcore /bin/false}}
+
  
After blacklisting the module, you can [[Daemon|enable]] the '''oss''' daemon to start at boot.
+
This will install the OSS, run the OSS install script (temporarily disabling the ALSA modules) and install the OSS kernel modules. Since ALSA is enabled by default in the boot scripts, you need to disable it so it does not conflict with OSS. You can do this by blacklisting the module:
  
Add yourself to the ''audio'' group:
+
{{hc|/etc/modprobe.d/alsa_blacklist.conf|
 +
install soundcore /bin/false}}
  
{{Note|Re-log in for the change to take effect.}}
+
After blacklisting the module, you can [[Daemon|enable]] the '''oss''' (or '''oss4''' if using the development version) daemon to start at boot.
  
 +
In case you are not part of the ''audio'' group, add yourself and '''relogin''' for the changes to take effect:
 
  # gpasswd -a $USER audio
 
  # gpasswd -a $USER audio
  
Line 71: Line 74:
 
  $ ossmix -a | grep -i vmix
 
  $ ossmix -a | grep -i vmix
  
You should see a line like {{ic|vmix0-enable ON|OFF (currently ON)}}. If you do not see any lines beginning with {{ic|vmix}}, it probably means that {{ic|vmix}} has not been attached to your sound device. To attach {{ic|vmix}}, issue the command
+
You should see a line like {{ic|<nowiki>vmix0-enable ON|OFF (currently ON)</nowiki>}}. If you do not see any lines beginning with {{ic|vmix}}, it probably means that {{ic|vmix}} has not been attached to your sound device. To attach {{ic|vmix}}, issue the command:
  
 
  $ vmixctl attach device
 
  $ vmixctl attach device
  
where ''device'' is your sound device, eg., {{ic|/dev/oss/oss_envy240/pcm0}}.
+
where ''device'' is your sound device, e.g. {{ic|/dev/oss/oss_envy240/pcm0}}.
  
 
To avoid having to issue this command manually in the future, you can add it to {{ic|/usr/lib/oss/soundon.user}}, as suggested [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output here].
 
To avoid having to issue this command manually in the future, you can add it to {{ic|/usr/lib/oss/soundon.user}}, as suggested [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output here].
  
If you get a '''"Device or resource busy"''' error, you need to add {{ic|vmix_no_autoattach=1}} to {{ic|/usr/lib/oss/conf/osscore.conf}}, and then reboot.
+
If you get a '''"Device or resource busy"''' error, you need to add {{ic|1=vmix_no_autoattach=1}} to {{ic|/usr/lib/oss/conf/osscore.conf}} and then reboot.
  
 
'''See which devices are detected by running:'''
 
'''See which devices are detected by running:'''
Line 90: Line 93:
  
 
== Volume Control Mixer ==
 
== Volume Control Mixer ==
To control the volume of various devices, mixers levels will need to be set. There are two mixers. One is a command line mixer called {{ic|ossmix}}. This one is very like the BSD audio mixer (called mixerctl).  
+
To control the volume of various devices, mixers levels will need to be set. There are two mixers:
 
+
* '''ossmix''': a command-line mixer, similar to the BSD audio mixer {{ic|mixerctl}}.  
The second mixer is a graphical mixer called {{ic|ossxmix}} and will require {{Pkg|gtk2}} to be installed to run it.
+
* '''ossxmix''': a GTK+-based graphical mixer.
  
 
The basic {{ic|ossxmix}} controls look like:
 
The basic {{ic|ossxmix}} controls look like:
Line 163: Line 166:
  
 
=== Saving Mixer Levels ===
 
=== Saving Mixer Levels ===
Mixer levels are saved when you shut off your computer.  If you want to save the mixer level immediately, as root:
+
Mixer levels are saved when you shut off your computer.  If you want to save the mixer level immediately, execute as root:
 
+
 
  # savemixer
 
  # savemixer
  
Line 171: Line 173:
 
=== Other Mixers ===
 
=== Other Mixers ===
 
Other mixers that have support for OSS:
 
Other mixers that have support for OSS:
* {{App|GNOME|Gnome Volume Control|http://library.gnome.org/users/gnome-volume-control/stable/|{{Pkg|gnome}}}}
+
* {{App|Gnome Volume Control| for [[GNOME]].|http://library.gnome.org/users/gnome-volume-control/stable/|{{Pkg|gnome}}}}
* {{App|KDE|Kmix|http://www.kde.org/applications/multimedia/kmix/|{{Pkg|kdemultimedia-kmix}}}}
+
* {{App|Kmix|for [[KDE]].|http://www.kde.org/applications/multimedia/kmix/|{{Pkg|kdemultimedia-kmix}}}}
* {{App|LXDE|VolWheel|http://oliwer.net/b/volwheel.html|{{Pkg|volwheel}}}}
+
* {{App|VolWheel|for [[LXDE]].|http://oliwer.net/b/volwheel.html|{{Pkg|volwheel}}}}
  
 
After installing VolWheel, you will need to do the following to enable OSS support:
 
After installing VolWheel, you will need to do the following to enable OSS support:
 
* add it to the [[LXDE]] {{ic|autostart}} file:
 
* add it to the [[LXDE]] {{ic|autostart}} file:
 
   echo "volwheel" >> ~/.config/lxsession/LXDE/autostart
 
   echo "volwheel" >> ~/.config/lxsession/LXDE/autostart
* set the correct preferences:
+
* right click on the system tray icon, choose the ''Preferences'' item and then change:
** Driver: '''OSS'''
+
** Driver: '''OSS'''.
** Default Channel: '''vmix0-outvol''' (find out what channel to use from {{ic|ossmix}})
+
** Default Channel: '''vmix0-outvol''' (find out what channel to use from {{ic|ossmix}}).
** Default Mixer: '''ossxmix'''
+
** Default Mixer: '''ossxmix'''.
** Tab MiniMixer (optional): '''vmix0-outvol''' and optionally others.
+
** In the MiniMixer tab (optional), add '''vmix0-outvol''' and optionally others.
  
 
== Configuring Applications for OSS ==
 
== Configuring Applications for OSS ==
  
=== Skype ===
+
=== Applications that use GStreamer ===
The {{Pkg|skype}} package only includes support for ALSA. To get an OSS-capable Skype, install the {{Pkg|bin32-skype-oss}} package from the [[AUR]].
+
If you have problems with applications that use Gstreamer for audio, you can try removing {{Pkg|pulseaudio}} and installing the {{Pkg|gstreamer0.10-good-plugins}} package which is needed by {{ic|oss4sink}} and {{ic|oss4src}}.
  
=== Wine ===
+
Then you have to change the GStreamer settings to output the sound to OSS instead of the default ALSA with {{ic|gstreamer-properties}} (part of the {{Pkg|gnome-media}} package). After starting {{ic|gstreamer-properties}}, you have to modify the fields as follows:
To set OSS support in Wine:
+
* in the ''Default Output'' section: if OSS is not available as a plugin, change ''Plugin'' to '''Custom''' and ''Pipeline'' to '''oss4sink'''.
* Run {{ic|winecfg}}.
+
* in the ''Default Input'' section: if OSS is not available, change ''Plugin'' to '''Custom''' and ''Pipeline'' to '''oss4src'''.
$ winecfg
+
  
* Go to the {{ic|Audio}} tab.
+
{{Note|You can also use {{ic|osssrc}} as an alternative to {{ic|oss4src}} if you find that it produces better sound.}}
* Select {{ic|OSS Driver}}.
+
  
=== Gajim ===
+
Some applications (e.g. Rhythmbox, Totem) do not read the settings set by {{ic|gstreamer-properties}}, as they rely on {{ic|musicaudiosink}} instead of {{ic|audiosink}} (which is modified by {{ic|gstreamer-properties}}).  
By default Gajim uses {{ic|aplay -q}} to play a sound. To change this go in Advanced Settings and search for the {{ic|soundplayer}} variable. The {{ic|ossplay}} program included in the {{Pkg|oss}} package is a good replacement: {{ic|ossplay -qq}}.
+
  
=== MOC ===
+
To work around this, you can set the values for {{ic|audiosink}} with {{ic|gstreamer-properties}} and use {{ic|gconf-editor}} to copy the value of {{ic|/system/gstreamer/0.10/default/audiosink}} to {{ic|musicaudiosink}} (at the same location).
To use MOC with OSS v4.1 you must change {{ic|OSSMixerDevice}} to {{ic|/dev/ossmix}} in your config (located in {{ic|~/.moc}}).
+
  
Alternatively, you can use the {{AUR|moc-svn}} package from the [[AUR]] that has OSS support. For issues with the interface try changing the {{ic|OSSMixerChannel}}: press 'w' in {{ic|mocp}} (to change to sofware mixer).
+
If you are using Phonon with the GStreamer backend you will need to set a environmental variable:
 +
export PHONON_GST_AUDIOSINK=oss4sink
  
=== Applications that use Gstreamer ===
+
You can add this to your {{ic|~/.bashrc}} to be loaded on login.
  
Remove {{Pkg|pulseaudio}} and install the {{Pkg|gstreamer0.10-good-plugins}} package which is needed for {{ic|oss4sink}} and {{ic|oss4src}}.
+
=== Audacity ===
  
To change the GStreamer setting to output the sound to OSS instead of the default ALSA, run:
+
If [http://audacity.sourceforge.net/ Audacity] starts, but it complains that it cannot open the device or simply does not play anything, then you may be using {{ic|vmix}} which prevents Audacity from having exclusive access to your sound device. To fix this, before running Audacity, run:
  $ gstreamer-properties
+
  $ ossmix vmix0-enable OFF
  
Change the '''Default Output''' plugin to custom and the change the pipeline to:
+
You can restore {{ic|vmix}} after closing Audacity with:
  oss4sink
+
  $ ossmix vmix0-enable ON
  
For the input:
+
=== Gajim ===
 +
By default, [http://gajim.org/ Gajim] uses {{ic|aplay -q}} to play a sound. For OSS you can change it to the equivalent {{ic|ossplay -qq}} by going to ''Edit > Preferences > Advanced'', opening the ''Advanced Configuration Editor'' and modifying the {{ic|soundplayer}} variable accordingly.
  
oss4src
+
=== MOC ===
 +
To use [[Moc|MOC]] with OSS v4.1 you must change {{ic|OSSMixerDevice}} to {{ic|/dev/ossmix}} in your configuration file (located in {{ic|~/.moc}}). For issues with the interface try changing the {{ic|OSSMixerChannel}} by pressing {{Keypress|w}} in {{ic|mocp}} (to change to the sofware mixer).
  
{{Note|It is not certain that the input will sound better with {{ic|oss4src}} compared to {{ic|osssrc}}, so change this only if it improves your input sound. < confirmation on this please >}}
+
=== MPD ===
 +
[[MPD]] is configured through {{ic|/etc/mpd.conf}} or {{ic|~/.mpdconf}}. Check both of these files, looking for something that looks like:
 +
{{hc|/etc/mpd.conf|
 +
...
 +
audio_output {
 +
    type    "alsa"
 +
    name    "Some Device Name"
 +
}
 +
...}}
  
{{Note|For some applications (e.g. Rhythmbox, Totem) the gstreamer-properties have no effect, as they rely on "musicaudiosink" instead of "audiosink" (which is modified by gstreamer-properties). Workaround: Set audiosink with gstreamer-properties and use gconf-editor to copy the value of "/system/gstreamer/0.10/default/audiosink" to "musicaudiosink" (at the same location) }}
+
If you find an uncommented (the lines do not begin with #'s) ALSA configuration like the one above, comment all of it out, or delete it, and add the following:
 +
{{hc|/etc/mpd.conf|
 +
...
 +
audio_output {
 +
    type    "oss"
 +
    name    "My OSS Device"
 +
}
 +
...}}
  
If you are using phonon with the gstreamer backend you will need to set the environmental variable. To add to your current user:
+
Further configuration might not be necessary for all users. However, if you experience issues (in that MPD does not work properly after it has been restarted), or if you like having specific (i.e. more user-configured, less auto-configured) configuration files, the audio output for OSS can be more specifically configured as follows:  
 +
* First, run:
 +
$ ossinfo | grep /dev/dsp
  
export PHONON_GST_AUDIOSINK=oss4sink
+
* Look for the line that says something similar to {{ic|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}. Take note of what your {{ic|<SOME_CARD_IDENTIFIER>}} is, and add these lines to your OSS {{ic|audio_output}} in your MPD configuration file:
 +
{{hc|/etc/mpd.conf|
 +
...
 +
audio_output {
 +
    type            "oss"
 +
    name            "My OSS Device"
 +
    '''device          "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''
 +
    '''mixer_device    "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''
 +
}
 +
...
 +
}}
  
Add this to your {{ic|~/.bashrc}} to be loaded on login.
+
See also: [[Music Player Daemon#Global Configuration]].
  
===Mplayer===
+
=== MPlayer ===
 +
If you are using a GUI (SMplayer, GNOME MPlayer, etc.) you can select OSS as the default output in the settings dialogs. If you use [[MPlayer]] from the command-line, you should specify the sound output:
 +
$ mplayer -ao oss /some/file/to/play.mkv
  
If you are using gui (smplayer etc.) you will find the oss output at the audio settings. Using on cli you should specify the sound output: {{ic|mplayer -ao oss /some/file/to/play.mkv}} If you do not want to bother typing it over and over again add "ao=oss" to your config file. ({{ic|"$HOME"/.mplayer/config}})
+
If you do not want to bother typing it over and over again add {{ic|1=ao=oss}} to your configuration file (at {{ic|~/.mplayer/config}}).
  
===Music Player Daemon===
+
See also: [[Mplayer#Configuration]].
  
MPD is configured through /etc/mpd.conf or ~/.mpdconf. Check both of these files, looking for something that looks like:
+
=== Skype ===
 +
The {{Pkg|skype}} package only includes support for ALSA. To get an OSS-capable [[Skype]], install the {{Pkg|bin32-skype-oss}} package from the [[AUR]].
  
  audio_output {
+
See also: [[Skype#Skype-OSS Sound (Pre-2.0)]].
        type          "alsa"
+
        name          "Some Device Name"
+
  }
+
  
If you find an uncommented (the lines do not begin with #'s) ALSA configuration like the one above, comment all of it out, or delete it, and add the following:
+
=== VLC media player ===
 +
You can select OSS as the default output in the audio settings.
  
  audio_output {
+
=== Wine ===
        type          "oss"
+
To set OSS support in [[Wine]] start:
        name          "My OSS Device"
+
$ winecfg
  }
+
and go to the {{ic|Audio}} tab and select the {{ic|OSS Driver}}.
 
+
{{Note|I had to put this configuration in my ~/.mpdconf for it to work properly, but it ought to work in /etc/mpd.conf as well.}}
+
Further configuration might not be necessary for all users. However, if you experience issues (in that MPD does not work properly after it has been restarted), or if you like having specific (i.e. more user-configured, less auto-configured) config files, the audio output for OSS can be more specifically configured as follows: First, run:
+
 
+
  ossinfo | grep /dev/dsp
+
 
+
Look for the line that says something similar to {{ic|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}. Take note of what your <SOME_CARD_IDENTIFIER> is, and add bolded lines to your OSS audio output in your mpd config file:
+
 
+
  audio_output {
+
        type            "oss"
+
        name            "My OSS Device"
+
        '''device          "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''
+
        '''mixer_device    "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''
+
  }
+
 
+
=== Audacity ===
+
 
+
If audacity will start but either complains that it cannot open the device or simply doesn't play anything, then you may be using vmix. Audacity expects exclusive access to your sound device. To fix this, before running audacity, run:
+
 
+
  ossmix vmix0-enable OFF
+
 
+
You can restore vmix after ending audacity with
+
  
  ossmix vmix0-enable ON
+
See also: [[Wine#Sound]].
  
 
===Other applications===
 
===Other applications===
  
 
* If you can not get sound from an application not listed here, try looking at the [http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 Configuring Applications for OSSv4] page.
 
* If you can not get sound from an application not listed here, try looking at the [http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 Configuring Applications for OSSv4] page.
* Search OSS specific packages by using {{ic|pacman -Ss -- -oss}} and [https://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| in AUR].
+
* Search for OSS specific packages by using {{ic|pacman -Ss -- -oss}} or by looking in the [https://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100 AUR].
  
==Troubleshooting==
+
== Tips and tricks ==
  
===Troubleshooting HDAudio devices===
+
=== Using multimedia keys with OSS ===
 +
An easy way to mute/unmute and increase/decrease the volume is to use the {{AUR|ossvol}} script, available in the [[AUR]]. For more information about the script see [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol this article] on the OSS wiki.
  
====Understanding why problems arise====
+
Once you installed it, type:
+
If you have a HDAudio sound device, it is very likely that you will have to adjust some mixer settings before your sound works.
+
 
+
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time. These controls are exposed to the mixer, and they can be used, for example, to turn the earphone jack into a sound input jack instead of a sound output jack.
+
 
+
However, there is a side effect, mainly because the HDAudio standard is more flexible than it perhaps should be, and because the vendors often only care to get their ''official drivers'' working.
+
 
+
Then, when using HDAudio devices, you often find disorganized mixer controls, that does not work at all by default, and you are forced to try every mixer control combination, until it works.
+
 
+
====How to solve====
+
 
+
Open {{ic|ossxmix}} and try to change every mixer control in the ''middle area'', that contains the sound card specific controls, as explained in the previous "[[OSS#Volume Control|Volume Control]]" section.
+
 
+
You will probably want to setup a program to record/play continously in the background (e.g. {{ic|<nowiki>ossrecord - | ossplay -</nowiki>}}  for recording or {{ic|osstest -lV}} for playing), while changing mixer settings in ossxmix in the foreground.
+
 
+
* Raise every volume control slider.
+
* In each option box, try to change the selected option, trying all the possible combinations.
+
* If you get noise, try to lower and/or mute some volume controls, until you find the source of the noise.
+
 
+
Please note again that you do '''not''' need to change any controls in the ''top area'' nor in the ''bottom area'', as they are virtual {{ic|vmix}}-related mixer controls.
+
 
+
* Editing {{ic|/usr/lib/oss/conf/oss_hdaudio.conf}} uncommenting and changing ''hdaudio_noskip=0'' to a value from 0-7 can give you more jack options in ossxmix
+
I had to edit mine to ''hdaudio_noskip=7'' for my sub/rear speaker to work on my laptop, restart oss for the changes to take effect {{ic|/etc/rc.d/oss restart}}
+
 
+
===MMS sound cracking in totem===
+
If your stream sounds with cracks or strange noise in totem like it did with me then you could try to play it with another backend like ffmpeg (mplayer). That "fixed" the issue for me. This will not fix the issue that somehow pops up in gstreamer when playing MMS streams but it will give you the option to play it with good sound quality. Playing it in mplayer is simple:
+
# mplayer mmsh://yourstreamurl
+
 
+
===Microphone playing through output channels===
+
 
+
OSS by default plays back the microphone through the speakers. To disable this in ossxmix find the misc section. Check off every "input-mix-mute" to disable this.
+
 
+
===Troubleshooting other issues===
+
 
+
* If you get distorted sound, try lowering some volume control sliders.
+
 
+
* If you need to change the default sound card, look at [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output here].
+
 
+
* If you have another issues, try searching or asking for help at the [http://www.4front-tech.com/forum 4front forums].
+
 
+
==Tips and tricks==
+
 
+
===Using multimedia keys with OSS===
+
An easy way to mute/unmute and increase/decrease the volume is to use the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{ic|ossvol}} script] available in [[AUR]].
+
 
+
Once you installed it try to toggle the sound:
+
 
  $ ossvol -t
 
  $ ossvol -t
 +
to toggle mute, or:
 +
$ ossvol -h
 +
to see the available commands.
  
Type {{ic|ossvol -h}} for the other commands.
+
{{Note|If {{ic|ossvol}} gives an error like '''Bad mixer control name(987) 'vol'''', you need to edit the {{ic|/usr/bin/ossvol}} script and change the {{ic|CHANNEL}} variable to your default channel (usually {{ic|vmix0-outvol}}).}}
  
If you do not know how to assign commands to your multimedia keys, see [[Extra Keyboard Keys]].
+
If you want to use multimedia keys with {{ic|ossvol}}, see [[Extra Keyboard Keys]] and make sure they are properly configured. After that you can use, for example, [[Xbindkeys]] to bind them to the {{ic|ossvol}} script. Add the following to your {{ic|~/.xbindkeysrc}} file:
 +
{{hc|~/.xbindkeysrc|
 +
# Toggle mute
 +
"ossvol -t"
 +
    m:0x0 + c:121
 +
    XF86AudioMute
  
==={{ic|ossvol}} troubleshooting===
+
# Lower volume
If you get an error like:
+
"ossvol -d 2"
Bad mixer control name(987) 'vol'
+
    m:0x0 + c:122
you need to edit the script ({{ic|/usr/bin/ossvol}}) and change the value of the {{ic|CHANNEL}} variable which is at the beginning of the script. For example mine is {{ic|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}.
+
    XF86AudioLowerVolume
  
*'''Note''' if you are using xbindkeys for your multimedia keys adding this
+
# Raise volume
 +
"ossvol -i 2"
 +
    m:0x0 + c:123
 +
    XF86AudioRaiseVolume
 +
}}
 +
and optionally change the multimedia keys with whatever shortcuts you prefer.
  
"if ossmix misc.speaker-mute|grep OFF;then ossmix misc.speaker-mute on;else ossmix misc.speaker-mute off;fi;"
+
=== Changing the Sample Rate ===
toggle the sound
+
Changing the output sample rate is not obvious at first. Sample rates can only be changed by root and {{ic|vmix}} must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, do not bother changing anything here as you will not notice a difference.
"ossmix vmix0-outvol -- +1"
+
raise volume
+
"ossmix vmix0-outvol -- -1"
+
lower volume
+
  
to the raise/lower volume section of your .xbindkeysrc file is an easy way to adjust the volume
+
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed, that you will have a loss in audio quality. This is most noticeable in down sampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ Stereophile] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's ''CoreAudio API'' mailing list if you wish to learn more about this issue.
 
+
===Changing the Sample Rate===
+
 
+
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, do not bother changing anything here as you will not notice a difference.
+
 
+
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue.
+
  
 
Some example sample rates:
 
Some example sample rates:
  
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.
+
; 44100hz: Sample rate of standard [[Wikipedia:Red Book (CD standard)|Red Book]] audio CDs.
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.
+
; 88000hz: Sample rate of [[Wikipedia:Super Audio CD|SACD]] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.
+
; 96000hz: Sample rate of most high definition audio downloads. If your motherboard is an [[Wikipedia:AC'97|AC'97]] motherboard, this is likely to be your highest bitrate.
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio].  
+
; 192000hz: Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio receiver equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [[Wikipedia:Intel High Definition Audio|HD Audio]].  
  
To check what your sample rate is currently set to:
+
To check what your sample rate is currently set to, run:
 +
ossmix | grep rate
  
# Run {{ic|<nowiki>"ossmix | grep rate"</nowiki>}}.
+
You are likely to see {{ic|vmix0-rate <decimal value> (currently 48000) (Read-only)}}.
  
You are likely to see {{ic|"vmix0-rate <decimal value> (currently 48000) (Read-only)"}}.
+
If you do not see a {{ic|vmix0-rate}} (or {{ic|vmix1-rate}}, etc.) being outputted, then it probably means that {{ic|vmix}} is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section does not apply. Exception to this are Envy24 (and Envy24HT) cards that have a special setting {{ic|envy24.rate}} which has a similar function (see the {{ic|oss_envy24}} manpage).
  
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section does not apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.
+
To change your sample rate:
 +
# First, make sure your card is able to use the new rate. Run {{ic|ossinfo -v2}} and see if the wanted rate is in the ''Native sample rates'' output.
 +
# As root, run {{ic|/usr/lib/oss/scripts/killprocs.sh}}. Be aware, this will close any program that currently has an open sound channel.
 +
# After all programs occupying {{ic|vmix}} are terminated, run as root: {{ic|vmixctl rate /dev/dsp 96000}} replacing the rate with your desired sample rate (and {{ic|ossmix envy24.rate 96000}} if applicable).
 +
# Run {{ic|<nowiki>ossmix | grep rate</nowiki>}} and check for {{ic|vmix0-rate <decimal value> (currently 96000) (Read-only)}} to see if you were successful.
 +
#'''To make the changes permanent''' add the following to the {{ic|soundon.user}} file:
 +
{{hc|/usr/lib/oss/soundon.user|
 +
#!/bin/sh
  
Steps to affect the change:
+
vmixctl rate /dev/dsp 96000
 +
# ossmix envy24.rate 96000 # uncomment if you have an Envy24(HT) card
  
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.
+
exit 0
# As root, run {{ic|"/usr/lib/oss/scripts/killprocs.sh"}}. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).
+
}}
# After all programs occupying vmix are terminated, run as root: {{ic|"vmixctl rate /dev/dsp 96000"}} replacing the rate with your desired sample rate.
+
and make it executable:
# Run {{ic|<nowiki>"ossmix | grep rate"</nowiki>}} and check for {{ic|"vmix0-rate <decimal value> (currently 96000) (Read-only)"}} to see if you were successful.
+
# chmod +x /usr/lib/oss/soundon.user
#''' Make changes permanent''' use the soundon.user file to set the rate for every soundon
+
write {{ic|"vmixctl rate /dev/dsp 96000" in the file /usr/lib/oss/soundon.user}} and make it executable.
+
 
+
===Changing the Default Sound Output===
+
 
+
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses.  If this is what your sound is like, then it is set to the wrong output.
+
 
+
      *** 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 47991.00 Hz (-0.02%)>
+
 
+
The left sounded good, the right and stereo were the distorted ones.
+
 
+
Let the test continue until you get a working output:
+
      /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 47991.00 Hz (-0.02%)>
+
 
+
If this passed the test on all left, right and stereo, proceed to next step.
+
 
+
So from here:
+
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]
+
you get the command to change the default output; change according to what works for you
+
      sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich
+
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.
+
 
+
===Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB===
+
 
+
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa.  Thanks!!
+
 
+
It is surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.
+
 
+
To fix this, a recompile of oss is nessasary, for now.
+
 
+
* Grab the latest oss from the Arch Repo
+
https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/oss
+
* Extract it
+
* cd to the folder, I renamed the folder to oss
+
* run makepkg --nobuild
+
* cd to src/kernel/drv/oss_usb/ ; edit '''ossusb_audio.c''' ; add a {{ic|'''return 1'''}}
+
** should look like so:
+
    static int
+
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,
+
                      int ctl, int l, unsigned int v)
+
{
+
    return 1;
+
* cd to src/kernel/setup and edit srcconf_linux.inc, search for -Werror and remove it, otherwise OSS will not compile.
+
* do makepkg --noextract
+
 
+
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki>
+
  
===A simple systray applet===
+
=== A simple system tray applet ===
Want a applet to control volume like in GNOME? From [http://bbs.archlinux.org/viewtopic.php?id=77440 here] I got a usable [http://pastebin.furver.se/0xflchkfz/ one].  
+
For those wanting a very lightweight OSS system tray applet see [http://pastebin.furver.se/0xflchkfz/ this one].
  
Download [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt this] script and rename whatever you want, e.g.: ossvolctl. run the following command:
+
To install it:
 +
* Download [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt the script] with whatever name you want (e.g. {{ic|ossvolctl}})
 +
* Make it executable:
 
  $ chmod +x ossvolctl
 
  $ chmod +x ossvolctl
 +
* And copy it to your {{ic|/usr/bin}}:
 
  # cp ossvolctl /usr/bin/ossvolctl
 
  # cp ossvolctl /usr/bin/ossvolctl
or
+
or:
 
  # install -Dm755 ossvolctl /usr/bin/ossvolctl
 
  # install -Dm755 ossvolctl /usr/bin/ossvolctl
  
There's also the {{Pkg|volwheel}} package.
+
=== Start ossxmix docked to the system tray on startup ===
  
===Start ossxmix docked to systray on startup===
+
==== KDE ====
  
'''KDE 4'''
+
Create an application launcher file named {{ic|ossxmix.desktop}} in you local application launchers directory ({{ic|~/.local/share/applications/}} with:
 
+
{{hc|~/.local/share/applications/ossxmix.desktop|<nowiki>
Create an application launcher file named {{ic|ossxmix.desktop}} in you local application launchers directory ({{ic|~/.local/share/applications/}} then enter:
+
[Desktop Entry]
 
+
{{bc|1=[Desktop Entry]
+
 
Name=Open Sound System Mixer
 
Name=Open Sound System Mixer
 
GenericName=Audio Mixer
 
GenericName=Audio Mixer
Line 455: Line 379:
 
Terminal=false
 
Terminal=false
 
Type=Application
 
Type=Application
Encoding=UTF-8}}
+
Encoding=UTF-8</nowiki>
 +
}}
  
To add it to autostart when loading the desktop environment:
+
To have it autostart with your system, add it to the list in ''System Settings > System Administration > Startup and Shutdown > Autostart''.
  
System Settings > Advanced tab > Autostart.  Then click add program and choose it from the 'Multimedia' list.
+
==== Gnome ====
  
'''Gnome'''
+
As root create a file {{ic|/usr/local/bin/ossxmix_bg}} with the following content:
 +
{{hc|/usr/local/bin/ossxmix_bg|
 +
#!/bin/sh
  
*As Root create a file /usr/local/bin/ossxmix_bg with the following content:
 
 
{{bc|
 
#!/bin/sh
 
 
exec /usr/bin/ossxmix -b
 
exec /usr/bin/ossxmix -b
 
}}
 
}}
  
Goto System > Preferences > Start Up Applications
+
Then go to ''System > Preferences > Start Up Applications'' and:
 +
* Click ''Add'', type {{ic|OSSMIX}} in the ''Name'' field and {{ic|/usr/local/bin/ossxmix_bg}} in ''Command'' field then click ''Add Button''.
 +
* Login and logout to see the changes.
  
*Click Add, Type OSSMIX in Name field and {{ic|/usr/local/bin/ossxmix_bg}} in Command field then click Add button.
+
=== Record sound output from a program ===
 
+
*Login and Logout to see the changes.
+
 
+
===Record sound output from a program===
+
  
 
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].
 
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].
  
===Suspend and Hibernation===
+
=== Suspend and Hibernation ===
  
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.
+
OSS does not automatically support suspend, it must be manually stopped prior to suspending or hibernating and restarted afterwards.
  
OSS provides {{ic|soundon}} and {{ic|soundoff}} to enable and disable OSS, although any processes that use sound must be terminated first.
+
OSS provides {{ic|soundon}} and {{ic|soundoff}} to enable and disable OSS, although they only stop OSS if all processes that use sound are terminated first.
  
 
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.
 
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.
 +
{{hc|/etc/pm/sleep.d/50osssound|
 +
#!/bin/sh
 +
. "${PM_FUNCTIONS}"
 
   
 
   
#!/bin/sh
+
suspend_osssound()
. "${PM_FUNCTIONS}"
+
{
 +
    /usr/lib/oss/scripts/killprocs.sh
 +
    /usr/sbin/soundoff
 +
}
 
   
 
   
suspend_osssound()
+
resume_osssound()
{
+
{
  /usr/lib/oss/scripts/killprocs.sh
+
    /usr/sbin/soundon
  /usr/sbin/soundoff
+
}
}
+
 
   
 
   
resume_osssound()
+
case "$1" in
{
+
    hibernate|suspend)
  /usr/sbin/soundon
+
        suspend_osssound
}
+
+
case "$1" in
+
  hibernate|suspend)
+
  suspend_osssound
+
 
  ;;
 
  ;;
  thaw|resume)
+
    thaw|resume)
 
  resume_osssound
 
  resume_osssound
 
  ;;
 
  ;;
  *) exit $NA
+
    *) exit $NA
 
  ;;
 
  ;;
esac
+
esac
 
+
}}
Save the contents of the script (as root) into {{ic|/etc/pm/sleep.d/50ossound}} and make it executable. {{ic| chmod a+x /etc/pm/sleep.d/50ossound}}
+
  
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}
+
Save the contents of this script (as root) into {{ic|/etc/pm/sleep.d/50osssound}} and make it executable:
 +
chmod a+x /etc/pm/sleep.d/50osssound
  
OSS does not support suspending but we do not care or better [[Suspend_to_RAM|s2ram]] works fine without stopping OSS.
+
{{Warning|This script is rather basic and will terminate any application directly accessing OSS. Save your work prior to suspending/hibernating.}}
Just create a nice suspend script to /sbin/suspend and make it executable.
+
  
 +
An alternative would be to use [[Suspend_to_RAM|s2ram]] for suspending. Just create a suspend script to {{ic|/sbin/suspend}} and make it executable.
 
{{bc|<nowiki>
 
{{bc|<nowiki>
 
  #!/bin/sh
 
  #!/bin/sh
Line 533: Line 454:
 
  sleep 2
 
  sleep 2
  
  /etc/rc.d/oss restart 2>/tmp/oss.txt ||
+
  /etc/rc.d/oss restart 2>/tmp/oss.txt || echo "OSS restart failed, check /tmp/oss.txt for information"
echo "OSS restart failed, check /tmp/oss.txt for advice"
+
 
</nowiki>}}
 
</nowiki>}}
 +
With this, all your apps should be fine.
  
That is all your apps are fine and suspend works. \o/
+
{{Note |If you are using Opera you must kill {{ic|operapluginwrapper}} before suspend. To do this add {{ic|1=pid=$(pidof operapluginwrapper) && kill $pid}} before {{ic|s2ram -f}}.}}
  
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>pid=$(pidof operapluginwrapper) && kill $pid</nowiki>''' before s2ram -f. }}
+
=== Changing the Default Sound Output ===
  
===ALSA emulation===
+
When running {{ic|osstest}}, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses.  If this is what your sound is like, then it is set to the wrong output.
 +
 
 +
*** 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 47991.00 Hz (-0.02%)>
 +
 
 +
The left sounded good, the right and stereo were the distorted ones.
 +
 
 +
Let the test continue until you get a working output:
 +
/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 47991.00 Hz (-0.02%)>
 +
 
 +
If this passed the test on all left, right and stereo, proceed to next step.
 +
 
 +
For the command to change the default output see [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output this OSS wiki article]. Change it to what works for you, for example:
 +
# ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich
 +
For surround sound (4.0-7.1) choose {{ic|dsp_multich}}, for only 2 channels, {{ic|dsp}} is sufficient. See [http://manuals.opensound.com/usersguide/dsp.html this] for all available devices.
 +
 
 +
=== Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB ===
 +
This information is taken from the [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech forum].
 +
 
 +
It is surprising to learn that the external card does not work just because of a missing true return value in the function {{ic|write_control_value(...)}} in {{ic|ossusb_audio.c}}.
 +
 
 +
To fix this, a recompile of OSS is necessary, for now.
 +
 
 +
* Grab the latest OSS from the Arch Repo
 +
https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/oss
 +
* Extract it
 +
* {{ic|cd}} into the folder
 +
* run {{ic|makepkg --nobuild}}
 +
* {{ic|cd}} to {{ic|src/kernel/drv/oss_usb/}} and edit {{ic|ossusb_audio.c}}: add a {{ic|return 1;}}.
 +
** should look like so:
 +
{{hc|ossusb_audio.c|
 +
static int
 +
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,
 +
                    int ctl, int l, unsigned int v)
 +
{
 +
    return 1;
 +
...
 +
}}
 +
 
 +
* {{ic|cd}} to {{ic|src/kernel/setup}} and edit {{ic|srcconf_linux.inc}}, search for {{ic|-Werror}} and remove it, otherwise OSS will not compile.
 +
* do {{ic|makepkg --noextract}}
 +
 
 +
Now you must install the package with {{ic|pacman -U}}. Remove OSS first if already installed.
 +
 
 +
=== ALSA emulation ===
 
You can instruct {{ic|alsa-lib}} to use OSS as its audio output system. This works as a sort of ALSA emulation.
 
You can instruct {{ic|alsa-lib}} to use OSS as its audio output system. This works as a sort of ALSA emulation.
  
Line 550: Line 519:
 
In the future, more complete methods may be available for emulating ALSA, such as {{ic|libsalsa}} and {{ic|cuckoo}}.
 
In the future, more complete methods may be available for emulating ALSA, such as {{ic|libsalsa}} and {{ic|cuckoo}}.
  
====Instructions====
+
==== Instructions ====
 
+
* Install the {{ic|alsa-plugins}} package.
+
  
# pacman -S alsa-plugins
+
* Install the {{ic|alsa-plugins}} package, available in the official repositories.
  
 
* Edit {{ic|/etc/asound.conf}} as follows.
 
* Edit {{ic|/etc/asound.conf}} as follows.
Line 578: Line 545:
 
  }
 
  }
  
{{Note | If you do not want to use OSS anymore, do not forget to revert changes that you do here in {{ic|/etc/asound.conf}}.}}
+
{{Note|If you do not want to use OSS anymore, do not forget to revert changes in {{ic|/etc/asound.conf}}.}}
  
===Settings for specific driver===
+
=== Settings for a specific driver ===
If something is not working, there is a possibility, that there are specific settings for specific driver (this way I have enabled jack-sense on my laptop)
+
If something is not working, there is a possibility that some of your OSS settings are driver specific or just wrong for your driver.
  
 +
To solve this:
 
* Find out which driver is used
 
* Find out which driver is used
  
{{hc|<nowiki>$ lspci -vnn | grep -i -A 15 audio</nowiki>|<nowiki>00:1e.2 Multimedia audio controller [0401]: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller [8086:266e] (rev 03)
+
{{hc|<nowiki>$ lspci -vnn | grep -i -A 15 audio</nowiki>|
Subsystem: Hewlett-Packard Company NX6110/NC6120 [103c:099c]
+
<nowiki>00:1e.2 Multimedia audio controller [0401]: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller [8086:266e] (rev 03)
Flags: bus master, medium devsel, latency 0, IRQ 21
+
Subsystem: Hewlett-Packard Company NX6110/NC6120 [103c:099c]
I/O ports at 2100 [size=256]
+
Flags: bus master, medium devsel, latency 0, IRQ 21
I/O ports at 2200 [size=64]
+
I/O ports at 2100 [size=256]
Memory at d0581000 (32-bit, non-prefetchable) [size=512]
+
I/O ports at 2200 [size=64]
Memory at d0582000 (32-bit, non-prefetchable) [size=256]
+
Memory at d0581000 (32-bit, non-prefetchable) [size=512]
Capabilities: <access denied>
+
Memory at d0582000 (32-bit, non-prefetchable) [size=256]
Kernel driver in use: *oss_ich*
+
Capabilities: <access denied>
Kernel modules: snd-intel8x0</nowiki>}}
+
Kernel driver in use: *oss_ich*
 +
Kernel modules: snd-intel8x0</nowiki>
 +
}}
  
 
* Locate configuration file for device in:
 
* Locate configuration file for device in:
 
+
# cd /usr/lib/oss/conf/
{{bc|# cd /usr/lib/oss/conf/}}
+
  
 
* Try changing defaults. There are only few settings, and they are self explanatory  
 
* Try changing defaults. There are only few settings, and they are self explanatory  
  
Setting:  
+
For example, the setting:  
 
  ich_jacksense = 1  
 
  ich_jacksense = 1  
in oss_ich.conf turned on jack-sense on my laptop (now plugged headphones are recognized, and speaker muted).
+
in {{ic|oss_ich.conf}} turns on {{ic|jack-sense}} (which is responsible for recognizing plugged headphones and muting the speaker). Other settings for {{ic|jack-sense}} can be found in {{ic|hdaudio.conf}} where you have to change the {{ic|hdaudio_jacksense}} variable.
  
*Restart oss for changes take effects.
+
* [[Daemon|Restart]] the '''oss''' daemon for changes take effects.
  
{{bc|# /etc/rc.d/oss restart}}
+
== Troubleshooting ==
  
* oss_hdaudio.conf has hdaudio_jacksens too. Maybe it will work for you. Unfortunately not for everyone.
+
=== Troubleshooting HD Audio devices ===
  
==Experimental packages==
+
==== Understanding the problem ====
 +
 +
If you have a HD Audio sound device, it is very likely that you will have to adjust some mixer settings before your sound works.
  
===Mercurial repository version===
+
HD Audio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time. These controls are exposed to the mixer, and they can be used, for example, to turn the earphone jack into a sound input jack instead of a sound output jack.
 +
 
 +
However, there are also bad side effects, mainly because the HD Audio standard is more flexible than it perhaps should be, and because the vendors often only care to get their ''official drivers'' working.
 +
 
 +
When using HD Audio devices, you often find disorganized mixer controls, that do not work at all by default, and you are forced to try every mixer control combination possible, until it works.
 +
 
 +
==== Solution ====
 +
 
 +
Open {{ic|ossxmix}} and try to change every mixer control in the '''middle area''', that contains the sound card specific controls, as explained in the [[OSS#Volume Control Mixer]] section.
 +
 
 +
You will probably want to setup a program to record/play continuously in the background (e.g. {{ic|<nowiki>ossrecord - | ossplay -</nowiki>}}  for recording or {{ic|osstest -lV}} for playing), while changing mixer settings in {{ic|ossxmix}} in the foreground.
 +
 
 +
* Raise every volume control slider.
 +
* In each option box, try to change the selected option, trying all the possible combinations.
 +
* If you get noise, try to lower and/or mute some volume controls, until you find the source of the noise.
 +
* Editing {{ic|/usr/lib/oss/conf/oss_hdaudio.conf}}, uncommenting and changing {{ic|1=hdaudio_noskip=0}} to a value from '''0-7''' can give you more jack options in {{ic|ossxmix}}.
 +
{{Note|If you modify this file, [[Daemon|restart]] the '''oss''' daemon for the changes to take effect.}}
 +
 
 +
=== MMS sound cracking in Totem ===
 +
If you hear various cracks or strange noises in Totem during playback, you can try using another backend such as [[FFmpeg]]. This will not fix the issue that somehow pops up in GStreamer when playing MMS streams but it will give you the option to play it with good sound quality. Playing it in MPlayer is simple:
 +
# mplayer mmsh://yourstreamurl
  
There is a [https://aur.archlinux.org/packages.php?ID=24719 oss-hg package] in AUR. This package compiles and installs the latest OSS development version direcly from the Mercurial repository.
+
=== Microphone playing through output channels ===
  
You can try this package if you want to contribute code to OSS or if only a very recent change in OSS code introduced support to your sound device.
+
By default, OSS plays back the microphone through the speakers. To disable this in {{ic|ossxmix}} find the ''Misc'' section and uncheck every {{ic|input-mix-mute}} box.
  
{{Note|This package installs the daemon start script to /etc/rc.d/'''oss4''' (not oss) so update your rc.conf}}
+
== See also ==
 +
* [http://www.opensound.com/ Official Website]
 +
* [http://www.opensound.com/wiki OSS Wiki]
 +
* [http://www.opensound.com/forum/index.php OSS Forum]
 +
* [http://www.opensound.com/developer/index.html Developer Information]
 +
* [http://opensound.hg.sourceforge.net/hgweb/opensound/opensound/summary Sourceforge Repository]

Revision as of 21:03, 11 January 2013

The Open Sound System (or OSS) is an alternative sound architecture for Unix-like and POSIX-compatible systems. OSS version 3 was the original sound system for Linux, but was superseded by the Advanced Linux Sound Architecture (or ALSA) in 2002 when OSS version 4 became proprietary software. OSSv4 became free software again in 2007 when 4Front Technologies released its source code and provided it under the GPL license.

Comparisons with ALSA

Some advantages and disadvantages compared to using the Advanced Linux Sound Architecture.

OSS Advantages (users)

  • Per-application volume control.
  • Some legacy cards have better support.
  • Lower latency. Initial response time in audio applications is usually better.

OSS Advantages (developers)

  • Support for drivers in userspace.
  • Cross-platform (OSS runs on BSDs and Solaris).
  • Cleaner and easier to use API.

ALSA advantages over OSS

  • Better support for USB audio devices.
  • Support for Bluetooth audio devices.
  • Support for AC'97 and HD Audio dial-up soft-modems such as Si3055.
  • Better support for MIDI devices.
  • Support for suspend.
  • Better support for jack detection.
Note:
  • OSS has experimental output support for USB audio devices, but no input.
  • OSS supports MIDI devices with the help of a software synthesizer such as Timidity or FluidSynth.

Install

Install oss from the official repositories.

There is also a development version of OSS available in the AUR with the oss-hgAUR package.

Note: oss-hgAUR does not yet have a systemd unit file, but you can use the one from oss. For this you need to copy it to /usr/lib/systemd/system/oss4.service.

This will install the OSS, run the OSS install script (temporarily disabling the ALSA modules) and install the OSS kernel modules. Since ALSA is enabled by default in the boot scripts, you need to disable it so it does not conflict with OSS. You can do this by blacklisting the module:

/etc/modprobe.d/alsa_blacklist.conf
install soundcore /bin/false

After blacklisting the module, you can enable the oss (or oss4 if using the development version) daemon to start at boot.

In case you are not part of the audio group, add yourself and relogin for the changes to take effect:

# gpasswd -a $USER audio

In case OSS is not able to detect your card when starting it, run:

# ossdetect -v
# soundoff && soundon

Testing

Warning: The default volume is very loud, avoid using earphones and physically lower the volume of your speakers (if possible) before running the test.

Test OSS by running:

$ osstest

You should be able to hear music during the test process. If there is no audio, try to adjust the volume or refer to the #Troubleshooting section.

If you want to hear sounds from more than one application simultaneously, you need vmix, OSS's software mixer.

Check that vmix is enabled by running:

$ ossmix -a | grep -i vmix

You should see a line like vmix0-enable ON|OFF (currently ON). If you do not see any lines beginning with vmix, it probably means that vmix has not been attached to your sound device. To attach vmix, issue the command:

$ vmixctl attach device

where device is your sound device, e.g. /dev/oss/oss_envy240/pcm0.

To avoid having to issue this command manually in the future, you can add it to /usr/lib/oss/soundon.user, as suggested here.

If you get a "Device or resource busy" error, you need to add vmix_no_autoattach=1 to /usr/lib/oss/conf/osscore.conf and then reboot.

See which devices are detected by running:

$ ossinfo

You should be able to see your devices listed under Device Objects or Audio Devices. If the device that you want to use is not at the top of one of these sections, you have to edit /usr/lib/oss/etc/installed_drivers and place the driver for your device at the very top. It may be required to do a:

$ soundoff && soundon

If this does not work, comment all drivers listed except the ones for your device.

Volume Control Mixer

To control the volume of various devices, mixers levels will need to be set. There are two mixers:

  • ossmix: a command-line mixer, similar to the BSD audio mixer mixerctl.
  • ossxmix: a GTK+-based graphical mixer.

The basic ossxmix controls look like:

 / High Definition Audio ALC262 \    --------------------------------> 1
/________________________________\________________________________
|                                                                 \
| [x] vmix0-enable [vmix0-rate: 48.000kHz]      vmix0-channels    |--> 2
|                                               [ Stereo [v] ]    |
|                                                                 |
|  __codec1______________________________________________________ |
| |  _jack______________________________________________________ ||--> 3
| | |  _int-speaker_________________   _green_________________  |||
| | | |                             | |                       | |||
| | | |  _mode_____ | |             | |  _mode_____   | |     | |||
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix  [v] ]  o o [x] | |||
| | | |             | |             | |               | |     | |||
| | | |_____________________________| |_______________________| |||
| | |___________________________________________________________|||
| |______________________________________________________________||
| ___vmix0______________________________________________________  |
| |  __mocp___  O O   _firefox_  O O  __pcm7___  O O            | |--> 4
| | |         | O O  |         | x x |         | O O            | |
| | | | |     | x O  | | |     | x x | | |     | O O            | |
| | | o o [x] | x x  | o o [x] | x x | o o [x] | O O            | |
| | | | |     | x x  | | |     | x x | | |     | O O            | |
| | |_________| x x  |_________| x x |_________| O O            | |
| |_____________________________________________________________| |
|_________________________________________________________________|
  1. One tab for each sound card
  2. The vmix (virtual mixer) special configurations appear at the top. These include sampling rate and mixer priority.
  3. These are your sound card jack configurations (input and output). Every mixer control that is shown here is provided by your sound card.
  4. Application vmix mixer controls and sound meters. If the application is not actively playing a sound it will be labeled as pcm08, pcm09... and when the application is playing the application name will be shown.

Color Definitions

For high definition (HD) audio, ossxmix will color jack configurations by their pre-defined jack colors:

Color Type Connector
green front channels (stereo output) 3.5mm TRS
black rear channels (stereo output) 3.5mm TRS
grey side channels (stereo output) 3.5mm TRS
gold center and subwoofer (dual output) 3.5mm TRS
blue line level (stereo input) 3.5mm TRS
pink microphone (mono input) 3.5mm TS

Saving Mixer Levels

Mixer levels are saved when you shut off your computer. If you want to save the mixer level immediately, execute as root:

# savemixer

savemixer can be used to write mixer levels to a file with the -f switch and restore by the -L switch.

Other Mixers

Other mixers that have support for OSS:

  • Gnome Volume Control — for GNOME.
http://library.gnome.org/users/gnome-volume-control/stable/ || gnome
  • Kmix — for KDE.
http://www.kde.org/applications/multimedia/kmix/ || kdemultimedia-kmix
  • VolWheel — for LXDE.
http://oliwer.net/b/volwheel.html || volwheel

After installing VolWheel, you will need to do the following to enable OSS support:

  • add it to the LXDE autostart file:
 echo "volwheel" >> ~/.config/lxsession/LXDE/autostart
  • right click on the system tray icon, choose the Preferences item and then change:
    • Driver: OSS.
    • Default Channel: vmix0-outvol (find out what channel to use from ossmix).
    • Default Mixer: ossxmix.
    • In the MiniMixer tab (optional), add vmix0-outvol and optionally others.

Configuring Applications for OSS

Applications that use GStreamer

If you have problems with applications that use Gstreamer for audio, you can try removing pulseaudio and installing the gstreamer0.10-good-plugins package which is needed by oss4sink and oss4src.

Then you have to change the GStreamer settings to output the sound to OSS instead of the default ALSA with gstreamer-properties (part of the gnome-media package). After starting gstreamer-properties, you have to modify the fields as follows:

  • in the Default Output section: if OSS is not available as a plugin, change Plugin to Custom and Pipeline to oss4sink.
  • in the Default Input section: if OSS is not available, change Plugin to Custom and Pipeline to oss4src.
Note: You can also use osssrc as an alternative to oss4src if you find that it produces better sound.

Some applications (e.g. Rhythmbox, Totem) do not read the settings set by gstreamer-properties, as they rely on musicaudiosink instead of audiosink (which is modified by gstreamer-properties).

To work around this, you can set the values for audiosink with gstreamer-properties and use gconf-editor to copy the value of /system/gstreamer/0.10/default/audiosink to musicaudiosink (at the same location).

If you are using Phonon with the GStreamer backend you will need to set a environmental variable:

export PHONON_GST_AUDIOSINK=oss4sink

You can add this to your ~/.bashrc to be loaded on login.

Audacity

If Audacity starts, but it complains that it cannot open the device or simply does not play anything, then you may be using vmix which prevents Audacity from having exclusive access to your sound device. To fix this, before running Audacity, run:

$ ossmix vmix0-enable OFF

You can restore vmix after closing Audacity with:

$ ossmix vmix0-enable ON

Gajim

By default, Gajim uses aplay -q to play a sound. For OSS you can change it to the equivalent ossplay -qq by going to Edit > Preferences > Advanced, opening the Advanced Configuration Editor and modifying the soundplayer variable accordingly.

MOC

To use MOC with OSS v4.1 you must change OSSMixerDevice to /dev/ossmix in your configuration file (located in ~/.moc). For issues with the interface try changing the OSSMixerChannel by pressing Template:Keypress in mocp (to change to the sofware mixer).

MPD

MPD is configured through /etc/mpd.conf or ~/.mpdconf. Check both of these files, looking for something that looks like:

/etc/mpd.conf
...
audio_output {
    type    "alsa"
    name    "Some Device Name"
}
...

If you find an uncommented (the lines do not begin with #'s) ALSA configuration like the one above, comment all of it out, or delete it, and add the following:

/etc/mpd.conf
...
audio_output {
    type    "oss"
    name    "My OSS Device"
}
...

Further configuration might not be necessary for all users. However, if you experience issues (in that MPD does not work properly after it has been restarted), or if you like having specific (i.e. more user-configured, less auto-configured) configuration files, the audio output for OSS can be more specifically configured as follows:

  • First, run:
$ ossinfo | grep /dev/dsp
  • Look for the line that says something similar to /dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0. Take note of what your <SOME_CARD_IDENTIFIER> is, and add these lines to your OSS audio_output in your MPD configuration file:
/etc/mpd.conf
...
audio_output {
    type            "oss"
    name            "My OSS Device"
    device          "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"
    mixer_device    "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"
}
...

See also: Music Player Daemon#Global Configuration.

MPlayer

If you are using a GUI (SMplayer, GNOME MPlayer, etc.) you can select OSS as the default output in the settings dialogs. If you use MPlayer from the command-line, you should specify the sound output:

$ mplayer -ao oss /some/file/to/play.mkv

If you do not want to bother typing it over and over again add ao=oss to your configuration file (at ~/.mplayer/config).

See also: Mplayer#Configuration.

Skype

The skype package only includes support for ALSA. To get an OSS-capable Skype, install the bin32-skype-oss package from the AUR.

See also: Skype#Skype-OSS Sound (Pre-2.0).

VLC media player

You can select OSS as the default output in the audio settings.

Wine

To set OSS support in Wine start:

$ winecfg

and go to the Audio tab and select the OSS Driver.

See also: Wine#Sound.

Other applications

  • If you can not get sound from an application not listed here, try looking at the Configuring Applications for OSSv4 page.
  • Search for OSS specific packages by using pacman -Ss -- -oss or by looking in the AUR.

Tips and tricks

Using multimedia keys with OSS

An easy way to mute/unmute and increase/decrease the volume is to use the ossvolAUR script, available in the AUR. For more information about the script see this article on the OSS wiki.

Once you installed it, type:

$ ossvol -t

to toggle mute, or:

$ ossvol -h

to see the available commands.

Note: If ossvol gives an error like Bad mixer control name(987) 'vol', you need to edit the /usr/bin/ossvol script and change the CHANNEL variable to your default channel (usually vmix0-outvol).

If you want to use multimedia keys with ossvol, see Extra Keyboard Keys and make sure they are properly configured. After that you can use, for example, Xbindkeys to bind them to the ossvol script. Add the following to your ~/.xbindkeysrc file:

~/.xbindkeysrc
# Toggle mute
"ossvol -t"
    m:0x0 + c:121
    XF86AudioMute

# Lower volume
"ossvol -d 2"
    m:0x0 + c:122
    XF86AudioLowerVolume

# Raise volume
"ossvol -i 2"
    m:0x0 + c:123
    XF86AudioRaiseVolume

and optionally change the multimedia keys with whatever shortcuts you prefer.

Changing the Sample Rate

Changing the output sample rate is not obvious at first. Sample rates can only be changed by root and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, do not bother changing anything here as you will not notice a difference.

By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed, that you will have a loss in audio quality. This is most noticeable in down sampling (ie. 96000hz → 48000hz). There is an article about this issue in Stereophile which was discussed on Apple's CoreAudio API mailing list if you wish to learn more about this issue.

Some example sample rates:

44100hz
Sample rate of standard Red Book audio CDs.
88000hz
Sample rate of SACD high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.
96000hz
Sample rate of most high definition audio downloads. If your motherboard is an AC'97 motherboard, this is likely to be your highest bitrate.
192000hz
Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio receiver equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes HD Audio.

To check what your sample rate is currently set to, run:

ossmix | grep rate

You are likely to see vmix0-rate <decimal value> (currently 48000) (Read-only).

If you do not see a vmix0-rate (or vmix1-rate, etc.) being outputted, then it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section does not apply. Exception to this are Envy24 (and Envy24HT) cards that have a special setting envy24.rate which has a similar function (see the oss_envy24 manpage).

To change your sample rate:

  1. First, make sure your card is able to use the new rate. Run ossinfo -v2 and see if the wanted rate is in the Native sample rates output.
  2. As root, run /usr/lib/oss/scripts/killprocs.sh. Be aware, this will close any program that currently has an open sound channel.
  3. After all programs occupying vmix are terminated, run as root: vmixctl rate /dev/dsp 96000 replacing the rate with your desired sample rate (and ossmix envy24.rate 96000 if applicable).
  4. Run ossmix | grep rate and check for vmix0-rate <decimal value> (currently 96000) (Read-only) to see if you were successful.
  5. To make the changes permanent add the following to the soundon.user file:
/usr/lib/oss/soundon.user
#!/bin/sh

vmixctl rate /dev/dsp 96000
# ossmix envy24.rate 96000 # uncomment if you have an Envy24(HT) card

exit 0

and make it executable:

# chmod +x /usr/lib/oss/soundon.user

A simple system tray applet

For those wanting a very lightweight OSS system tray applet see this one.

To install it:

  • Download the script with whatever name you want (e.g. ossvolctl)
  • Make it executable:
$ chmod +x ossvolctl
  • And copy it to your /usr/bin:
# cp ossvolctl /usr/bin/ossvolctl

or:

# install -Dm755 ossvolctl /usr/bin/ossvolctl

Start ossxmix docked to the system tray on startup

KDE

Create an application launcher file named ossxmix.desktop in you local application launchers directory (~/.local/share/applications/ with:

~/.local/share/applications/ossxmix.desktop
[Desktop Entry]
Name=Open Sound System Mixer
GenericName=Audio Mixer
Exec=ossxmix -b
Icon=audio-card
Categories=Application;GTK;AudioVideo;Player;
Terminal=false
Type=Application
Encoding=UTF-8

To have it autostart with your system, add it to the list in System Settings > System Administration > Startup and Shutdown > Autostart.

Gnome

As root create a file /usr/local/bin/ossxmix_bg with the following content:

/usr/local/bin/ossxmix_bg
#!/bin/sh

exec /usr/bin/ossxmix -b

Then go to System > Preferences > Start Up Applications and:

  • Click Add, type OSSMIX in the Name field and /usr/local/bin/ossxmix_bg in Command field then click Add Button.
  • Login and logout to see the changes.

Record sound output from a program

Suspend and Hibernation

OSS does not automatically support suspend, it must be manually stopped prior to suspending or hibernating and restarted afterwards.

OSS provides soundon and soundoff to enable and disable OSS, although they only stop OSS if all processes that use sound are terminated first.

The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.

/etc/pm/sleep.d/50osssound
#!/bin/sh
. "${PM_FUNCTIONS}"
 
suspend_osssound()
{
    /usr/lib/oss/scripts/killprocs.sh
    /usr/sbin/soundoff
}
 
resume_osssound()
{
    /usr/sbin/soundon
}
 
case "$1" in
    hibernate

Save the contents of this script (as root) into /etc/pm/sleep.d/50osssound and make it executable:

chmod a+x /etc/pm/sleep.d/50osssound
Warning: This script is rather basic and will terminate any application directly accessing OSS. Save your work prior to suspending/hibernating.

An alternative would be to use s2ram for suspending. Just create a suspend script to /sbin/suspend and make it executable.

 #!/bin/sh

 ## Checking if you are a root or not
 if ! [ -w / ]; then
   echo >&2 "This script must be run as root"
   exit 1
 fi

 s2ram -f

 sleep 2

 /etc/rc.d/oss restart 2>/tmp/oss.txt || echo "OSS restart failed, check /tmp/oss.txt for information"

With this, all your apps should be fine.

Note: If you are using Opera you must kill operapluginwrapper before suspend. To do this add pid=$(pidof operapluginwrapper) && kill $pid before s2ram -f.

Changing the Default Sound Output

When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it is set to the wrong output.

*** 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 47991.00 Hz (-0.02%)> 

The left sounded good, the right and stereo were the distorted ones.

Let the test continue until you get a working output:

/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 47991.00 Hz (-0.02%)> 

If this passed the test on all left, right and stereo, proceed to next step.

For the command to change the default output see this OSS wiki article. Change it to what works for you, for example:

# ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich

For surround sound (4.0-7.1) choose dsp_multich, for only 2 channels, dsp is sufficient. See this for all available devices.

Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB

This information is taken from the 4front-tech forum.

It is surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.

To fix this, a recompile of OSS is necessary, for now.

  • Grab the latest OSS from the Arch Repo
https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/oss
  • Extract it
  • cd into the folder
  • run makepkg --nobuild
  • cd to src/kernel/drv/oss_usb/ and edit ossusb_audio.c: add a return 1;.
    • should look like so:
ossusb_audio.c
static int
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,
                     int ctl, int l, unsigned int v)
{
     return 1;
...
  • cd to src/kernel/setup and edit srcconf_linux.inc, search for -Werror and remove it, otherwise OSS will not compile.
  • do makepkg --noextract

Now you must install the package with pacman -U. Remove OSS first if already installed.

ALSA emulation

You can instruct alsa-lib to use OSS as its audio output system. This works as a sort of ALSA emulation.

Note, however, that this method may introduce additional latency in your sound output, and that the emulation is not complete and does not work with all applications. It does not work, for example, with programs that try to detect devices using ALSA.

So, as most applications support OSS directly, use this method only as a last resort.

In the future, more complete methods may be available for emulating ALSA, such as libsalsa and cuckoo.

Instructions

  • Install the alsa-plugins package, available in the official repositories.
  • Edit /etc/asound.conf as follows.
pcm.oss {
   type oss
    device /dev/dsp
}

pcm.!default {
    type oss
    device /dev/dsp
}

ctl.oss {
    type oss
    device /dev/mixer
}

ctl.!default {
    type oss
    device /dev/mixer
}
Note: If you do not want to use OSS anymore, do not forget to revert changes in /etc/asound.conf.

Settings for a specific driver

If something is not working, there is a possibility that some of your OSS settings are driver specific or just wrong for your driver.

To solve this:

  • Find out which driver is used
$ lspci -vnn | grep -i -A 15 audio
00:1e.2 Multimedia audio controller [0401]: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller [8086:266e] (rev 03)
Subsystem: Hewlett-Packard Company NX6110/NC6120 [103c:099c]
Flags: bus master, medium devsel, latency 0, IRQ 21
I/O ports at 2100 [size=256]
I/O ports at 2200 [size=64]
Memory at d0581000 (32-bit, non-prefetchable) [size=512]
Memory at d0582000 (32-bit, non-prefetchable) [size=256]
Capabilities: <access denied>
Kernel driver in use: *oss_ich*
Kernel modules: snd-intel8x0
  • Locate configuration file for device in:
# cd /usr/lib/oss/conf/
  • Try changing defaults. There are only few settings, and they are self explanatory

For example, the setting:

ich_jacksense = 1 

in oss_ich.conf turns on jack-sense (which is responsible for recognizing plugged headphones and muting the speaker). Other settings for jack-sense can be found in hdaudio.conf where you have to change the hdaudio_jacksense variable.

  • Restart the oss daemon for changes take effects.

Troubleshooting

Troubleshooting HD Audio devices

Understanding the problem

If you have a HD Audio sound device, it is very likely that you will have to adjust some mixer settings before your sound works.

HD Audio devices are very powerful in the sense that they can contain a lot of small circuits (called widgets) that can be adjusted by software at any time. These controls are exposed to the mixer, and they can be used, for example, to turn the earphone jack into a sound input jack instead of a sound output jack.

However, there are also bad side effects, mainly because the HD Audio standard is more flexible than it perhaps should be, and because the vendors often only care to get their official drivers working.

When using HD Audio devices, you often find disorganized mixer controls, that do not work at all by default, and you are forced to try every mixer control combination possible, until it works.

Solution

Open ossxmix and try to change every mixer control in the middle area, that contains the sound card specific controls, as explained in the OSS#Volume Control Mixer section.

You will probably want to setup a program to record/play continuously in the background (e.g. ossrecord - | ossplay - for recording or osstest -lV for playing), while changing mixer settings in ossxmix in the foreground.

  • Raise every volume control slider.
  • In each option box, try to change the selected option, trying all the possible combinations.
  • If you get noise, try to lower and/or mute some volume controls, until you find the source of the noise.
  • Editing /usr/lib/oss/conf/oss_hdaudio.conf, uncommenting and changing hdaudio_noskip=0 to a value from 0-7 can give you more jack options in ossxmix.
Note: If you modify this file, restart the oss daemon for the changes to take effect.

MMS sound cracking in Totem

If you hear various cracks or strange noises in Totem during playback, you can try using another backend such as FFmpeg. This will not fix the issue that somehow pops up in GStreamer when playing MMS streams but it will give you the option to play it with good sound quality. Playing it in MPlayer is simple:

# mplayer mmsh://yourstreamurl

Microphone playing through output channels

By default, OSS plays back the microphone through the speakers. To disable this in ossxmix find the Misc section and uncheck every input-mix-mute box.

See also