Documentation/sound/designs/oss-emulation.rst

Source file repositories/reference/linux-study-clean/Documentation/sound/designs/oss-emulation.rst

File Facts

System
Linux kernel
Corpus path
Documentation/sound/designs/oss-emulation.rst
Extension
.rst
Size
10759 bytes
Lines
337
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

=============================
Notes on Kernel OSS-Emulation
=============================

Jan. 22, 2004  Takashi Iwai <tiwai@suse.de>


Modules
=======

ALSA provides a powerful OSS emulation on the kernel.
The OSS emulation for PCM, mixer and sequencer devices is implemented
as add-on kernel modules, snd-pcm-oss, snd-mixer-oss and snd-seq-oss.
When you need to access the OSS PCM, mixer or sequencer devices, the
corresponding module has to be loaded.

These modules are loaded automatically when the corresponding service
is called.  The alias is defined ``sound-service-x-y``, where x and y are
the card number and the minor unit number.  Usually you don't have to
define these aliases by yourself.

Only necessary step for auto-loading of OSS modules is to define the
card alias in ``/etc/modprobe.d/alsa.conf``, such as::

	alias sound-slot-0 snd-emu10k1

As the second card, define ``sound-slot-1`` as well.
Note that you can't use the aliased name as the target name (i.e.
``alias sound-slot-0 snd-card-0`` doesn't work any more like the old
modutils).

The currently available OSS configuration is shown in
/proc/asound/oss/sndstat.  This shows in the same syntax of
/dev/sndstat, which is available on the commercial OSS driver.
On ALSA, you can symlink /dev/sndstat to this proc file.

Please note that the devices listed in this proc file appear only
after the corresponding OSS-emulation module is loaded.  Don't worry
even if "NOT ENABLED IN CONFIG" is shown in it.


Device Mapping
==============

ALSA supports the following OSS device files:
::

	PCM:
		/dev/dspX
		/dev/adspX

	Mixer:
		/dev/mixerX

	MIDI:
		/dev/midi0X
		/dev/amidi0X

	Sequencer:
		/dev/sequencer
		/dev/sequencer2 (aka /dev/music)

where X is the card number from 0 to 7.

(NOTE: Some distributions have the device files like /dev/midi0 and
/dev/midi1.  They are NOT for OSS but for tclmidi, which is
a totally different thing.)

Unlike the real OSS, ALSA cannot use the device files more than the
assigned ones.  For example, the first card cannot use /dev/dsp1 or

Annotation

Implementation Notes