Translated:Fix No Sound In Ubuntu 14.04 As HDMI Enabled By Default.md

This commit is contained in:
GOLinux 2014-07-21 19:18:42 +08:00
parent 460b708d97
commit fee8253f73
2 changed files with 63 additions and 62 deletions

View File

@ -1,62 +0,0 @@
Translating by GOLinux ...
Fix No Sound In Ubuntu 14.04 As HDMI Enabled BY Default
================================================================================
Sound problem is not new in Ubuntu. I have previously written on various ways to [fix “no sound” issue in Ubuntu][1]. But the soud issue I am going to discuss here is different than those mentioned in the other article.
So I installed Ubuntu 14.04, actually re-installed it. As always, I did all those [things to do after a fresh install of Ubuntu 14.04][2]. And than I realized that the system had no sound. While investigating the issue I found one strange thing. I checked [alsamixer][3] and it was in a weird state:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/06/alsamixer_Set_HDMI_Default.jpeg)
As you can see, **HDMI is set by default in alsamixer**. Which means by default HDMI output has been selected instead of the built in speakers. This is why I get no sound from the built in speakers in my system.
Use the following command to check the state of alsamixer:
alsamixer
If alsamixer is set by default to HDMI or some other audio output, continue this article to see how can we fix it.
### Fixing no sound in Ubuntu when HDMI is set as default ###
Now to force Ubuntu to use analog output instead of HDMI by default, we need a little information. Open a terminal and use the following command:
aplay -l
This will list the devices, card number etc. Note down the card and device number for analog output. For me the output was like this:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/07/AlsaMixer_List_Device.jpeg)
Once you have the required card and device number, make a new configuration file like this:
sudo gedit /etc/asound.conf
The above command will also open the file. Add the following lines to it, replacing with your card and device number of course:
defaults.pcm.card 1
defaults.pcm.device 0
Save the file and restart the computer. You should hear the sound now. Just to mention, this will work for all the Linux distributions such as Linux Mint, Elementary OS, Fedora, Arch Linux etc. As I said previously, this “no sound fix” only works with the case where HDMI is set by default. For other cases, you can read [this article about fixing no sound issue in Ubuntu and Linux Mint][4].
Feel free to use the comment section to let me know if it worked or not or if you have some better trick to handle this such issue. Ciao ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-includes/images/smilies/icon_smile.gif)
----------
![](http://1.gravatar.com/avatar/20749c268f5d3e4d2c785499eb6a17c0?s=100&r=pg&d=mm)
About Abhishek
I am Abhishek Prakash, 'creator' of It's F.O.S.S. I have a Masters in Communication System Engineering. I am an avid Linux lover and Open Source enthusiast. I use Ubuntu and believe in sharing knowledge. Apart from Linux, I love classic detective mystery. Huge fan of Agatha Christie work. Feel free to circle me on [Google Plus][g] and Follow [@abhishek_pc][t]
--------------------------------------------------------------------------------
via: http://itsfoss.com/fix-sound-ubuntu-1404/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://itsfoss.com/fix-sound-ubuntu-1304-quick-tip/
[2]:http://itsfoss.com/things-to-do-after-installing-ubuntu-14-04/
[3]:http://en.wikipedia.org/wiki/Alsamixer
[4]:http://itsfoss.com/fix-sound-ubuntu-1304-quick-tip/
[g]:https://plus.google.com/u/0/110180944531110746460
[t]:https://twitter.com/abhishek_pc

View File

@ -0,0 +1,63 @@
Ubuntu 14.04中修复默认启用HDMI后没有声音问题
================================================================================
声音问题在Ubuntu中是老生常谈了。先前我已经在[修复Ubuntu中的“无声”问题][1]一文中写到了多种方法,但是我在此正要谈及的声音问题跟在另外一篇文章中提到的不同。
因此我安装了Ubuntu 14.04,实际上是重新安装了一遍。一如既往,我将[全新安装Ubuntu 14.04后要做的事][2]全部又重新做了一遍。然后,我意识到系统突然失声了。当我正侦查问题所在之时,我发现了一件奇怪的事情。我检查了[alsamixer][3],发现它的状况有点离奇:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/06/alsamixer_Set_HDMI_Default.jpeg)
正如你能看到的,**alsamixer中默认设置了HDMI**。这意味着默认情况下将使用HDMI输出而不是内建扬声器。这就是我从系统上内建扬声器无法获得声音的原因。
使用下面的命令来检查alsamixer的状态
alsamixer
如果alsamixer默认设置成了HDMI或者其它声音输出那就继续读下去吧看看我们是怎么来修复这个问题的。
### 修复默认设置成HDMI时Ubuntu的失声问题 ###
现在来强制Ubuntu使用模拟输出来取代默认的HDMI但我们还需要一点点信息。打开终端然后使用下列命令
aplay -l
这会列出设备,卡号之类的东西。注意,向下检查模拟输出使用的卡和设备编号。对于我而言,输出看上去像这样:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/07/AlsaMixer_List_Device.jpeg)
一旦你取得了所需的卡和设备编号,重新构建一个配置文件:
sudo gedit /etc/asound.conf
上面的命令也会打开文件,将下面的行添加进去,当然将卡和设备编号替换成你自己的:
defaults.pcm.card 1
defaults.pcm.device 0
保存文件并重启计算机。现在你应该听到了声音了吧。需要提一下的是这对所有的Linux发行版都有效像Linux MintElementary OSFedoraArch Linux等等都行。正如我先前说的该“失声疗法”仅针对HDMI被设置为默认设备的情况。对于其它情况你可以阅读[关于在Ubuntu和Linux Mint中修复失声问题这篇文章][4]。
你可以尽情使用评论部分来告诉我这个方法是否有疗效,或者你有更好的方法来处理该问题,你也可以告诉我。再见了!
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-includes/images/smilies/icon_smile.gif)
----------
![](http://1.gravatar.com/avatar/20749c268f5d3e4d2c785499eb6a17c0?s=100&r=pg&d=mm)
关于Abhishek
我是Abhishek PrakashIt's F.O.S.S.的“创立者”我有一个通信系统工程的硕士学位。我酷爱Linux和开源。我使用Ubuntu信奉知识分享。除了Linux之外我也喜爱经典的侦探推理小说是Agatha Christie作品的超级粉丝。大家尽可以在[Google+][g]上将我圈进去,并追随[@abhishek_pc][t]
--------------------------------------------------------------------------------
via: http://itsfoss.com/fix-sound-ubuntu-1404/
译者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://itsfoss.com/fix-sound-ubuntu-1304-quick-tip/
[2]:http://itsfoss.com/things-to-do-after-installing-ubuntu-14-04/
[3]:http://en.wikipedia.org/wiki/Alsamixer
[4]:http://itsfoss.com/fix-sound-ubuntu-1304-quick-tip/
[g]:https://plus.google.com/u/0/110180944531110746460
[t]:https://twitter.com/abhishek_pc