如何让我的 21.5 英寸 iMac 上的扬声器与 Ubuntu 配合使用?

如何让我的 21.5 英寸 iMac 上的扬声器与 Ubuntu 配合使用?

我最近在我的 iMac 21.5" 上全新安装了 Ubuntu 18.04(具体来说,我有 18.04.3 LTS)。我无法通过内置扬声器播放音频。音频耳机插入插孔后仍能正常工作。蓝牙音频基本无法工作(尽管我之前也遇到过声音不连贯的情况)。我想知道如何解决这个问题。我浏览了几个支持页面,但找不到任何地方能完全重现我的问题。我确实尝试了一些建议的方法,但都没有成功。我重新启动了pulseaudio守护进程,但这没有帮助。我还将我的用户帐户添加到了audio组中(可能已经这样做了),但这也没有改变任何东西。

在 中Settings > Sound,我确保选择了“扬声器 - 内置音频”,默认情况下是选中的。有些人似乎遇到了 HDMI 音频选项的问题,但我似乎没有遇到这种情况。如果能提供任何建议,我将不胜感激。我还想知道蓝牙音频问题是连接的还是独立的。

编辑:pavucontrol窗口(下面的屏幕截图)中,显示栏(音量下方的灰色栏)显示正在播放的声音。但是,我始终听不到任何声音。

在此处输入图片描述

几个请求的命令的输出:

$ pacmd list-cards
2 card(s) available.
    index: 0
    name: <alsa_card.pci-0000_00_03.0>
    driver: <module-alsa-card.c>
    owner module: 7
    properties:
        alsa.card = "0"
        alsa.card_name = "HDA Intel HDMI"
        alsa.long_card_name = "HDA Intel HDMI at 0xb1610000 irq 55"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:03.0"
        sysfs.path = "/devices/pci0000:00/0000:00:03.0/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "160c"
        device.product.name = "Broadwell-U Audio Controller"
        device.form_factor = "internal"
        device.string = "0"
        device.description = "Built-in Audio"
        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)
        output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 5200, available: no)
        output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (priority 100, available: no)
        output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (priority 100, available: no)
        output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (priority 5200, available: unknown)
        output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (priority 5200, available: no)
        output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (priority 100, available: no)
        output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) Output (priority 100, available: no)
        output:hdmi-stereo-extra4: Digital Stereo (HDMI 5) Output (priority 5200, available: no)
        output:hdmi-surround-extra4: Digital Surround 5.1 (HDMI 5) Output (priority 100, available: no)
        output:hdmi-surround71-extra4: Digital Surround 7.1 (HDMI 5) Output (priority 100, 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"
        hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
        hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: yes)
            properties:
                device.icon_name = "video-display"
                device.product.name = "iMac"
        hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
        hdmi-output-4: HDMI / DisplayPort 5 (priority 5500, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
    index: 1
    name: <alsa_card.pci-0000_00_1b.0>
    driver: <module-alsa-card.c>
    owner module: 8
    properties:
        alsa.card = "1"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0xb1614000 irq 52"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1b.0"
        sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card1"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "8ca0"
        device.product.name = "9 Series Chipset Family HD Audio Controller"
        device.form_factor = "internal"
        device.string = "1"
        device.description = "Built-in Audio"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    profiles:
        input:analog-stereo: Analog Stereo Input (priority 60, available: unknown)
        output:analog-stereo: Analog Stereo Output (priority 6000, available: unknown)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060, available: unknown)
        output:analog-surround-21: Analog Surround 2.1 Output (priority 800, available: unknown)
        output:analog-surround-21+input:analog-stereo: Analog Surround 2.1 Output + Analog Stereo Input (priority 860, available: unknown)
        output:analog-surround-40: Analog Surround 4.0 Output (priority 700, available: unknown)
        output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (priority 760, available: unknown)
        output:iec958-stereo: Digital Stereo (IEC958) Output (priority 5500, available: unknown)
        output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (priority 5560, available: unknown)
        off: Off (priority 0, available: unknown)
    active profile: <output:analog-stereo+input:analog-stereo>
    sinks:
        alsa_output.pci-0000_00_1b.0.analog-stereo/#0: Built-in Audio Analog Stereo
    sources:
        alsa_output.pci-0000_00_1b.0.analog-stereo.monitor/#0: Monitor of Built-in Audio Analog Stereo
        alsa_input.pci-0000_00_1b.0.analog-stereo/#1: Built-in Audio Analog Stereo
    ports:
        analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: unknown)
            properties:
                device.icon_name = "audio-input-microphone"
        analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-input-microphone"
        analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)
            properties:
                device.icon_name = "audio-speakers"
        analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-headphones"
        iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
            properties:

$ pacmd list-sinks
1 sink(s) available.
  * index: 0
    name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL LATENCY DYNAMIC_LATENCY
    state: SUSPENDED
    suspend cause: IDLE 
    priority: 9039
    volume: front-left: 48507 /  74%,   front-right: 48507 /  74%
            balance 0.00
    base volume: 65536 / 100%
    volume steps: 128
    muted: no
    current latency: 0.00 ms
    max request: 0 KiB
    max rewind: 0 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 .. 371.52 ms
    card: 1 <alsa_card.pci-0000_00_1b.0>
    module: 8
    properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "CS4208 Analog"
        alsa.id = "CS4208 Analog"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "1"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0xb1614000 irq 52"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1b.0"
        sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card1"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "8ca0"
        device.product.name = "9 Series Chipset Family HD Audio Controller"
        device.form_factor = "internal"
        device.string = "front:1"
        device.buffering.buffer_size = "65536"
        device.buffering.fragment_size = "32768"
        device.access_mode = "mmap+timer"
        device.profile.name = "analog-stereo"
        device.profile.description = "Analog Stereo"
        device.description = "Built-in Audio Analog Stereo"
        alsa.mixer_name = "Cirrus Logic CS4208"
        alsa.components = "HDA:10134208,106b8100,00100300"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    ports:
        analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)
            properties:
                device.icon_name = "audio-speakers"
        analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-headphones"
    active port: <analog-output-speaker>

答案1

我遇到了相同或非常相似的问题,但我发现如果我进入 pavucontrol 中的配置,会列出 2 个设备。我认为第一个是 HDMI。第二个似乎是内置扬声器,但出于某种原因,我无法理解只有当我将其设置为 2.1 或 4.0 环绕声时,声音才会从立体声扬声器中发出。

还必须确保我的 PCM 已在 alsamixer 中打开。

此时,我听到左右声道似乎来自同一个扬声器。不过很难确定。右声道低音清晰,左声道声音细小安静。不过肯定比没有声音好。

但是系统音量不会改变音量。为了实现这一点,我必须编辑 /usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common 并添加以下内容

[Element Master]
switch = mute
volume = ignore

就在这一部分的上方:

[Element PCM]
switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right

我知道这篇文章已经很旧了,但希望它能对某些人有所帮助,因为我花了 4 个小时在谷歌上搜索才弄清楚。

在这里您可以看到我的有效设置。

答案2

检查发声应用程序的声音是否被传送到扬声器,以及 pulseaudio 音量控制 (pavucontrol) 上的音量是否设置正确。“播放”和“输出设备”菜单应该相关。这也应该扩展到您的蓝牙设备,因为您似乎没有遇到连接到它的问题。

alsamixer 也是一个应用程序,您可以查看它来判断您的扬声器是否性能良好。

相关内容