个人工具

DebuggingSoundProblems

来自Ubuntu中文

跳转至: 导航, 搜索

声音故障解决方案

原文出处:

原文作者:

授权许可:

翻译人员: ShaunDu

校正人员:

贡献人员:

适用版本: 文章状态:等待翻译



Do not report problems on this page; use the normal support channels.

请不要在本页面中反应问题,如果有任何的问题需要解决,请通过正常的技术支持途径寻求帮助。

  • In alsamixer, check that sound is unmuted and that the volume is turned up
  • In alsamixer,请检查系统有没有被设置成“静音”模式以及检查音量是否被调整到合适的大小。
    • I found it hard to find these controls: its not the "sound" in preferences; click on panel; add to panel; volume controls; speaker icon appears on panel; left click on icon; preferences; played around here and it worked
    • 如果发现面板中没有“音量控制按钮”,请按照下列方法将“音量控制按钮”添加到面板当中:点击面板-〉选择添加到面板-〉选择音量控制,此时音量控制按钮将会出现在面板当中;左键点击音量控制按钮并上下滑动以调整音量大小。
    • Unmute everything. I had to unmute "Master Surround" even though I only have two speakers, for example.
    • 不要'静音'任何选项, 虽然我只有两个音箱,但是我不能静音主环绕, 比方说,
  • Most sound problems are the result of failed hardware detection, so see DebuggingHardwareDetection
  • 大部分的声音是由于失败的硬件自检引起的, 如果你的问题也是这样的话,请参阅 DebuggingHardwareDetection
  • When reporting a problem, include (in addition to the information requested in DebuggingHardwareDetection):
  • 当提交一个问题的时候, 除了DebuggingHardwareDetection 需要的信息以外, 请额外添加
    • Output of `aplay -l`
    • Output of `aplay -l`
  • Here is a good sound troubleshooting page: http://linux.iuplog.com/default.asp?item=94639
  • 这里有一个很好的解决故障的页面: http://linux.iuplog.com/default.asp?item=94639
  • See also SoundProblemsHoary
  • 另外, 请参阅 SoundProblemsHoary
  • Test different "Sound Servers": Go to System > Preferences > Multimedia Systems Selector. From there, you can test the different options. For me, there are four different sound servers installed, and only one works. This is probably your problem if you cannot play audio with xine or rhythmbox, but you can with xmms or helix/realplayer.
  • 测试不同的'音频服务站': 系统> 个人设定(中文系统上preferences是怎么翻译的?)>多媒体系统选择器>.在这里,你可以测试不同的选项.我自己安装了4个不同的音频工作站, 但是只有1个是工作的.如果您不能用xine或者rhythmbox播放音频,但是可以用xmms或者helix/realplayer,这个问题可能也会发生在您的系统上.
  • Howto: Happy ALSA, OSS, ESD, with Duplex - Sound Settings
  • 如何处理: Happy ALSA, OSS, ESD, with Duplex - 音频设定

Useful Tips & Tricks(实用的小贴士和小诀窍)

You can use aplay to get a list of soundcards configured by alsa 你可以用aplay来获得由alsa设置的声卡列表

$ aplay -l
aplay: device_list:200: no soundcards found...

The following commands can help to figure out what sound card (chip set) you have (Look for lines that contain 'Multimedia audio controller')

$ lspci -v
$ lspnp -v

Another usefull script to gather specs about sound-cards and drivers is aadebug. 另外一个使用的用来收集声卡规格和驱动的script是aadebug. “A word about compatibility: even though most sound cards are claimed to be SoundBlaster compatible, very few currently sold cards are compatible enough to work with the Linux SoundBlaster driver. “ - http://www.tldp.org/HOWTO/Sound-HOWTO/x96.html#AEN120 "关于声卡的兼容性:尽管大多数声卡都生成可以和SoundBlaster兼容,但是只有很少一部分在出售的声卡有足够的兼容性能在linux上的SoundBlaster的驱动下工作. Now figure out which module you need: 现在来判断哪一种模块是你所需要的:

To see if this module is available on your system (it usually is) try the following command: 一下的命令是用来测试模块是否在你的系统上可用(通常都是可用的):

$ modinfo [modulename]

This will also list the possible parameters for the module. For example some ISA cards require you to pass isapnp=0 to modprobe. It may also require the IRQ and IO of the card if that's the case, these can be found in the output of the aadebug script. 它也会帮你列出适合的模块参数. 比方说, 一些ISA的声卡需要你通过isapnp=0来modprobe. 它也可能需要声卡的IRQ 和IO, 这可都可以在aadebug的输出指令里边找到. Now that you've figured out all this information, lets try loading the module 现在, 你已经有了你所需要的信息, 那就开始加载模块吧

