https://www.funtoo.org/api.php?action=feedcontributions&user=Dmshelton&feedformat=atomFuntoo - User contributions [en]2024-03-28T14:17:48ZUser contributionsMediaWiki 1.36.2https://www.funtoo.org/index.php?title=Package:Open_Sound_System_(OSS)&diff=43363Package:Open Sound System (OSS)2023-12-20T22:04:46Z<p>Dmshelton: </p>
<hr />
<div>{{Ebuild<br />
|Summary=A portable, mixing-capable, high quality sound system for Unix.<br />
|CatPkg=media-sound/oss<br />
|Maintainer=<br />
|Homepage=http://www.opensound.com/oss.html<br />
}}<br />
__toc__<br />
The [[Wikipedia:Open Sound System|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 [http://www.alsa-project.org Advanced Linux Sound Architecture] (or '''ALSA''') in 2002 when OSS version 4 became proprietary software. OSSv4 became free software again in 2007 when [http://www.opensound.com/ 4Front Technologies] released its source code and provided it under the GPL license.<br />
<br />
== Installation ==<br />
=== Configuring the kernel ===<br />
{{kernelop|title=Device Drivers|desc=<br />
<M> Sound card support ---><br />
--- Sound card support<br />
[ ] Preclaim OSS device numbers<br />
<M> Advanced Linux Sound Architecture ---><br />
< > Open Sound System (DEPRECATED) ---<br />
}}<br />
{{fancynote|Don't confuse the deprecated OSS module (OSSv3) module with todays OSSv4.}}<br />
<br />
=== Preparation ===<br />
The first task is to to make sure that you build OSS with the correct soundcard drivers. To specify them, you can use the <code>OSS_CARDS</code> setting in <code>make.conf</code>.<br />
<br />
E.g. for an HD Audio card use:<br />
{{file|name=/etc/make.conf| file|body=<br />
OSS_CARDS="hd_audio"<br />
}}<br />
You can visit the [http://manuals.opensound.com/usersguide/ OSS documentation] for a driver reference.<br />
<br />
{{fancyimportant|Make sure that your ''current'' kernel sources directory are symlinked to <code>/usr/src/linux</code>, since the OSS compilation relies on the kernel headers. You can use '''eselect kernel''' to verify or set your kernel. See [[eselect#kernel]] for a reference guide.}}<br />
<br />
=== Install ===<br />
Now build the OSS modules and add <code>/etc/init.d/oss</code> to the default runlevel:<br />
<console><br />
# ##i##emerge oss<br />
# ##i##rc-update add oss default<br />
</console><br />
<br />
== Basic Configuration ==<br />
=== USE Flags ===<br />
To compile Applications with OSS support you need to set the <code>oss</code> USE flag, however you will mostly want the <code>alsa</code> flag there too as a fallback (OSS will create ALSA devices for those applications):<br />
{{file|name=/etc/make.conf| file|body=<br />
USE="oss alsa"<br />
}}<br />
{{fancytip|See how to set up an [[#ALSA_emulation| ALSA emulation]] for unsupported Applications below.}}<br />
<br />
=== Configuring Applications for OSS ===<br />
Since ALSA is the mostly default configuration for application, you might sometimes need to configure them properly before OSS output/input works.<br />
<br />
There are two good resources which guide you through the steps for most applications:<br />
*[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 ArchWiki]<br />
*[https://wiki.archlinux.org/index.php/Open_Sound_System#Configuring_Applications_for_OSS OpenSound Wiki]<br />
<br />
== ALSA emulation ==<br />
You can instruct <code>alsa-lib</code> to use OSS as its audio output system. This works as a sort of ALSA emulation.<br />
<br />
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.<br />
<br />
So, as most applications support OSS directly, use this method only as a last resort.<br />
<br />
In the future, more complete methods may be available for emulating ALSA, such as <code>libsalsa</code> and <code>cuckoo</code>. See [http://www.4front-tech.com/wiki/index.php/Tips_And_Tricks#ALSA_Emulation].<br />
<br />
==== Instructions ====<br />
<br />
* Install the <code>alsa-plugins</code> package, available in the Funtoo Overlay.<br />
<br />
* Creare and edit <code>/etc/asound.conf</code> as follows:<br />
{{file|name=/etc/asound.conf|body=<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
}}<br />
<br />
{{fancynote|Do not forget to revert the changes after uninstalling.}}<br />
<br />
== Volume Control Mixer ==<br />
To control the volume of various devices, mixers levels will need to be set. There are two mixers:<br />
* '''ossmix''': a command-line mixer, similar to the BSD audio mixer <code>mixerctl</code>. <br />
* '''ossxmix''': a GTK+-based graphical mixer.<br />
<br />
The basic <code>ossxmix</code> controls look like:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# One tab for each sound card<br />
# The <code>vmix</code> (virtual mixer) special configurations appear at the top. These include sampling rate and mixer priority.<br />
# These are your sound card jack configurations (input and output). Every mixer control that is shown here is provided by your sound card.<br />
# Application <code>vmix</code> mixer controls and sound meters. If the application is not actively playing a sound it will be labeled as <code>pcm08</code>, <code>pcm09</code>... and when the application is playing the application name will be shown.<br />
<br />
=== Color Definitions ===<br />
For high definition (HD) audio, <code>ossxmix</code> will color jack configurations by their pre-defined jack colors:<br />
<br />
{| class="wikitable"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style="color:black;background:lightgreen"<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style="color:white;background:black"<br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style="color:white;background:gray"<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style="color:black;background:gold"<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style="color:black;background:lightblue"<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style="color:black;background:pink"<br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
=== Saving Mixer Levels ===<br />
Mixer levels are saved when you shut off your computer. If you want to save the mixer level immediately, execute:<br />
<console># ##i##savemixer</console><br />
<br />
<code>savemixer</code> can be used to write mixer levels to a file with the <code>-f</code> switch and restore by the <code>-L</code> switch.<br />
<br />
=== Other Mixers ===<br />
Other mixers that have support for OSS:<br />
* '''Gnome Volume Control''' - for [[GNOME_First_Steps| GNOME]].<br />
* '''Kmix''' - for [[KDE]].<br />
* '''VolWheel''' - After the installation, set it to autostart as needed, then enable OSS support by right-clicking on the system tray icon, choosing ''Preferences'' and then changing:<br />
:* ''Driver'': <code>OSS</code>.<br />
:* ''Default Channel'': <code>vmix0-outvol</code> (find out what channel to use with <code>ossmix</code>).<br />
:* ''Default Mixer'': <code>ossxmix</code>.<br />
:* In the ''MiniMixer'' tab (optional), add <code>vmix0-outvol</code> and optionally others.<br />
<br />
== Suspend & Hibernation ==<br />
<br />
OSS does not automatically support suspend, it must be manually stopped prior to suspending or hibernating and restarted afterwards.<br />
<br />
OSS provides <code>soundon</code> and <code>soundoff</code> to enable and disable OSS, although they only stop OSS if all processes that use sound are terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards:<br />
{{file|name=/etc/pm/sleep.d/50osssound|body=<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate<nowiki>|</nowiki>suspend)<br />
suspend_osssound<br />
;;<br />
thaw<nowiki>|</nowiki>resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
}}<br />
<br />
Save the contents of this script (as root) into <code>/etc/pm/sleep.d/50osssound</code> and make it executable:<br />
<console># ##i##chmod a+x /etc/pm/sleep.d/50osssound</console><br />
<br />
{{fancywarning|This script is rather basic and will terminate any application directly accessing OSS. Save your work prior to suspending/hibernating.}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Troubleshooting HD Audio devices ===<br />
<br />
==== Understanding the problem ====<br />
<br />
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.<br />
<br />
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.<br />
<br />
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.<br />
<br />
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.<br />
<br />
==== Solution ====<br />
<br />
Open <code>ossxmix</code> and try to change every mixer control in the '''middle area''', that contains the sound card specific controls, as explained in the [[#Volume Control Mixer]] section.<br />
<br />
You will probably want to setup a program to record/play continuously in the background (e.g. <code>ossrecord - | ossplay -</code> for recording or <code>osstest -lV</code> for playing), while changing mixer settings in <code>ssxmix</code> in the foreground.<br />
<br />
* Raise every volume control slider.<br />
* In each option box, try to change the selected option, trying all the possible combinations.<br />
* If you get noise, try to lower and/or mute some volume controls, until you find the source of the noise.<br />
* Editing <code>/usr/lib/oss/conf/oss_hdaudio.conf</code>, uncommenting and changing <code>1=hdaudio_noskip=0</code> to a value from '''0-7''' can give you more jack options in <code>ossxmix</code>.<br />
{{fancynote|If you modify this file, restart the '''oss''' service for the changes to take effect.}}<br />
<br />
== See also ==<br />
* [http://www.opensound.com/ Official Website]<br />
* [http://www.opensound.com/wiki OSS Wiki]<br />
* [http://www.opensound.com/forum/index.php OSS Forum]<br />
* [http://www.opensound.com/developer/index.html Developer Information]<br />
* [http://sourceforge.net/p/opensound/git/ Git repository]<br />
* [http://sourceforge.net/p/opensound/mailman/opensound-devel/ opensound-devel mailing list]<br />
{{EbuildFooter}}</div>Dmsheltonhttps://www.funtoo.org/index.php?title=User:Dmshelton&diff=2376User:Dmshelton2012-11-19T00:45:34Z<p>Dmshelton: Created page with "{{Person |Full name=Darren Shelton |Email=dmshelton@gmail.com |Nick=dmshelton |Geoloc=32.735687, -97.1080656 |Location name=Arlingon, Texas, United States of America |Roles={{..."</p>
<hr />
<div>{{Person<br />
|Full name=Darren Shelton<br />
|Email=dmshelton@gmail.com<br />
|Nick=dmshelton<br />
|Geoloc=32.735687, -97.1080656<br />
|Location name=Arlingon, Texas, United States of America<br />
|Roles={{Role<br />
|Role type=User<br />
|Role desc=None<br />
|Start date=2009/01/01<br />
}}<br />
|Maintains=<br />
|Blogs=<br />
}}</div>Dmshelton