5

Hello after numerous hours of google searching, I am drawing a blank.

I have successfully configured audio in 18.04 but require help to change the priority of the port devices. Speakers should take priority! they are currently as follows:

"$ pactl list sinks
Sink #0
    State: RUNNING
    Name: alsa_output.pci-0000_00_1f.3.analog-stereo
    Description: Built-in Audio Analogue Stereo
    Driver: module-alsa-card.c
    Sample Specification: s16le 2ch 44100Hz
    Channel Map: front-left,front-right
    Owner Module: 8
    Mute: no
    Volume: front-left: 35388 /  54% / -16.06 dB,   front-right: 35388 /  54% / -16.06 dB
            balance 0.00
    Base Volume: 65536 / 100% / 0.00 dB
    Monitor Source: alsa_output.pci-0000_00_1f.3.analog-stereo.monitor
    Latency: 39638 usec, configured 40000 usec
    Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
    Properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "ALC299 Analog"
        alsa.id = "ALC299 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 0x404a100000 irq 142"
        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 = "a348"
        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 ALC299"
        alsa.components = "HDA:10ec0299,10251243,00100002"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    Ports:
        analog-output-speaker: Speakers (priority: 10000, not available)
        analog-output-headphones: Headphones (priority: 9000, available)
    Active Port: analog-output-speaker
    Formats:
        pcm
"

The Headphone output works fine but there is a problem with the jack detection (I assume ubuntu thinks there is one plugged in)

So, the question: Is there a way to change the priority of output modes in pulseaudio and or fix jack detection in 18.04?

It is driving me mad changing output port every time I boot (Dual-booting with windows 10 - Separate partition)

Kulfy
  • 17,696
  • I have the same problem. Raising priority doesn't help because Ubuntu counts the speakers as "not available". I solved it by adding pactl set-sink-port 0 analog-output-speaker to startup applications. – Monsignor Nov 14 '20 at 17:34

1 Answers1

4

By changing GUI manually, you can install Pulse Audio Volume Control

sudo apt install pavucontrol

Open application and select which audio stream to be set.

To set a certain output at startup, you can write the code into the startup items or ~/.bashrc or ~/.profile, even registering some shortcuts to switch between outputs are useful.

Set shortcut Settings > Keyboard > Shortcuts > Custom Shortcuts Alt+L.

 pactl set-sink-port 0 analog-output-speaker

Set Alt+H

pactl set-sink-port 0 analog-output-headphones

Also you can make the speaker priority higher than headphones.

How can I change PulseAudio port priorities?

AEM
  • 1,166