#modprobe example
$ sudo modprobe snd_es18xx isapnp=0 port=0x220 mpu_port=0x330 dma1=1 dma2=5 irq=5 fm_port=0x388

If this doesn't return any errors, we can save the parameters. 如果这个指令没有恢复给你任何错误, 那我们就可以保存这个参数.

$ echo options [module-name] [module-options] >> /etc/modprobe.d/[module-name]

Now we can test our setup 现在,我们可以开始测试我们的安装

#aplay should now list your sound card
root@ubuntu:/etc # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ES1878 [ESS AudioDrive ES1878], device 0: ES1878 [ESS AudioDrive ES1878]
Subdevices: 1/1
Subdevice #0: subdevice #0
#the speaker should beep
$ /usr/bin/speaker-test

PolypAudio

Suggested by DanielTChen

The recommended method is to use the polypaudio daemon (esd replacement) and to leave/set applications to use ESounD output. See the Sound section in /usr/share/doc/mozilla-firefox/README.Debian 推荐的方法是用polypaudio daemon(esd的替换品)来 leave/set 应用程序来使用ESounD 输出. 请参阅音频部分:/usr/share/doc/mozilla-firefox/README.Debian

Software Mixing

A much better way of getting esd to work with non-esd-aware apps is to make alsa use its software mixer. 让alsa用它自己的软件混合器一个更好的方法来让esd和不是esd识别的应用程序在一起工作 $ sudo /etc/init.d/alsa-utils stop $ sudo gedit /var/lib/alsa/asound.state

  • (add the following text verbatim to the start of this file)

$ sudo /etc/init.d/alsa-utils start

# This text should be added to the beginning of
# /var/lib/alsa/asound.state.  You only need to add
# it once -- it is saved across reboots.
pcm.asymed {
type asym
playback.pcm dmix
capture.pcm dsnoop
}
pcm.default {
type plug
slave.pcm asymed
}
pcm.dmix {
type dmix
ipc_key 5678293
ipc_key_add_uid yes
slave {
pcm 'hw:0,0'
period_time 0
period_size 128
buffer_size 2048
format S16_LE
rate 48000
}
}
pcm.dsnoop {
type dsnoop
ipc_key 5778293
ipc_key_add_uid yes
slave {
pcm 'hw:0,0'
period_time 0
period_size 128
buffer_size 2048
format S16_LE
rate 48000
}
}

Now as many programs as you want can all use the sound card simultaneously, both the output and the microphone! ESD-aware apps can use ESD, other apps will still work fine. 现在,你可以让你想要的软件全部同时使用声卡, 不管是输出还是和麦克风!ESD识别的应用程序可以使用ESD,另外的应用程序也一样可以正常工作. One notable misfeature of ESD is that it often ruins the A/V sync when playing videos. After setting up the software mixer, you might find it useful to turn esd off altogether (in tthe Sound control panel uncheck "Enable Software Mixing"). Now, especially with GStreamer 0.10, your movies should have perfect A/V sync. 一个ESD很显著的不好的特性就是在播放视频的时候它会破坏在音频与视频的同步.在设定好软件混合器以后, 你可能会发觉把esd关闭会有些帮助(在音频控制面板里边反选"开启software mixing'). 现在, 特别是在GStreamer 0.10下, 你的电影应该不会有音频和视频不同步发生了. It's a shame that software mixing isn't enabled on Ubuntu by default. software mixing在ubuntu的预设里边不是开启的.

More on Software Mixing

更多关于software mixing

A problem is the default config is OSS doesn't let 2 apps make sound at the same time. Here is a report of how it was dealt with: Basically get esd to relinquish control of the sound when its not in use. Then add mixing for oss so you can use multiple oss programs at once, like Quake3 and Teamspeak, or in my case, Wolfenstein and Teamspeak 在预设的情况下, oss不能让2个应用程序在用一时间发出声音. 这有一份报告是关于怎样解决这个问题的: 简单来说, 就是当esd不被用到的时候,让esd放弃对声音的控制. 然后为oss加入mixing,这样你就可以在同一时间应用多个oss应用程序,比如说 Quake3 和Teamspeak, 或者对我来说, 是Wolfenstein和Teamspeak. First use section 3 here: http://www.ubuntulinux.org/wiki/RestrictedFormats, then do this: http://alsa.opensrc.org/index.php?page=DmixPlugin 实现,用第3章:http://www.ubuntulinux.org/wiki/RestrictedFormats, 然后做: http://alsa.opensrc.org/index.php?page=DmixPlugin


  • Handy links:

帮助简便使用的链接" http://alsa.opensrc.org/index.php?page=OssEmulation


  • 文章来源:官方WIKI
    翻译人员:ShaunDu
    校对人员:
    文章状态:等待校对