18c2ecf20Sopenharmony_ci============================= 28c2ecf20Sopenharmony_ciNotes on Kernel OSS-Emulation 38c2ecf20Sopenharmony_ci============================= 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ciJan. 22, 2004 Takashi Iwai <tiwai@suse.de> 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ciModules 98c2ecf20Sopenharmony_ci======= 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ciALSA provides a powerful OSS emulation on the kernel. 128c2ecf20Sopenharmony_ciThe OSS emulation for PCM, mixer and sequencer devices is implemented 138c2ecf20Sopenharmony_cias add-on kernel modules, snd-pcm-oss, snd-mixer-oss and snd-seq-oss. 148c2ecf20Sopenharmony_ciWhen you need to access the OSS PCM, mixer or sequencer devices, the 158c2ecf20Sopenharmony_cicorresponding module has to be loaded. 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ciThese modules are loaded automatically when the corresponding service 188c2ecf20Sopenharmony_ciis called. The alias is defined ``sound-service-x-y``, where x and y are 198c2ecf20Sopenharmony_cithe card number and the minor unit number. Usually you don't have to 208c2ecf20Sopenharmony_cidefine these aliases by yourself. 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ciOnly necessary step for auto-loading of OSS modules is to define the 238c2ecf20Sopenharmony_cicard alias in ``/etc/modprobe.d/alsa.conf``, such as:: 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci alias sound-slot-0 snd-emu10k1 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ciAs the second card, define ``sound-slot-1`` as well. 288c2ecf20Sopenharmony_ciNote that you can't use the aliased name as the target name (i.e. 298c2ecf20Sopenharmony_ci``alias sound-slot-0 snd-card-0`` doesn't work any more like the old 308c2ecf20Sopenharmony_cimodutils). 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ciThe currently available OSS configuration is shown in 338c2ecf20Sopenharmony_ci/proc/asound/oss/sndstat. This shows in the same syntax of 348c2ecf20Sopenharmony_ci/dev/sndstat, which is available on the commercial OSS driver. 358c2ecf20Sopenharmony_ciOn ALSA, you can symlink /dev/sndstat to this proc file. 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ciPlease note that the devices listed in this proc file appear only 388c2ecf20Sopenharmony_ciafter the corresponding OSS-emulation module is loaded. Don't worry 398c2ecf20Sopenharmony_cieven if "NOT ENABLED IN CONFIG" is shown in it. 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ciDevice Mapping 438c2ecf20Sopenharmony_ci============== 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ciALSA supports the following OSS device files: 468c2ecf20Sopenharmony_ci:: 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci PCM: 498c2ecf20Sopenharmony_ci /dev/dspX 508c2ecf20Sopenharmony_ci /dev/adspX 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci Mixer: 538c2ecf20Sopenharmony_ci /dev/mixerX 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci MIDI: 568c2ecf20Sopenharmony_ci /dev/midi0X 578c2ecf20Sopenharmony_ci /dev/amidi0X 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ci Sequencer: 608c2ecf20Sopenharmony_ci /dev/sequencer 618c2ecf20Sopenharmony_ci /dev/sequencer2 (aka /dev/music) 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ciwhere X is the card number from 0 to 7. 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci(NOTE: Some distributions have the device files like /dev/midi0 and 668c2ecf20Sopenharmony_ci/dev/midi1. They are NOT for OSS but for tclmidi, which is 678c2ecf20Sopenharmony_cia totally different thing.) 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ciUnlike the real OSS, ALSA cannot use the device files more than the 708c2ecf20Sopenharmony_ciassigned ones. For example, the first card cannot use /dev/dsp1 or 718c2ecf20Sopenharmony_ci/dev/dsp2, but only /dev/dsp0 and /dev/adsp0. 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_ciAs seen above, PCM and MIDI may have two devices. Usually, the first 748c2ecf20Sopenharmony_ciPCM device (``hw:0,0`` in ALSA) is mapped to /dev/dsp and the secondary 758c2ecf20Sopenharmony_cidevice (``hw:0,1``) to /dev/adsp (if available). For MIDI, /dev/midi and 768c2ecf20Sopenharmony_ci/dev/amidi, respectively. 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ciYou can change this device mapping via the module options of 798c2ecf20Sopenharmony_cisnd-pcm-oss and snd-rawmidi. In the case of PCM, the following 808c2ecf20Sopenharmony_cioptions are available for snd-pcm-oss: 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_cidsp_map 838c2ecf20Sopenharmony_ci PCM device number assigned to /dev/dspX 848c2ecf20Sopenharmony_ci (default = 0) 858c2ecf20Sopenharmony_ciadsp_map 868c2ecf20Sopenharmony_ci PCM device number assigned to /dev/adspX 878c2ecf20Sopenharmony_ci (default = 1) 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_ciFor example, to map the third PCM device (``hw:0,2``) to /dev/adsp0, 908c2ecf20Sopenharmony_cidefine like this: 918c2ecf20Sopenharmony_ci:: 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci options snd-pcm-oss adsp_map=2 948c2ecf20Sopenharmony_ci 958c2ecf20Sopenharmony_ciThe options take arrays. For configuring the second card, specify 968c2ecf20Sopenharmony_citwo entries separated by comma. For example, to map the third PCM 978c2ecf20Sopenharmony_cidevice on the second card to /dev/adsp1, define like below: 988c2ecf20Sopenharmony_ci:: 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_ci options snd-pcm-oss adsp_map=0,2 1018c2ecf20Sopenharmony_ci 1028c2ecf20Sopenharmony_ciTo change the mapping of MIDI devices, the following options are 1038c2ecf20Sopenharmony_ciavailable for snd-rawmidi: 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_cimidi_map 1068c2ecf20Sopenharmony_ci MIDI device number assigned to /dev/midi0X 1078c2ecf20Sopenharmony_ci (default = 0) 1088c2ecf20Sopenharmony_ciamidi_map 1098c2ecf20Sopenharmony_ci MIDI device number assigned to /dev/amidi0X 1108c2ecf20Sopenharmony_ci (default = 1) 1118c2ecf20Sopenharmony_ci 1128c2ecf20Sopenharmony_ciFor example, to assign the third MIDI device on the first card to 1138c2ecf20Sopenharmony_ci/dev/midi00, define as follows: 1148c2ecf20Sopenharmony_ci:: 1158c2ecf20Sopenharmony_ci 1168c2ecf20Sopenharmony_ci options snd-rawmidi midi_map=2 1178c2ecf20Sopenharmony_ci 1188c2ecf20Sopenharmony_ci 1198c2ecf20Sopenharmony_ciPCM Mode 1208c2ecf20Sopenharmony_ci======== 1218c2ecf20Sopenharmony_ci 1228c2ecf20Sopenharmony_ciAs default, ALSA emulates the OSS PCM with so-called plugin layer, 1238c2ecf20Sopenharmony_cii.e. tries to convert the sample format, rate or channels 1248c2ecf20Sopenharmony_ciautomatically when the card doesn't support it natively. 1258c2ecf20Sopenharmony_ciThis will lead to some problems for some applications like quake or 1268c2ecf20Sopenharmony_ciwine, especially if they use the card only in the MMAP mode. 1278c2ecf20Sopenharmony_ci 1288c2ecf20Sopenharmony_ciIn such a case, you can change the behavior of PCM per application by 1298c2ecf20Sopenharmony_ciwriting a command to the proc file. There is a proc file for each PCM 1308c2ecf20Sopenharmony_cistream, ``/proc/asound/cardX/pcmY[cp]/oss``, where X is the card number 1318c2ecf20Sopenharmony_ci(zero-based), Y the PCM device number (zero-based), and ``p`` is for 1328c2ecf20Sopenharmony_ciplayback and ``c`` for capture, respectively. Note that this proc file 1338c2ecf20Sopenharmony_ciexists only after snd-pcm-oss module is loaded. 1348c2ecf20Sopenharmony_ci 1358c2ecf20Sopenharmony_ciThe command sequence has the following syntax: 1368c2ecf20Sopenharmony_ci:: 1378c2ecf20Sopenharmony_ci 1388c2ecf20Sopenharmony_ci app_name fragments fragment_size [options] 1398c2ecf20Sopenharmony_ci 1408c2ecf20Sopenharmony_ci``app_name`` is the name of application with (higher priority) or without 1418c2ecf20Sopenharmony_cipath. 1428c2ecf20Sopenharmony_ci``fragments`` specifies the number of fragments or zero if no specific 1438c2ecf20Sopenharmony_cinumber is given. 1448c2ecf20Sopenharmony_ci``fragment_size`` is the size of fragment in bytes or zero if not given. 1458c2ecf20Sopenharmony_ci``options`` is the optional parameters. The following options are 1468c2ecf20Sopenharmony_ciavailable: 1478c2ecf20Sopenharmony_ci 1488c2ecf20Sopenharmony_cidisable 1498c2ecf20Sopenharmony_ci the application tries to open a pcm device for 1508c2ecf20Sopenharmony_ci this channel but does not want to use it. 1518c2ecf20Sopenharmony_cidirect 1528c2ecf20Sopenharmony_ci don't use plugins 1538c2ecf20Sopenharmony_ciblock 1548c2ecf20Sopenharmony_ci force block open mode 1558c2ecf20Sopenharmony_cinon-block 1568c2ecf20Sopenharmony_ci force non-block open mode 1578c2ecf20Sopenharmony_cipartial-frag 1588c2ecf20Sopenharmony_ci write also partial fragments (affects playback only) 1598c2ecf20Sopenharmony_cino-silence 1608c2ecf20Sopenharmony_ci do not fill silence ahead to avoid clicks 1618c2ecf20Sopenharmony_ci 1628c2ecf20Sopenharmony_ciThe ``disable`` option is useful when one stream direction (playback or 1638c2ecf20Sopenharmony_cicapture) is not handled correctly by the application although the 1648c2ecf20Sopenharmony_cihardware itself does support both directions. 1658c2ecf20Sopenharmony_ciThe ``direct`` option is used, as mentioned above, to bypass the automatic 1668c2ecf20Sopenharmony_ciconversion and useful for MMAP-applications. 1678c2ecf20Sopenharmony_ciFor example, to playback the first PCM device without plugins for 1688c2ecf20Sopenharmony_ciquake, send a command via echo like the following: 1698c2ecf20Sopenharmony_ci:: 1708c2ecf20Sopenharmony_ci 1718c2ecf20Sopenharmony_ci % echo "quake 0 0 direct" > /proc/asound/card0/pcm0p/oss 1728c2ecf20Sopenharmony_ci 1738c2ecf20Sopenharmony_ciWhile quake wants only playback, you may append the second command 1748c2ecf20Sopenharmony_cito notify driver that only this direction is about to be allocated: 1758c2ecf20Sopenharmony_ci:: 1768c2ecf20Sopenharmony_ci 1778c2ecf20Sopenharmony_ci % echo "quake 0 0 disable" > /proc/asound/card0/pcm0c/oss 1788c2ecf20Sopenharmony_ci 1798c2ecf20Sopenharmony_ciThe permission of proc files depend on the module options of snd. 1808c2ecf20Sopenharmony_ciAs default it's set as root, so you'll likely need to be superuser for 1818c2ecf20Sopenharmony_cisending the command above. 1828c2ecf20Sopenharmony_ci 1838c2ecf20Sopenharmony_ciThe block and non-block options are used to change the behavior of 1848c2ecf20Sopenharmony_ciopening the device file. 1858c2ecf20Sopenharmony_ci 1868c2ecf20Sopenharmony_ciAs default, ALSA behaves as original OSS drivers, i.e. does not block 1878c2ecf20Sopenharmony_cithe file when it's busy. The -EBUSY error is returned in this case. 1888c2ecf20Sopenharmony_ci 1898c2ecf20Sopenharmony_ciThis blocking behavior can be changed globally via nonblock_open 1908c2ecf20Sopenharmony_cimodule option of snd-pcm-oss. For using the blocking mode as default 1918c2ecf20Sopenharmony_cifor OSS devices, define like the following: 1928c2ecf20Sopenharmony_ci:: 1938c2ecf20Sopenharmony_ci 1948c2ecf20Sopenharmony_ci options snd-pcm-oss nonblock_open=0 1958c2ecf20Sopenharmony_ci 1968c2ecf20Sopenharmony_ciThe ``partial-frag`` and ``no-silence`` commands have been added recently. 1978c2ecf20Sopenharmony_ciBoth commands are for optimization use only. The former command 1988c2ecf20Sopenharmony_cispecifies to invoke the write transfer only when the whole fragment is 1998c2ecf20Sopenharmony_cifilled. The latter stops writing the silence data ahead 2008c2ecf20Sopenharmony_ciautomatically. Both are disabled as default. 2018c2ecf20Sopenharmony_ci 2028c2ecf20Sopenharmony_ciYou can check the currently defined configuration by reading the proc 2038c2ecf20Sopenharmony_cifile. The read image can be sent to the proc file again, hence you 2048c2ecf20Sopenharmony_cican save the current configuration 2058c2ecf20Sopenharmony_ci:: 2068c2ecf20Sopenharmony_ci 2078c2ecf20Sopenharmony_ci % cat /proc/asound/card0/pcm0p/oss > /somewhere/oss-cfg 2088c2ecf20Sopenharmony_ci 2098c2ecf20Sopenharmony_ciand restore it like 2108c2ecf20Sopenharmony_ci:: 2118c2ecf20Sopenharmony_ci 2128c2ecf20Sopenharmony_ci % cat /somewhere/oss-cfg > /proc/asound/card0/pcm0p/oss 2138c2ecf20Sopenharmony_ci 2148c2ecf20Sopenharmony_ciAlso, for clearing all the current configuration, send ``erase`` command 2158c2ecf20Sopenharmony_cias below: 2168c2ecf20Sopenharmony_ci:: 2178c2ecf20Sopenharmony_ci 2188c2ecf20Sopenharmony_ci % echo "erase" > /proc/asound/card0/pcm0p/oss 2198c2ecf20Sopenharmony_ci 2208c2ecf20Sopenharmony_ci 2218c2ecf20Sopenharmony_ciMixer Elements 2228c2ecf20Sopenharmony_ci============== 2238c2ecf20Sopenharmony_ci 2248c2ecf20Sopenharmony_ciSince ALSA has completely different mixer interface, the emulation of 2258c2ecf20Sopenharmony_ciOSS mixer is relatively complicated. ALSA builds up a mixer element 2268c2ecf20Sopenharmony_cifrom several different ALSA (mixer) controls based on the name 2278c2ecf20Sopenharmony_cistring. For example, the volume element SOUND_MIXER_PCM is composed 2288c2ecf20Sopenharmony_cifrom "PCM Playback Volume" and "PCM Playback Switch" controls for the 2298c2ecf20Sopenharmony_ciplayback direction and from "PCM Capture Volume" and "PCM Capture 2308c2ecf20Sopenharmony_ciSwitch" for the capture directory (if exists). When the PCM volume of 2318c2ecf20Sopenharmony_ciOSS is changed, all the volume and switch controls above are adjusted 2328c2ecf20Sopenharmony_ciautomatically. 2338c2ecf20Sopenharmony_ci 2348c2ecf20Sopenharmony_ciAs default, ALSA uses the following control for OSS volumes: 2358c2ecf20Sopenharmony_ci 2368c2ecf20Sopenharmony_ci==================== ===================== ===== 2378c2ecf20Sopenharmony_ciOSS volume ALSA control Index 2388c2ecf20Sopenharmony_ci==================== ===================== ===== 2398c2ecf20Sopenharmony_ciSOUND_MIXER_VOLUME Master 0 2408c2ecf20Sopenharmony_ciSOUND_MIXER_BASS Tone Control - Bass 0 2418c2ecf20Sopenharmony_ciSOUND_MIXER_TREBLE Tone Control - Treble 0 2428c2ecf20Sopenharmony_ciSOUND_MIXER_SYNTH Synth 0 2438c2ecf20Sopenharmony_ciSOUND_MIXER_PCM PCM 0 2448c2ecf20Sopenharmony_ciSOUND_MIXER_SPEAKER PC Speaker 0 2458c2ecf20Sopenharmony_ciSOUND_MIXER_LINE Line 0 2468c2ecf20Sopenharmony_ciSOUND_MIXER_MIC Mic 0 2478c2ecf20Sopenharmony_ciSOUND_MIXER_CD CD 0 2488c2ecf20Sopenharmony_ciSOUND_MIXER_IMIX Monitor Mix 0 2498c2ecf20Sopenharmony_ciSOUND_MIXER_ALTPCM PCM 1 2508c2ecf20Sopenharmony_ciSOUND_MIXER_RECLEV (not assigned) 2518c2ecf20Sopenharmony_ciSOUND_MIXER_IGAIN Capture 0 2528c2ecf20Sopenharmony_ciSOUND_MIXER_OGAIN Playback 0 2538c2ecf20Sopenharmony_ciSOUND_MIXER_LINE1 Aux 0 2548c2ecf20Sopenharmony_ciSOUND_MIXER_LINE2 Aux 1 2558c2ecf20Sopenharmony_ciSOUND_MIXER_LINE3 Aux 2 2568c2ecf20Sopenharmony_ciSOUND_MIXER_DIGITAL1 Digital 0 2578c2ecf20Sopenharmony_ciSOUND_MIXER_DIGITAL2 Digital 1 2588c2ecf20Sopenharmony_ciSOUND_MIXER_DIGITAL3 Digital 2 2598c2ecf20Sopenharmony_ciSOUND_MIXER_PHONEIN Phone 0 2608c2ecf20Sopenharmony_ciSOUND_MIXER_PHONEOUT Phone 1 2618c2ecf20Sopenharmony_ciSOUND_MIXER_VIDEO Video 0 2628c2ecf20Sopenharmony_ciSOUND_MIXER_RADIO Radio 0 2638c2ecf20Sopenharmony_ciSOUND_MIXER_MONITOR Monitor 0 2648c2ecf20Sopenharmony_ci==================== ===================== ===== 2658c2ecf20Sopenharmony_ci 2668c2ecf20Sopenharmony_ciThe second column is the base-string of the corresponding ALSA 2678c2ecf20Sopenharmony_cicontrol. In fact, the controls with ``XXX [Playback|Capture] 2688c2ecf20Sopenharmony_ci[Volume|Switch]`` will be checked in addition. 2698c2ecf20Sopenharmony_ci 2708c2ecf20Sopenharmony_ciThe current assignment of these mixer elements is listed in the proc 2718c2ecf20Sopenharmony_cifile, /proc/asound/cardX/oss_mixer, which will be like the following 2728c2ecf20Sopenharmony_ci:: 2738c2ecf20Sopenharmony_ci 2748c2ecf20Sopenharmony_ci VOLUME "Master" 0 2758c2ecf20Sopenharmony_ci BASS "" 0 2768c2ecf20Sopenharmony_ci TREBLE "" 0 2778c2ecf20Sopenharmony_ci SYNTH "" 0 2788c2ecf20Sopenharmony_ci PCM "PCM" 0 2798c2ecf20Sopenharmony_ci ... 2808c2ecf20Sopenharmony_ci 2818c2ecf20Sopenharmony_ciwhere the first column is the OSS volume element, the second column 2828c2ecf20Sopenharmony_cithe base-string of the corresponding ALSA control, and the third the 2838c2ecf20Sopenharmony_cicontrol index. When the string is empty, it means that the 2848c2ecf20Sopenharmony_cicorresponding OSS control is not available. 2858c2ecf20Sopenharmony_ci 2868c2ecf20Sopenharmony_ciFor changing the assignment, you can write the configuration to this 2878c2ecf20Sopenharmony_ciproc file. For example, to map "Wave Playback" to the PCM volume, 2888c2ecf20Sopenharmony_cisend the command like the following: 2898c2ecf20Sopenharmony_ci:: 2908c2ecf20Sopenharmony_ci 2918c2ecf20Sopenharmony_ci % echo 'VOLUME "Wave Playback" 0' > /proc/asound/card0/oss_mixer 2928c2ecf20Sopenharmony_ci 2938c2ecf20Sopenharmony_ciThe command is exactly as same as listed in the proc file. You can 2948c2ecf20Sopenharmony_cichange one or more elements, one volume per line. In the last 2958c2ecf20Sopenharmony_ciexample, both "Wave Playback Volume" and "Wave Playback Switch" will 2968c2ecf20Sopenharmony_cibe affected when PCM volume is changed. 2978c2ecf20Sopenharmony_ci 2988c2ecf20Sopenharmony_ciLike the case of PCM proc file, the permission of proc files depend on 2998c2ecf20Sopenharmony_cithe module options of snd. you'll likely need to be superuser for 3008c2ecf20Sopenharmony_cisending the command above. 3018c2ecf20Sopenharmony_ci 3028c2ecf20Sopenharmony_ciAs well as in the case of PCM proc file, you can save and restore the 3038c2ecf20Sopenharmony_cicurrent mixer configuration by reading and writing the whole file 3048c2ecf20Sopenharmony_ciimage. 3058c2ecf20Sopenharmony_ci 3068c2ecf20Sopenharmony_ci 3078c2ecf20Sopenharmony_ciDuplex Streams 3088c2ecf20Sopenharmony_ci============== 3098c2ecf20Sopenharmony_ci 3108c2ecf20Sopenharmony_ciNote that when attempting to use a single device file for playback and 3118c2ecf20Sopenharmony_cicapture, the OSS API provides no way to set the format, sample rate or 3128c2ecf20Sopenharmony_cinumber of channels different in each direction. Thus 3138c2ecf20Sopenharmony_ci:: 3148c2ecf20Sopenharmony_ci 3158c2ecf20Sopenharmony_ci io_handle = open("device", O_RDWR) 3168c2ecf20Sopenharmony_ci 3178c2ecf20Sopenharmony_ciwill only function correctly if the values are the same in each direction. 3188c2ecf20Sopenharmony_ci 3198c2ecf20Sopenharmony_ciTo use different values in the two directions, use both 3208c2ecf20Sopenharmony_ci:: 3218c2ecf20Sopenharmony_ci 3228c2ecf20Sopenharmony_ci input_handle = open("device", O_RDONLY) 3238c2ecf20Sopenharmony_ci output_handle = open("device", O_WRONLY) 3248c2ecf20Sopenharmony_ci 3258c2ecf20Sopenharmony_ciand set the values for the corresponding handle. 3268c2ecf20Sopenharmony_ci 3278c2ecf20Sopenharmony_ci 3288c2ecf20Sopenharmony_ciUnsupported Features 3298c2ecf20Sopenharmony_ci==================== 3308c2ecf20Sopenharmony_ci 3318c2ecf20Sopenharmony_ciMMAP on ICE1712 driver 3328c2ecf20Sopenharmony_ci---------------------- 3338c2ecf20Sopenharmony_ciICE1712 supports only the unconventional format, interleaved 3348c2ecf20Sopenharmony_ci10-channels 24bit (packed in 32bit) format. Therefore you cannot mmap 3358c2ecf20Sopenharmony_cithe buffer as the conventional (mono or 2-channels, 8 or 16bit) format 3368c2ecf20Sopenharmony_cion OSS. 337