特殊:Badtitle/NS100:EnableSoftwareMixing
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/EnableSoftwareMixing }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/af | • {{#if: UbuntuHelp:EnableSoftwareMixing|Afrikaans| [[::EnableSoftwareMixing/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/ar | • {{#if: UbuntuHelp:EnableSoftwareMixing|العربية| [[::EnableSoftwareMixing/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/az | • {{#if: UbuntuHelp:EnableSoftwareMixing|azərbaycanca| [[::EnableSoftwareMixing/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/bcc | • {{#if: UbuntuHelp:EnableSoftwareMixing|جهلسری بلوچی| [[::EnableSoftwareMixing/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/bg | • {{#if: UbuntuHelp:EnableSoftwareMixing|български| [[::EnableSoftwareMixing/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/br | • {{#if: UbuntuHelp:EnableSoftwareMixing|brezhoneg| [[::EnableSoftwareMixing/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/ca | • {{#if: UbuntuHelp:EnableSoftwareMixing|català| [[::EnableSoftwareMixing/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/cs | • {{#if: UbuntuHelp:EnableSoftwareMixing|čeština| [[::EnableSoftwareMixing/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/de | • {{#if: UbuntuHelp:EnableSoftwareMixing|Deutsch| [[::EnableSoftwareMixing/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/el | • {{#if: UbuntuHelp:EnableSoftwareMixing|Ελληνικά| [[::EnableSoftwareMixing/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/es | • {{#if: UbuntuHelp:EnableSoftwareMixing|español| [[::EnableSoftwareMixing/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/fa | • {{#if: UbuntuHelp:EnableSoftwareMixing|فارسی| [[::EnableSoftwareMixing/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/fi | • {{#if: UbuntuHelp:EnableSoftwareMixing|suomi| [[::EnableSoftwareMixing/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/fr | • {{#if: UbuntuHelp:EnableSoftwareMixing|français| [[::EnableSoftwareMixing/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/gu | • {{#if: UbuntuHelp:EnableSoftwareMixing|ગુજરાતી| [[::EnableSoftwareMixing/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/he | • {{#if: UbuntuHelp:EnableSoftwareMixing|עברית| [[::EnableSoftwareMixing/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/hu | • {{#if: UbuntuHelp:EnableSoftwareMixing|magyar| [[::EnableSoftwareMixing/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/id | • {{#if: UbuntuHelp:EnableSoftwareMixing|Bahasa Indonesia| [[::EnableSoftwareMixing/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/it | • {{#if: UbuntuHelp:EnableSoftwareMixing|italiano| [[::EnableSoftwareMixing/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/ja | • {{#if: UbuntuHelp:EnableSoftwareMixing|日本語| [[::EnableSoftwareMixing/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/ko | • {{#if: UbuntuHelp:EnableSoftwareMixing|한국어| [[::EnableSoftwareMixing/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/ksh | • {{#if: UbuntuHelp:EnableSoftwareMixing|Ripoarisch| [[::EnableSoftwareMixing/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/mr | • {{#if: UbuntuHelp:EnableSoftwareMixing|मराठी| [[::EnableSoftwareMixing/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/ms | • {{#if: UbuntuHelp:EnableSoftwareMixing|Bahasa Melayu| [[::EnableSoftwareMixing/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/nl | • {{#if: UbuntuHelp:EnableSoftwareMixing|Nederlands| [[::EnableSoftwareMixing/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/no | • {{#if: UbuntuHelp:EnableSoftwareMixing|norsk| [[::EnableSoftwareMixing/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/oc | • {{#if: UbuntuHelp:EnableSoftwareMixing|occitan| [[::EnableSoftwareMixing/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/pl | • {{#if: UbuntuHelp:EnableSoftwareMixing|polski| [[::EnableSoftwareMixing/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/pt | • {{#if: UbuntuHelp:EnableSoftwareMixing|português| [[::EnableSoftwareMixing/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/ro | • {{#if: UbuntuHelp:EnableSoftwareMixing|română| [[::EnableSoftwareMixing/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/ru | • {{#if: UbuntuHelp:EnableSoftwareMixing|русский| [[::EnableSoftwareMixing/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/si | • {{#if: UbuntuHelp:EnableSoftwareMixing|සිංහල| [[::EnableSoftwareMixing/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/sq | • {{#if: UbuntuHelp:EnableSoftwareMixing|shqip| [[::EnableSoftwareMixing/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/sr | • {{#if: UbuntuHelp:EnableSoftwareMixing|српски / srpski| [[::EnableSoftwareMixing/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/sv | • {{#if: UbuntuHelp:EnableSoftwareMixing|svenska| [[::EnableSoftwareMixing/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/th | • {{#if: UbuntuHelp:EnableSoftwareMixing|ไทย| [[::EnableSoftwareMixing/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/tr | • {{#if: UbuntuHelp:EnableSoftwareMixing|Türkçe| [[::EnableSoftwareMixing/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/vi | • {{#if: UbuntuHelp:EnableSoftwareMixing|Tiếng Việt| [[::EnableSoftwareMixing/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/yue | • {{#if: UbuntuHelp:EnableSoftwareMixing|粵語| [[::EnableSoftwareMixing/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/zh | • {{#if: UbuntuHelp:EnableSoftwareMixing|中文| [[::EnableSoftwareMixing/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/zh-hans | • {{#if: UbuntuHelp:EnableSoftwareMixing|中文(简体)| [[::EnableSoftwareMixing/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EnableSoftwareMixing | UbuntuHelp:EnableSoftwareMixing | {{#if: | :}}EnableSoftwareMixing}}/zh-hant | • {{#if: UbuntuHelp:EnableSoftwareMixing|中文(繁體)| [[::EnableSoftwareMixing/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:EnableSoftwareMixing|:EnableSoftwareMixing|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :EnableSoftwareMixing/zh | | {{#ifexist: EnableSoftwareMixing/zh | | {{#ifeq: {{#titleparts:EnableSoftwareMixing|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:EnableSoftwareMixing|1|-1|}} | zh | | }}
HOWTO: Hear multiple sounds using both esd and ALSA
(taken from http://www.ubuntuforums.org/printthread.php?t=32063&pp=40) These are the instructions on enabling software mixing, to avoid application problems like Audacity needing killall esd to work while another application is playing music. (1) libesd-alsa0 should be installed (it already is in dapper) (2) We need to create /etc/asound.conf, including the following lines:
pcm.card0 { type hw card 0 # mmap_emulation true } #pcm.dmix0 { # type dmix # ipc_key 34521 # slave { # pcm "card0" # } #} pcm.dmix0 { type dmix ipc_key 1024 ## needs to be a power of 2 slave { pcm "hw:0" period_time 0 period_size 1024 buffer_size 8192 # format S16_LE rate 44100 ## not necessary } #slowptr true } pcm.dsnoop0 { type dsnoop ipc_key 2048 slave { pcm "card0" # rate 48000 } } pcm.asym0 { type asym playback.pcm "dmix0" capture.pcm "dsnoop0" } pcm.pasym0 { type plug slave.pcm "asym0" } # 'dsp0' is expected by OSS emulation etc. pcm.dsp0 { type plug slave.pcm "asym0" } ctl.dsp0 { type hw card 0 } pcm.!default { type plug slave.pcm "asym0" } ctl.!default { type hw card 0 }
(3) Also, we need to change /etc/esound/esd.conf contents so:
[esd] auto_spawn=1 spawn_options=-terminate -nobeeps -as 2 -d default spawn_wait_ms=100 # default options are used in spawned and non-spawned mode default_options=
(4) Now we need to change ubuntu sound server to alsa (we can leave it ESD but we better use alsa because it has better sound handling): "gstreamer-properties" -- Change both (in the Audio Tab not the Video) from ESD to ALSA. (5) All that's left now is to restart computer (after restart you must hear sound) to enable these changes. Also configure XMMS or Beep-media-player (or any player) to use ALSA instead of eSound/ESD. If you hear a strange sound, just change everything back to ESD. If everything worked correctly, now Audacity & Skype will work normally and all the program will play sound using either Alsa or ESD.
Notes
- If you couldn't play any sounds using ALSA then your /etc/asound.cond & /etc/esound/esd.conf needs some more advanced tweaking (or your sound card just won't support it).
- if realplayer still doesn't work after switching to alsa, this is because it is looking for /dev/dsp which is the oss device. Fortunately, alsa includes oss emulation. to enable it, just type "modprobe -v snd-pcm-oss"; this will create the /dev/dsp device, routed to alsa. Realplayer (and other oss only apps, no doubt) then works. If that works fine, then just add snd-pcm-oss to the file /etc/modules; it will be loaded automatically at boot.
- Also you might find sdl games no longer have sound here's a fix: SDL tries to use hw:0, and without intervention, it fails to open audio device. But SDL uses AUDIODEV environment variable, so it placed such file to /etc/profile.d/, example dmix_sdl.sh: "export AUDIODEV=default".
Note that for sdl games you should have libsdl1.2debian-alsa installed. You could install the esd version but both will work and this way you can have sdl games work in another window manager where you might not be running esd. It defaulted to libsdl1.2debian-oss. Not sure exactly why that doesn't work when alsa has oss emulation.
- and finally mplayer can be modified within the gui (gmplayer) but mplayer alone won't read that. Here's my ~/.mplayer/config:
vo="xv" ao="alsa:device=default"
The vo="xv" will set mplayer to use xv hardware overlay for video so most of you will want that as well if you haven't set it as such. I'm mainly use totem but it's nice to have mplayer working with this setup. And the gstreamer-properties test with this setup will work for both playback and recording.