如何修复 Ubuntu 18.04 上没有声音?

     2023-02-25     134

关键词:

【中文标题】如何修复 Ubuntu 18.04 上没有声音?【英文标题】:How to fix No sound on Ubuntu 18.04? 【发布时间】:2020-05-06 19:08:42 【问题描述】:

1) 几个月来,我一直在使用带有 Windows 10 双启动的 Ubuntu 18.04。今天突然我的声音停止在 Ubunutu 上工作。活动 -> 声音菜单仅显示“虚拟输出”。不过在 Windows 上一切正常。

2) lsmod 的输出是:

rohit@rohitUb18043LTS:~$ lsmod | grep snd_
snd_seq_midi           20480  0
snd_seq_midi_event     16384  1 snd_seq_midi
snd_seq                69632  2 snd_seq_midi,snd_seq_midi_event
snd_rawmidi            36864  1 snd_seq_midi
snd_seq_device         16384  3 snd_seq,snd_seq_midi,snd_rawmidi
snd_soc_dmic           16384  0
snd_hda_codec_realtek   118784  0
snd_hda_codec_generic    81920  1 snd_hda_codec_realtek
ledtrig_audio          16384  2 snd_hda_codec_generic,snd_hda_codec_realtek
snd_soc_hdac_hdmi      32768  0
snd_sof_intel_hda_common    73728  1 sof_pci_dev
snd_soc_hdac_hda       24576  1 snd_sof_intel_hda_common
snd_sof_intel_hda      20480  1 snd_sof_intel_hda_common
snd_sof_intel_byt      24576  1 sof_pci_dev
snd_sof_intel_ipc      20480  1 snd_sof_intel_byt
snd_sof                98304  4 snd_sof_intel_hda_common,snd_sof_intel_byt,snd_sof_intel_ipc,sof_pci_dev
snd_sof_xtensa_dsp     16384  1 sof_pci_dev
snd_hda_ext_core       28672  4 snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_hdac_hda,snd_sof_intel_hda
snd_soc_acpi_intel_match    32768  2 snd_sof_intel_hda_common,sof_pci_dev
snd_soc_acpi           16384  2 snd_soc_acpi_intel_match,sof_pci_dev
snd_soc_core          237568  5 snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_hdac_hda,snd_soc_dmic
snd_compress           24576  1 snd_soc_core
ac97_bus               16384  1 snd_soc_core
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_hda_codec_hdmi     57344  1
snd_hda_intel          53248  2
snd_intel_nhlt         20480  1 snd_hda_intel
snd_hda_codec         131072  5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek,snd_soc_hdac_hda
snd_hda_core           90112  10 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_hda_codec_realtek,snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_hdac_hda,snd_sof_intel_hda
snd_hwdep              20480  1 snd_hda_codec
snd_pcm               102400  10 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_core,snd_hda_core,snd_pcm_dmaengine
snd_timer              36864  2 snd_seq,snd_pcm
snd                    86016  17 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_compress,snd_soc_core,snd_pcm,snd_rawmidi
rohit@rohitUb18043LTS:~$

3) 我从软件更新程序安装了所有更新,但没有成功。

4) 使用没有改变:sudo alsa force-reload

5) 环顾四周,发现这个帖子:https://askubuntu.com/questions/1059619/sound-card-shown-as-dummy-output-in-ubuntu-18-04。用户说发现“活动配置文件已关闭”并链接到此论坛上的解决方案 (https://forums.linuxmint.com/viewtopic.php?t=268499)。我正在根据该链接粘贴四个命令的输出:

