sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget//translations/zh_CN/sound/designs/oss-emulationmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/zh_TW/sound/designs/oss-emulationmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/it_IT/sound/designs/oss-emulationmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/ja_JP/sound/designs/oss-emulationmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/ko_KR/sound/designs/oss-emulationmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/sp_SP/sound/designs/oss-emulationmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hNotes on Kernel OSS-Emulationh]hNotes on Kernel OSS-Emulation}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhI/var/lib/git/docbuild/linux/Documentation/sound/designs/oss-emulation.rsthKubh paragraph)}(h+Jan. 22, 2004 Takashi Iwai h](hJan. 22, 2004 Takashi Iwai <}(hhhhhNhNubh reference)}(h tiwai@suse.deh]h tiwai@suse.de}(hhhhhNhNubah}(h]h ]h"]h$]h&]refurimailto:tiwai@suse.deuh1hhhubh>}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(hModulesh]hModules}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh)}(hX-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.h]hX-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.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hThese 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.h](hgThese modules are loaded automatically when the corresponding service is called. The alias is defined }(hhhhhNhNubhliteral)}(h``sound-service-x-y``h]hsound-service-x-y}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhubh}, where x and y are the card number and the minor unit number. Usually you don’t have to define these aliases by yourself.}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h{Only necessary step for auto-loading of OSS modules is to define the card alias in ``/etc/modprobe.d/alsa.conf``, such as::h](hSOnly necessary step for auto-loading of OSS modules is to define the card alias in }(hjhhhNhNubj)}(h``/etc/modprobe.d/alsa.conf``h]h/etc/modprobe.d/alsa.conf}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh , such as:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh literal_block)}(halias sound-slot-0 snd-emu10k1h]halias sound-slot-0 snd-emu10k1}hj@sbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1j>hhhKhhhhubh)}(hAs 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).h](hAs the second card, define }(hjPhhhNhNubj)}(h``sound-slot-1``h]h sound-slot-1}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjPubhN as well. Note that you can’t use the aliased name as the target name (i.e. }(hjPhhhNhNubj)}(h!``alias sound-slot-0 snd-card-0``h]halias sound-slot-0 snd-card-0}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjPubh0 doesn’t work any more like the old modutils).}(hjPhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThe 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.h]hThe 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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hPlease 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.h]hPlease 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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK%hhhhubeh}(h]modulesah ]h"]modulesah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hDevice Mappingh]hDevice Mapping}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK+ubh)}(h0ALSA supports the following OSS device files: ::h]h-ALSA supports the following OSS device files:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hjhhubj?)}(hPCM: /dev/dspX /dev/adspX Mixer: /dev/mixerX MIDI: /dev/midi0X /dev/amidi0X Sequencer: /dev/sequencer /dev/sequencer2 (aka /dev/music)h]hPCM: /dev/dspX /dev/adspX Mixer: /dev/mixerX MIDI: /dev/midi0X /dev/amidi0X Sequencer: /dev/sequencer /dev/sequencer2 (aka /dev/music)}hjsbah}(h]h ]h"]h$]h&]jNjOuh1j>hhhK0hjhhubh)}(h'where X is the card number from 0 to 7.h]h'where X is the card number from 0 to 7.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hjhhubh)}(h(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.)h]h(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.)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjhhubh)}(hUnlike the real OSS, ALSA cannot use the device files more than the assigned ones. For example, the first card cannot use /dev/dsp1 or /dev/dsp2, but only /dev/dsp0 and /dev/adsp0.h]hUnlike the real OSS, ALSA cannot use the device files more than the assigned ones. For example, the first card cannot use /dev/dsp1 or /dev/dsp2, but only /dev/dsp0 and /dev/adsp0.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhjhhubh)}(hAs seen above, PCM and MIDI may have two devices. Usually, the first PCM device (``hw:0,0`` in ALSA) is mapped to /dev/dsp and the secondary device (``hw:0,1``) to /dev/adsp (if available). For MIDI, /dev/midi and /dev/amidi, respectively.h](hRAs seen above, PCM and MIDI may have two devices. Usually, the first PCM device (}(hjhhhNhNubj)}(h ``hw:0,0``h]hhw:0,0}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh: in ALSA) is mapped to /dev/dsp and the secondary device (}(hjhhhNhNubj)}(h ``hw:0,1``h]hhw:0,1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhQ) to /dev/adsp (if available). For MIDI, /dev/midi and /dev/amidi, respectively.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKIhjhhubh)}(hYou can change this device mapping via the module options of snd-pcm-oss and snd-rawmidi. In the case of PCM, the following options are available for snd-pcm-oss:h]hYou can change this device mapping via the module options of snd-pcm-oss and snd-rawmidi. In the case of PCM, the following options are available for snd-pcm-oss:}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhjhhubhdefinition_list)}(hhh](hdefinition_list_item)}(h=dsp_map PCM device number assigned to /dev/dspX (default = 0)h](hterm)}(hdsp_maph]hdsp_map}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1jHhhhKShjDubh definition)}(hhh]h)}(h5PCM device number assigned to /dev/dspX (default = 0)h]h5PCM device number assigned to /dev/dspX (default = 0)}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKShjZubah}(h]h ]h"]h$]h&]uh1jXhjDubeh}(h]h ]h"]h$]h&]uh1jBhhhKShj?ubjC)}(h@adsp_map PCM device number assigned to /dev/adspX (default = 1) h](jI)}(hadsp_maph]hadsp_map}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1jHhhhKWhjwubjY)}(hhh]h)}(h6PCM device number assigned to /dev/adspX (default = 1)h]h6PCM device number assigned to /dev/adspX (default = 1)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKVhjubah}(h]h ]h"]h$]h&]uh1jXhjwubeh}(h]h ]h"]h$]h&]uh1jBhhhKWhj?hhubeh}(h]h ]h"]h$]h&]uh1j=hjhhhhhNubh)}(hYFor example, to map the third PCM device (``hw:0,2``) to /dev/adsp0, define like this: ::h](h*For example, to map the third PCM device (}(hjhhhNhNubj)}(h ``hw:0,2``h]hhw:0,2}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh") to /dev/adsp0, define like this:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKYhjhhubj?)}(hoptions snd-pcm-oss adsp_map=2h]hoptions snd-pcm-oss adsp_map=2}hjsbah}(h]h ]h"]h$]h&]jNjOuh1j>hhhK]hjhhubh)}(hThe options take arrays. For configuring the second card, specify two entries separated by comma. For example, to map the third PCM device on the second card to /dev/adsp1, define like below: ::h]hThe options take arrays. For configuring the second card, specify two entries separated by comma. For example, to map the third PCM device on the second card to /dev/adsp1, define like below:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK_hjhhubj?)}(h options snd-pcm-oss adsp_map=0,2h]h options snd-pcm-oss adsp_map=0,2}hjsbah}(h]h ]h"]h$]h&]jNjOuh1j>hhhKdhjhhubh)}(h[To change the mapping of MIDI devices, the following options are available for snd-rawmidi:h]h[To change the mapping of MIDI devices, the following options are available for snd-rawmidi:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjhhubj>)}(hhh](jC)}(hAmidi_map MIDI device number assigned to /dev/midi0X (default = 0)h](jI)}(hmidi_maph]hmidi_map}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jHhhhKjhjubjY)}(hhh]h)}(h8MIDI device number assigned to /dev/midi0X (default = 0)h]h8MIDI device number assigned to /dev/midi0X (default = 0)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhjubah}(h]h ]h"]h$]h&]uh1jXhjubeh}(h]h ]h"]h$]h&]uh1jBhhhKjhjubjC)}(hDamidi_map MIDI device number assigned to /dev/amidi0X (default = 1) h](jI)}(h amidi_maph]h amidi_map}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jHhhhKnhj6ubjY)}(hhh]h)}(h9MIDI device number assigned to /dev/amidi0X (default = 1)h]h9MIDI device number assigned to /dev/amidi0X (default = 1)}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhjHubah}(h]h ]h"]h$]h&]uh1jXhj6ubeh}(h]h ]h"]h$]h&]uh1jBhhhKnhjhhubeh}(h]h ]h"]h$]h&]uh1j=hjhhhhhNubh)}(hdFor example, to assign the third MIDI device on the first card to /dev/midi00, define as follows: ::h]haFor example, to assign the third MIDI device on the first card to /dev/midi00, define as follows:}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKphjhhubj?)}(hoptions snd-rawmidi midi_map=2h]hoptions snd-rawmidi midi_map=2}hjysbah}(h]h ]h"]h$]h&]jNjOuh1j>hhhKthjhhubeh}(h]device-mappingah ]h"]device mappingah$]h&]uh1hhhhhhhhK+ubh)}(hhh](h)}(hPCM Modeh]hPCM Mode}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKxubh)}(hX6As default, ALSA emulates the OSS PCM with so-called plugin layer, i.e. tries to convert the sample format, rate or channels automatically when the card doesn't support it natively. This will lead to some problems for some applications like quake or wine, especially if they use the card only in the MMAP mode.h]hX8As default, ALSA emulates the OSS PCM with so-called plugin layer, i.e. tries to convert the sample format, rate or channels automatically when the card doesn’t support it natively. This will lead to some problems for some applications like quake or wine, especially if they use the card only in the MMAP mode.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKzhjhhubh)}(hXIn such a case, you can change the behavior of PCM per application by writing a command to the proc file. There is a proc file for each PCM stream, ``/proc/asound/cardX/pcmY[cp]/oss``, where X is the card number (zero-based), Y the PCM device number (zero-based), and ``p`` is for playback and ``c`` for capture, respectively. Note that this proc file exists only after snd-pcm-oss module is loaded.h](hIn such a case, you can change the behavior of PCM per application by writing a command to the proc file. There is a proc file for each PCM stream, }(hjhhhNhNubj)}(h#``/proc/asound/cardX/pcmY[cp]/oss``h]h/proc/asound/cardX/pcmY[cp]/oss}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhU, where X is the card number (zero-based), Y the PCM device number (zero-based), and }(hjhhhNhNubj)}(h``p``h]hp}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh is for playback and }(hjhhhNhNubj)}(h``c``h]hc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhe for capture, respectively. Note that this proc file exists only after snd-pcm-oss module is loaded.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h1The command sequence has the following syntax: ::h]h.The command sequence has the following syntax:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj?)}(h*app_name fragments fragment_size [options]h]h*app_name fragments fragment_size [options]}hjsbah}(h]h ]h"]h$]h&]jNjOuh1j>hhhKhjhhubh)}(hX>``app_name`` is the name of application with (higher priority) or without path. ``fragments`` specifies the number of fragments or zero if no specific number is given. ``fragment_size`` is the size of fragment in bytes or zero if not given. ``options`` is the optional parameters. The following options are available:h](j)}(h ``app_name``h]happ_name}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhD is the name of application with (higher priority) or without path. }(hjhhhNhNubj)}(h ``fragments``h]h fragments}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhK specifies the number of fragments or zero if no specific number is given. }(hjhhhNhNubj)}(h``fragment_size``h]h fragment_size}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh8 is the size of fragment in bytes or zero if not given. }(hjhhhNhNubj)}(h ``options``h]hoptions}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhB is the optional parameters. The following options are available:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj>)}(hhh](jC)}(h`disable the application tries to open a pcm device for this channel but does not want to use it.h](jI)}(hdisableh]hdisable}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1jHhhhKhjcubjY)}(hhh]h)}(hXthe application tries to open a pcm device for this channel but does not want to use it.h]hXthe application tries to open a pcm device for this channel but does not want to use it.}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjuubah}(h]h ]h"]h$]h&]uh1jXhjcubeh}(h]h ]h"]h$]h&]uh1jBhhhKhj`ubjC)}(hdirect don't use pluginsh](jI)}(hdirecth]hdirect}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jHhhhKhjubjY)}(hhh]h)}(hdon't use pluginsh]hdon’t use plugins}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jXhjubeh}(h]h ]h"]h$]h&]uh1jBhhhKhj`hhubjC)}(hblock force block open modeh](jI)}(hblockh]hblock}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jHhhhKhjubjY)}(hhh]h)}(hforce block open modeh]hforce block open mode}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jXhjubeh}(h]h ]h"]h$]h&]uh1jBhhhKhj`hhubjC)}(h#non-block force non-block open modeh](jI)}(h non-blockh]h non-block}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jHhhhKhjubjY)}(hhh]h)}(hforce non-block open modeh]hforce non-block open mode}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jXhjubeh}(h]h ]h"]h$]h&]uh1jBhhhKhj`hhubjC)}(hApartial-frag write also partial fragments (affects playback only)h](jI)}(h partial-fragh]h partial-frag}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1jHhhhKhjubjY)}(hhh]h)}(h4write also partial fragments (affects playback only)h]h4write also partial fragments (affects playback only)}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj1ubah}(h]h ]h"]h$]h&]uh1jXhjubeh}(h]h ]h"]h$]h&]uh1jBhhhKhj`hhubjC)}(h5no-silence do not fill silence ahead to avoid clicks h](jI)}(h no-silenceh]h no-silence}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jHhhhKhjNubjY)}(hhh]h)}(h)do not fill silence ahead to avoid clicksh]h)do not fill silence ahead to avoid clicks}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj`ubah}(h]h ]h"]h$]h&]uh1jXhjNubeh}(h]h ]h"]h$]h&]uh1jBhhhKhj`hhubeh}(h]h ]h"]h$]h&]uh1j=hjhhhhhNubh)}(hXThe ``disable`` option is useful when one stream direction (playback or capture) is not handled correctly by the application although the hardware itself does support both directions. The ``direct`` option is used, as mentioned above, to bypass the automatic conversion and useful for MMAP-applications. For example, to playback the first PCM device without plugins for quake, send a command via echo like the following: ::h](hThe }(hjhhhNhNubj)}(h ``disable``h]hdisable}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh option is useful when one stream direction (playback or capture) is not handled correctly by the application although the hardware itself does support both directions. The }(hjhhhNhNubj)}(h ``direct``h]hdirect}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh option is used, as mentioned above, to bypass the automatic conversion and useful for MMAP-applications. For example, to playback the first PCM device without plugins for quake, send a command via echo like the following:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj?)}(h8% echo "quake 0 0 direct" > /proc/asound/card0/pcm0p/ossh]h8% echo "quake 0 0 direct" > /proc/asound/card0/pcm0p/oss}hjsbah}(h]h ]h"]h$]h&]jNjOuh1j>hhhKhjhhubh)}(hWhile quake wants only playback, you may append the second command to notify driver that only this direction is about to be allocated: ::h]hWhile quake wants only playback, you may append the second command to notify driver that only this direction is about to be allocated:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj?)}(h9% echo "quake 0 0 disable" > /proc/asound/card0/pcm0c/ossh]h9% echo "quake 0 0 disable" > /proc/asound/card0/pcm0c/oss}hjsbah}(h]h ]h"]h$]h&]jNjOuh1j>hhhKhjhhubh)}(hThe permission of proc files depend on the module options of snd. As default it's set as root, so you'll likely need to be superuser for sending the command above.h]hThe permission of proc files depend on the module options of snd. As default it’s set as root, so you’ll likely need to be superuser for sending the command above.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h[The block and non-block options are used to change the behavior of opening the device file.h]h[The block and non-block options are used to change the behavior of opening the device file.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hAs default, ALSA behaves as original OSS drivers, i.e. does not block the file when it's busy. The -EBUSY error is returned in this case.h]hAs default, ALSA behaves as original OSS drivers, i.e. does not block the file when it’s busy. The -EBUSY error is returned in this case.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThis blocking behavior can be changed globally via nonblock_open module option of snd-pcm-oss. For using the blocking mode as default for OSS devices, define like the following: ::h]hThis blocking behavior can be changed globally via nonblock_open module option of snd-pcm-oss. For using the blocking mode as default for OSS devices, define like the following:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj?)}(h#options snd-pcm-oss nonblock_open=0h]h#options snd-pcm-oss nonblock_open=0}hjsbah}(h]h ]h"]h$]h&]jNjOuh1j>hhhKhjhhubh)}(hX9The ``partial-frag`` and ``no-silence`` commands have been added recently. Both commands are for optimization use only. The former command specifies to invoke the write transfer only when the whole fragment is filled. The latter stops writing the silence data ahead automatically. Both are disabled as default.h](hThe }(hj%hhhNhNubj)}(h``partial-frag``h]h partial-frag}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh and }(hj%hhhNhNubj)}(h``no-silence``h]h no-silence}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubhX commands have been added recently. Both commands are for optimization use only. The former command specifies to invoke the write transfer only when the whole fragment is filled. The latter stops writing the silence data ahead automatically. Both are disabled as default.}(hj%hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hYou can check the currently defined configuration by reading the proc file. The read image can be sent to the proc file again, hence you can save the current configuration ::h]hYou can check the currently defined configuration by reading the proc file. The read image can be sent to the proc file again, hence you can save the current configuration}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj?)}(h7% cat /proc/asound/card0/pcm0p/oss > /somewhere/oss-cfgh]h7% cat /proc/asound/card0/pcm0p/oss > /somewhere/oss-cfg}hjesbah}(h]h ]h"]h$]h&]jNjOuh1j>hhhKhjhhubh)}(hand restore it like ::h]hand restore it like}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj?)}(h7% cat /somewhere/oss-cfg > /proc/asound/card0/pcm0p/ossh]h7% cat /somewhere/oss-cfg > /proc/asound/card0/pcm0p/oss}hjsbah}(h]h ]h"]h$]h&]jNjOuh1j>hhhKhjhhubh)}(hUAlso, for clearing all the current configuration, send ``erase`` command as below: ::h](h7Also, for clearing all the current configuration, send }(hjhhhNhNubj)}(h ``erase``h]herase}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh command as below:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj?)}(h-% echo "erase" > /proc/asound/card0/pcm0p/ossh]h-% echo "erase" > /proc/asound/card0/pcm0p/oss}hjsbah}(h]h ]h"]h$]h&]jNjOuh1j>hhhKhjhhubeh}(h]pcm-modeah ]h"]pcm modeah$]h&]uh1hhhhhhhhKxubh)}(hhh](h)}(hMixer Elementsh]hMixer Elements}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hX2Since ALSA has completely different mixer interface, the emulation of OSS mixer is relatively complicated. ALSA builds up a mixer element from several different ALSA (mixer) controls based on the name string. For example, the volume element SOUND_MIXER_PCM is composed from "PCM Playback Volume" and "PCM Playback Switch" controls for the playback direction and from "PCM Capture Volume" and "PCM Capture Switch" for the capture directory (if exists). When the PCM volume of OSS is changed, all the volume and switch controls above are adjusted automatically.h]hXBSince ALSA has completely different mixer interface, the emulation of OSS mixer is relatively complicated. ALSA builds up a mixer element from several different ALSA (mixer) controls based on the name string. For example, the volume element SOUND_MIXER_PCM is composed from “PCM Playback Volume” and “PCM Playback Switch” controls for the playback direction and from “PCM Capture Volume” and “PCM Capture Switch” for the capture directory (if exists). When the PCM volume of OSS is changed, all the volume and switch controls above are adjusted automatically.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hhhhMhjhhubh)}(hwhere the first column is the OSS volume element, the second column the base-string of the corresponding ALSA control, and the third the control index. When the string is empty, it means that the corresponding OSS control is not available.h]hwhere the first column is the OSS volume element, the second column the base-string of the corresponding ALSA control, and the third the control index. When the string is empty, it means that the corresponding OSS control is not available.}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hFor changing the assignment, you can write the configuration to this proc file. For example, to map "Wave Playback" to the PCM volume, send the command like the following: ::h]hFor changing the assignment, you can write the configuration to this proc file. For example, to map “Wave Playback” to the PCM volume, send the command like the following:}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj?)}(h@% echo 'VOLUME "Wave Playback" 0' > /proc/asound/card0/oss_mixerh]h@% echo 'VOLUME "Wave Playback" 0' > /proc/asound/card0/oss_mixer}hjdsbah}(h]h ]h"]h$]h&]jNjOuh1j>hhhM#hjhhubh)}(hThe command is exactly as same as listed in the proc file. You can change one or more elements, one volume per line. In the last example, both "Wave Playback Volume" and "Wave Playback Switch" will be affected when PCM volume is changed.h]hThe command is exactly as same as listed in the proc file. You can change one or more elements, one volume per line. In the last example, both “Wave Playback Volume” and “Wave Playback Switch” will be affected when PCM volume is changed.}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM%hjhhubh)}(hLike the case of PCM proc file, the permission of proc files depend on the module options of snd. you'll likely need to be superuser for sending the command above.h]hLike the case of PCM proc file, the permission of proc files depend on the module options of snd. you’ll likely need to be superuser for sending the command above.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM*hjhhubh)}(hAs well as in the case of PCM proc file, you can save and restore the current mixer configuration by reading and writing the whole file image.h]hAs well as in the case of PCM proc file, you can save and restore the current mixer configuration by reading and writing the whole file image.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM.hjhhubeh}(h]mixer-elementsah ]h"]mixer elementsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hDuplex Streamsh]hDuplex Streams}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM4ubh)}(hNote that when attempting to use a single device file for playback and capture, the OSS API provides no way to set the format, sample rate or number of channels different in each direction. Thus ::h]hNote that when attempting to use a single device file for playback and capture, the OSS API provides no way to set the format, sample rate or number of channels different in each direction. Thus}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hjhhubj?)}(h"io_handle = open("device", O_RDWR)h]h"io_handle = open("device", O_RDWR)}hjsbah}(h]h ]h"]h$]h&]jNjOuh1j>hhhM;hjhhubh)}(hJwill only function correctly if the values are the same in each direction.h]hJwill only function correctly if the values are the same in each direction.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM=hjhhubh)}(h:To use different values in the two directions, use both ::h]h7To use different values in the two directions, use both}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM?hjhhubj?)}(hPinput_handle = open("device", O_RDONLY) output_handle = open("device", O_WRONLY)h]hPinput_handle = open("device", O_RDONLY) output_handle = open("device", O_WRONLY)}hjsbah}(h]h ]h"]h$]h&]jNjOuh1j>hhhMBhjhhubh)}(h0and set the values for the corresponding handle.h]h0and set the values for the corresponding handle.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMEhjhhubeh}(h]duplex-streamsah ]h"]duplex streamsah$]h&]uh1hhhhhhhhM4ubh)}(hhh](h)}(hUnsupported Featuresh]hUnsupported Features}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMIubh)}(hhh](h)}(hMMAP on ICE1712 driverh]hMMAP on ICE1712 driver}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"hhhhhMLubh)}(hICE1712 supports only the unconventional format, interleaved 10-channels 24bit (packed in 32bit) format. Therefore you cannot mmap the buffer as the conventional (mono or 2-channels, 8 or 16bit) format on OSS.h]hICE1712 supports only the unconventional format, interleaved 10-channels 24bit (packed in 32bit) format. Therefore you cannot mmap the buffer as the conventional (mono or 2-channels, 8 or 16bit) format on OSS.}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMMhj"hhubeh}(h]mmap-on-ice1712-driverah ]h"]mmap on ice1712 driverah$]h&]uh1hhjhhhhhMLubeh}(h]unsupported-featuresah ]h"]unsupported featuresah$]h&]uh1hhhhhhhhMIubeh}(h]notes-on-kernel-oss-emulationah ]h"]notes on kernel oss-emulationah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksj&footnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj{error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jVjSjjjjjjjjjj jNjKjFjCu nametypes}(jVjjjjjjNjFuh}(jShjhjjjjjjj jjKjjCj"u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages](hsystem_message)}(hhh]h)}(hfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.h]hhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypeINFOlineK.sourcehuh1jhjhhhhhK.ubj)}(hhh]h)}(hfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.h]hhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypejlineKsourcehuh1jhjhhhhhKubj)}(hhh]h)}(hfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.h]hhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypejlineKҌsourcehuh1jhjhhhhhKubj)}(hhh]h)}(hfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.h]hhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj1ubah}(h]h ]h"]h$]h&]levelKtypejlineM@sourcehuh1jhjhhhhhM@ubetransform_messages] transformerN include_log] decorationNhhub.