通过扬声器和耳机播放声音

通过扬声器和耳机播放声音

我有一台华硕 ROG G752VY,双启动,安装了 win 10 和 Ubuntu 15.10

在 Windows 上一切都运行良好。切换到 Ubuntu 后,扬声器工作正常,但只要我插入耳机,就什么也不工作了。

我补充道

options snd-hda-intel model=asus-mode5(我也尝试了 asus-mode1 到 8)

/etc/modprobe.d/alsa-base.conf

耳机现在运行良好,但声音仍然通过扬声器播放。

跑步cat /proc/asound/card0/codec* | grep Codec我得到Codec: Realtek ALC668

另外,内置麦克风无法工作,尽管它在 Windows 下可以正常工作。

有任何想法吗?

编辑:自动静音已启用alsamixer

编辑 2:查看后发现,pavucontrol即使耳机已插入,它也会认为耳机未插入。它似乎将耳机视为扬声器的延伸,因为当我更改“扬声器”音量时,alsamixer它也会通过耳机更改音量。

编辑 3:输出$ pacmd list-sinks

$ pacmd list-sinks
2 sink(s) available.
    index: 0
    name: <alsa_output.pci-0000_01_00.1.hdmi-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: SUSPENDED
    suspend cause: IDLE 
    priority: 9050
    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: 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: 0 <alsa_card.pci-0000_01_00.1>
    module: 6
    properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "HDMI 0"
        alsa.id = "HDMI 0"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "3"
        alsa.card = "1"
        alsa.card_name = "HDA NVidia"
        alsa.long_card_name = "HDA NVidia at 0xdc080000 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/card1"
        device.bus = "pci"
        device.vendor.id = "10de"
        device.vendor.name = "NVIDIA Corporation"
        device.product.id = "0fbb"
        device.product.name = "GM204 High Definition Audio Controller"
        device.string = "hdmi:1"
        device.buffering.buffer_size = "65536"
        device.buffering.fragment_size = "32768"
        device.access_mode = "mmap+timer"
        device.profile.name = "hdmi-stereo"
        device.profile.description = "Digital Stereo (HDMI)"
        device.description = "GM204 High Definition Audio Controller Digital Stereo (HDMI)"
        alsa.mixer_name = "Nvidia GPU 71 HDMI/DP"
        alsa.components = "HDA:10de0071,10431ced,00100100"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    ports:
        hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
    active port: <hdmi-output-0>
  * index: 8
    name: <alsa_output.pci-0000_00_1f.3.analog-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: RUNNING
    suspend cause: 
    priority: 9959
    volume: front-left: 20375 /  31% / -30.44 dB,   front-right: 20375 /  31% / -30.44 dB
            balance 0.00
    base volume: 65536 / 100% / 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 9.82 ms
    max request: 2 KiB
    max rewind: 64 KiB
    monitor source: 11
    sample spec: s16le 2ch 44100Hz
    channel map: front-left,front-right
                 Stereo
    used by: 1
    linked by: 2
    configured latency: 11.61 ms; range is 0.50 .. 371.52 ms
    card: 1 <alsa_card.pci-0000_00_1f.3>
    module: 7
    properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "ALC668 Analog"
        alsa.id = "ALC668 Analog"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "0"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0xda128000 irq 327"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1f.3"
        sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "a170"
        device.product.name = "Sunrise Point-H HD Audio"
        device.form_factor = "internal"
        device.string = "front:0"
        device.buffering.buffer_size = "65536"
        device.buffering.fragment_size = "32768"
        device.access_mode = "mmap+timer"
        device.profile.name = "analog-stereo"
        device.profile.description = "Analogue Stereo"
        device.description = "Built-in Audio Analogue Stereo"
        alsa.mixer_name = "Realtek ALC668"
        alsa.components = "HDA:10ec0668,10431ced,00100003"
        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

首先,保持选项snd-hda-intel model=asus-mode5添加到/etc/modprobe.d/alsa-base.conf

禁用 pulseaudio 的自动生成功能并终止所有实例

$ echo autospawn = no >> /etc/pulse/client.conf
$ killall pulseaudio

检查是否有其他东西使用声卡

$ sudo fuser -v /dev/snd/*

确保杀死出现的任何东西并阻止其重生,如何做到这一点将取决于程序本身。

安装alsa-tools-gui

$ sudo apt-get install alsa-tools-gui
$ sudo hdajackretask

当 GUI 加载时,单击“显示未连接的引脚”,将第一个未连接的引脚覆盖为耳机插孔并应用设置。守护 pulseaudiopuslseaudio -D并测试声音,对所有未连接的端口重复此操作,直到找到正确的端口。

找到正确的插孔后,单击“安装引导覆盖”并重新启动以确保一切正常。现在编辑pulseaudio配置文件并删除之前添加的行以允许再次重生。

除非您重新启动,否则只能使用alsamixer而不是通常的 GUI 组件来修改卷。重新启动后,一切恢复正常。

相关内容