rohit@rohitUb18043LTS:~$ sudo fuser -v /dev/snd/*
[sudo] password for rohit: 
                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  gdm        1505 F.... pulseaudio
                     rohit      1878 F.... pulseaudio
rohit@rohitUb18043LTS:~$ pacmd list-cards
1 card(s) available.
    index: 0
    name: <alsa_card.pci-0000_01_00.1>
    driver: <module-alsa-card.c>
    owner module: 7
    properties:
        alsa.card = "0"
        alsa.card_name = "HDA NVidia"
        alsa.long_card_name = "HDA NVidia at 0xb4000000 irq 17"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:01:00.1"
        sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card0"
        device.bus = "pci"
        device.vendor.id = "10de"
        device.vendor.name = "NVIDIA Corporation"
        device.product.id = "0fb9"
        device.product.name = "GP107GL High Definition Audio Controller"
        device.string = "0"
        device.description = "GP107GL High Definition Audio Controller"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    profiles:
        output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5400, available: no)
        output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (priority 300, available: no)
        output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (priority 300, available: no)
        off: Off (priority 0, available: unknown)
    active profile: <off>
    ports:
        hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
rohit@rohitUb18043LTS:~$ pacmd list-sinks
1 sink(s) available.
  * index: 0
    name: <auto_null>
    driver: <module-null-sink.c>
    flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: SUSPENDED
    suspend cause: IDLE 
    priority: 1000
    volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB
            balance 0,00
    base volume: 65536 / 100% / 0,00 dB
    volume steps: 65537
    muted: no
    current latency: 0,00 ms
    max request: 344 KiB
    max rewind: 344 KiB
    monitor source: 0
    sample spec: s16le 2ch 44100Hz
    channel map: front-left,front-right
                 Stereo
    used by: 0
    linked by: 0
    configured latency: 0,00 ms; range is 0,50 .. 2000,00 ms
    module: 15
    properties:
        device.description = "Dummy Output"
        device.class = "abstract"
        device.icon_name = "audio-card"
rohit@rohitUb18043LTS:~$ pacmd list-sink-inputs
0 sink input(s) available.
rohit@rohitUb18043LTS:~$

6) 我尝试了建议的命令,但它显示“没有这样的配置文件”。

rohit@rohitUb18043LTS:~$ pacmd set-card-profile alsa_card.pci-0000_01_00.1 output:analog-stereo+input:analog-stereo
No such profile: output:analog-stereo+input:analog-stereo
rohit@rohitUb18043LTS:~$

请帮忙 - 我该怎么做?

【问题讨论】:

更新:我还尝试了按照以下链接删除和重新加载驱动程序的步骤 - 请参阅 Roberto Gimenez 的回答:askubuntu.com/questions/1081748/no-sound-on-ubuntu-18-04。运气不好! 更新 2:还尝试了 pacmd set-card-profile alsa_card.pci-0000_01_00.1 output:hdmi-stereo 并设置了配置文件。但是设置->声音显示为空白且没有用。为“输出:hdmi-surround”和“输出:hdmi-surround71”配置文件尝试了同样的事情。所以恢复为“关闭”配置文件。 更新 3:从未修复过。谢天谢地 20.04LTS 出来了,没有等待完整的 20.04.1 版本,我升级了,谢天谢地! 【参考方案1】:

Ubuntu 18.04 上的“Dummy Sound”也存在类似问题,同样使用 NVIDIA 卡。这为我解决了这个问题:

    以 root 身份编辑 /etc/modprobe.d/alsa-base.conf 并添加 options snd-hda-intel dmic_detect=0 以 root 身份编辑 /etc/modprobe.d/blacklist.conf 并在文件末尾添加 blacklist snd_soc_skl。 进行这些更改后,重新启动系统。

更多详情(和学分):https://www.linuxuprising.com/2018/06/fix-no-sound-dummy-output-issue-in.html

【讨论】:

感谢您的建议。正如我在上面的更新中所评论的,我升级到了 20.04LTS,现在这个问题已经解决了。但是如果(希望不是!)需要,会回到这个。干杯。 更新:在 Ubuntu 20.04LTS 上也开始面临问题。遵循您的部分建议 - 仅添加了 dmic_detect 行,没有黑名单。它现在工作。非常感谢!【参考方案2】:

我遇到了同样的问题,尝试了@maartenor给出的解决方案,但没有成功。

最终我通过将 linux 内核升级到最后一个 HWE stack 来恢复声音,对我来说是 4.15.0-106-generic5.3.0-59-generic。

执行此操作的命令:

$ sudo apt install linux-generic-hwe-18.04

【讨论】:

【参考方案3】:

编辑文件 /etc/modprobe.d/alsa-base.conf 并添加以下行:

选项 snd-hda-intel dmic_detect=0

选项 snd-hda-intel model=laptop-amic enable=yes

第一行是启用扬声器,第二行是启用内置麦克风。

祝你好运!

从 Reddit 得到这个答案。对我来说就像一个魅力!

链接:https://www.reddit.com/r/linuxmint/comments/fltlrl/no_sound_on_acer_swift_3_with_kernel_53/

【讨论】:

更新:在 Ubuntu 20.04LTS 上也开始面临问题。遵循您的建议,仅添加了第一行。它现在工作。非常感谢!【参考方案4】:

试试这个..

    打开你的终端 sudo apt update && sudo apt install alsamixer 在终端中运行 alsamixer。 按向右箭头,直到转到声音选项(如果耳机转到 HEADPHONES 栏)。 按 M 取消静音。 按上/下可调节音量。 按 Esc 退出 alsamixer。

【讨论】:

【参考方案5】:

以下步骤非常可靠。它不会永久修复挂起后丢失音频的问题,而是立即作为从挂起返回后运行的命令。

使用 lspci 获取声卡位置 (0000:00:1f.3)。在我的机器上,

$ lspci
00:1f.0 ISA bridge: Intel Corporation H110 ...
00:1f.2 Memory controller: Intel ...
00:1f.3 Audio device: Intel Corporation 100 Series/C230 Series Chipset ...
00:1f.4 SMBus: Intel Corporation 100 Series/C230 Series Chipset ...

然后,(确保下面的目录存在)

$ echo 1 | sudo tee /sys/bus/pci/devices/0000:00:1f.3/remove
$ echo 1 | sudo tee /sys/bus/pci/rescan

我相信音频驱动程序/硬件卡住了。所以我们删除了设备驱动程序,然后重新扫描 PCI 总线以获取音频。

【讨论】:

【参考方案6】:

我发现上面的答案在我的电脑上不起作用,我偶然解决了这个问题,这是我使用的脚本,与上面的答案大部分相同,但最后,你需要静音然后取消静音。如果您将脚本放入 sh 文件然后执行它,则在此处需要命令后休眠片刻,使用 sh -c 用于 root 的文件重定向

REST=0.5
#make sure Audio always actived
sudo sh -c 'echo 1 >/sys/bus/pci/rescan'
sleep $REST
DEVICE_ID=$(lspci -D | grep Audio | awk 'print $1')
sleep $REST
sudo sh -c 'echo 1 >/sys/bus/pci/devices/0000:00:1f.3/remove'
sleep $REST
sudo sh -c 'echo 1 >/sys/bus/pci/rescan'
sleep $REST
#mute then unmute to restart audio
amixer -D pulse sset Master mute
sleep $REST
amixer -D pulse sset Master unmute

【讨论】:

如何修复“视频播放但在带有 expo 的 iOS 上没有声音”

】如何修复“视频播放但在带有expo的iOS上没有声音”【英文标题】:Howtofix\'Videoplaybutdon\'thavesoundoniOSwithexpo\'【发布时间】:2019-08-0608:05:49【问题描述】:我使用世博会的视频组件。我可以播放视频,但在iOS中没有声音。在安卓... 查看详情

如何修复:device_list:270:找不到声卡(Ubuntu 服务器 18.04)?

】如何修复:device_list:270:找不到声卡(Ubuntu服务器18.04)?【英文标题】:Howtofix:device_list:270:nosoundcardfound(Ubuntuserver18.04)?【发布时间】:2019-04-2406:10:48【问题描述】:我试图使用USB麦克风捕捉一些音频,但我收到了标题中提到... 查看详情

部署到 Ubuntu 18.04 服务器后如何在 Laravel 中修复“未捕获的 ReflectionException:类视图不存在”

】部署到Ubuntu18.04服务器后如何在Laravel中修复“未捕获的ReflectionException:类视图不存在”【英文标题】:Howtofix"UncaughtReflectionException:Classviewdoesnotexist"inLaravelafterdeploymenttoUbuntu18.04server【发布时间】:2020-02-1208:12:52【问题... 查看详情

如何在虚拟机Ubuntu 18.04上安装catkin

】如何在虚拟机Ubuntu18.04上安装catkin【英文标题】:HowtoinstallcatkinonavirtualmachineUbuntu18.04【发布时间】:2019-09-2317:11:48【问题描述】:我觉得我有靛蓝...我按照说明操作:https://wiki.ros.org/catkin#Installing_catkin有人可以帮我解决这个问... 查看详情

如何在专用 Ubuntu 18.04 服务器上激活 IPv6?

】如何在专用Ubuntu18.04服务器上激活IPv6?【英文标题】:HowtoactivateIPv6ondedicatedUbuntu18.04server?【发布时间】:2022-01-1012:57:46【问题描述】:大家!我不是专家,而是兼职管理员;如果问题太简单,请原谅:如何在我的专用Ubuntu18.04... 查看详情

如何在 ubuntu 18.04 上设置 oracle 即时客户端?

】如何在ubuntu18.04上设置oracle即时客户端?【英文标题】:howdoisetuporacleinstantclientonubuntu18.04?【发布时间】:2021-04-1101:16:12【问题描述】:所以我试图在zabbix上通过ODBC监控oracle数据库,但是我的zabbix服务器是ubuntu18.04,我真的很... 查看详情

如何允许节点在 Ubuntu 18.04 上监听 1024 以下的端口?

】如何允许节点在Ubuntu18.04上监听1024以下的端口?【英文标题】:HowcanIallownodetolistentoportsbelow1024onUbuntu18.04?【发布时间】:2019-04-2523:08:49【问题描述】:我可以在安装了nvm的节点中使用任何大于1023的PORT和server.listen(PORT)。非特权... 查看详情

如何在 Ubuntu 18.04 上安装最新的 openjdk 12

】如何在Ubuntu18.04上安装最新的openjdk12【英文标题】:Howtoinstallthelatestopenjdk12onUbuntu18.04【发布时间】:2019-09-2102:10:43【问题描述】:我已经通过发出命令安装了默认jdk:apt-getinstalldefault-jdk这将安装openjdk11并且apt-get似乎将文件安... 查看详情

pip

如何在Ubuntu18.04上安装Pip[日期:2018-05-15] 来源:Linux公社作者:醉落红尘 [字体:大中小]Pip是一个软件包管理系统,它简化了用Python编写的软件包(如Python包索引(PyPI)中的软件包)的安装和管理。在Ubuntu18.04上缺省没有安装Pip... 查看详情

pip

如何在Ubuntu18.04上安装Pip[日期:2018-05-15] 来源:Linux公社作者:醉落红尘 [字体:大中小]Pip是一个软件包管理系统,它简化了用Python编写的软件包(如Python包索引(PyPI)中的软件包)的安装和管理。在Ubuntu18.04上缺省没有安装Pip... 查看详情

GCE 启动脚本无法在 Ubuntu 18.04 上运行

】GCE启动脚本无法在Ubuntu18.04上运行【英文标题】:GCEstartupscriptfailstorunonUbuntu18.04【发布时间】:2018-10-2912:54:13【问题描述】:我正在使用gcloudcompute在GCP上启动一个实例,并使用元数据参数指定我的脚本的URL。脚本无法运行,当... 查看详情

PHP - cronjob 无法在 Ubuntu 18.04 上执行 [关闭]

】PHP-cronjob无法在Ubuntu18.04上执行[关闭]【英文标题】:PHP-cronjobfailingtoexecuteonUbuntu18.04[closed]【发布时间】:2022-01-2302:59:26【问题描述】:我有一个PHP文件,我想将其作为cron作业运行。在服务器上,该文件位于/var/www/html/directory/fi... 查看详情

在 Ubuntu 18.04 WSL 上安装无人值守的 MySQL 8 社区

】在Ubuntu18.04WSL上安装无人值守的MySQL8社区【英文标题】:UnatttendedMySQL8communityinstallonUbuntu18.04WSL【发布时间】:2019-11-1723:43:49【问题描述】:我正在尝试在没有任何提示的情况下在Ubuntu(即Linux的Windows子系统)上安装MySQL8。我有... 查看详情

Erlang 没有从 Ubuntu 18.04 卸载

】Erlang没有从Ubuntu18.04卸载【英文标题】:ErlangisnotgettinguninstalledfromUbuntu18.04【发布时间】:2019-04-0206:01:41【问题描述】:我有一个Ubuntu-18.04aws实例。我已经按照此链接https://hostpresto.com/community/tutorials/how-to-install-erlang-on-ubuntu-16-04... 查看详情

在ubuntu18.04上使用静态可执行文件安装dockerce及后续设置(代码片段)

在Ubuntu18.04上使用静态可执行文件安装DockerCE及后续设置前几天安装了最新的Ubuntu18.04LTS,想在上面安装一个docker,结果发现docker官方的软件源里没有Ubuntu18.04的安装包版本,可能是系统太新了,官方还没来得及制... 查看详情

在ubuntu18.04上安装nvidia驱动(代码片段)

...悉配置啥的。所以首先是在裸机上安装Nvidia驱动。环境:Ubuntu18.04 刚安装完系统,当然是把软件更新器提出的下载更新给下载一下了。所以首先应该是1sudoapt-getupdate当然,上述是系统主动提出的更新,并没有输入指令啦~接下... 查看详情

window10更新,覆盖ubuntu18.04,导致ubuntu丢失,无法启动

...dn.net/qq_34562959/article/details/81095716),甚至也有用windows系统修复的,但是在我这边都不起作用。window覆盖ubuntu的原因是,电脑只有一块ssd两个系统被安装在同一块硬盘上,所以会出现比较严重的问题。建议读者在各种方法失效的情... 查看详情

在 Ubuntu 18.04 上安装 RVM 时出错

】在Ubuntu18.04上安装RVM时出错【英文标题】:ErrorwhileinstallingRVMonUbuntu18.04【发布时间】:2018-12-2723:54:54【问题描述】:我尝试在新版本的Ubuntu18.04上安装RVM。但是我收到以下错误:"Errorrunning\'requirements_debian_libs_installgawkg++gccautoconf... 查看详情