luisbocanegra / linux-guide-split-audio-ports

Split jack(headphones)/speakers outputs into individual sinks on Linux to allow simultaneous playback (listen to different audio streams on each port)
42 stars 4 forks source link

Stuck at step 2.4 #17

Open alanxptm opened 1 month ago

alanxptm commented 1 month ago

Hello I get that in step 2.2 I have to change the description-key from analog-output-lineout (my speakers) But I have done that, with every file with that name at /usr and /etc. Then I restart pipewire but there are no changes in the descriptions at the sink output. I need some help to get through this.

SYS INFO

OS   Arch Linux
Ke   Linux 6.6.52-1-lts
Sh   zsh 5.9
Te   xfce4-terminal
LM   sddm 0.21.0 (X11)
DE   Xfce4 4.18
WM   Xfwm4 (X11)

CODECS

Codec: Nvidia GPU a5 HDMI/DP
Address: 0
Vendor Id: 0x10de00a5
Subsystem Id: 0x104388ed
Codec: Realtek ALCS1200A
Address: 0
Vendor Id: 0x10ec0b00
Subsystem Id: 0x10438797

CARDS

Card #50
    Name: alsa_card.pci-0000_0a_00.4
    Driver: alsa
    Owner Module: n/a
    Properties:
        api.acp.auto-port = "false"
        api.alsa.card = "1"
        api.alsa.card.longname = "HD-Audio Generic at 0xfc400000 irq 100"
        api.alsa.card.name = "HD-Audio Generic"
        api.alsa.path = "hw:1"
        api.alsa.use-acp = "true"
        api.dbus.ReserveDevice1 = "Audio1"
        api.dbus.ReserveDevice1.Priority = "-20"
        device.api = "alsa"
        device.bus = "pci"
        device.bus_path = "pci-0000:0a:00.4"
        device.description = "Starship/Matisse HD Audio Controller"
        device.enum.api = "udev"
        device.icon_name = "audio-card-analog-pci"
        device.name = "alsa_card.pci-0000_0a_00.4"
        device.nick = "HD-Audio Generic"
        device.plugged.usec = "5557062"
        device.product.id = "0x1487"
        device.product.name = "Starship/Matisse HD Audio Controller"
        device.subsystem = "sound"
        sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:0a:00.4/sound/card1"
        device.vendor.id = "0x1022"
        device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
        media.class = "Audio/Device"
        factory.id = "15"
        client.id = "47"
        object.id = "50"
        object.serial = "50"
        object.path = "alsa:acp:Generic"
        alsa.card = "1"
        alsa.card_name = "HD-Audio Generic"
        alsa.long_card_name = "HD-Audio Generic at 0xfc400000 irq 100"
        alsa.driver_name = "snd_hda_intel"
        alsa.mixer_name = "Realtek ALCS1200A"
        alsa.components = "HDA:10ec0b00,10438797,00100001"
        alsa.id = "Generic"
        device.string = "1"
    Profiles:
        off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6565, available: yes)
        output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6500, available: yes)
        output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5565, available: yes)
        output:iec958-stereo: Digital Stereo (IEC958) Output (sinks: 1, sources: 0, priority: 5500, available: yes)
        output:analog-surround-21+input:analog-stereo: Analog Surround 2.1 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 1365, available: yes)
        output:analog-surround-41+input:analog-stereo: Analog Surround 4.1 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 1365, available: yes)
        output:analog-surround-51+input:analog-stereo: Analog Surround 5.1 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 1365, available: yes)
        output:analog-surround-21: Analog Surround 2.1 Output (sinks: 1, sources: 0, priority: 1300, available: yes)
        output:analog-surround-41: Analog Surround 4.1 Output (sinks: 1, sources: 0, priority: 1300, available: yes)
        output:analog-surround-51: Analog Surround 5.1 Output (sinks: 1, sources: 0, priority: 1300, available: yes)
        output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 1265, available: yes)
        output:analog-surround-50+input:analog-stereo: Analog Surround 5.0 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 1265, available: yes)
        output:analog-surround-40: Analog Surround 4.0 Output (sinks: 1, sources: 0, priority: 1200, available: yes)
        output:analog-surround-50: Analog Surround 5.0 Output (sinks: 1, sources: 0, priority: 1200, available: yes)
        output:iec958-ac3-surround-51+input:analog-stereo: Digital Surround 5.1 (IEC958/AC3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 365, available: no)
        output:iec958-ac3-surround-51: Digital Surround 5.1 (IEC958/AC3) Output (sinks: 1, sources: 0, priority: 300, available: yes)
        input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 65, available: no)
        pro-audio: Pro Audio (sinks: 2, sources: 2, priority: 1, available: yes)
    Active Profile: output:analog-stereo+input:analog-stereo
    Ports:
        analog-input-front-mic: Front Microphone (type: Mic, priority: 8500, latency offset: 0 usec, availability group: Legacy 1, not available)
            Properties:
                port.type = "mic"
                port.availability-group = "Legacy 1"
                device.icon_name = "audio-input-microphone"
                card.profile.port = "0"
            Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-21+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:analog-surround-41+input:analog-stereo, output:analog-surround-50+input:analog-stereo, output:analog-surround-51+input:analog-stereo, output:iec958-stereo+input:analog-stereo, output:iec958-ac3-surround-51+input:analog-stereo
        analog-input-rear-mic: Rear Microphone (type: Mic, priority: 8200, latency offset: 0 usec, availability group: Legacy 2, not available)
            Properties:
                port.type = "mic"
                port.availability-group = "Legacy 2"
                device.icon_name = "audio-input-microphone"
                card.profile.port = "1"
            Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-21+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:analog-surround-41+input:analog-stereo, output:analog-surround-50+input:analog-stereo, output:analog-surround-51+input:analog-stereo, output:iec958-stereo+input:analog-stereo, output:iec958-ac3-surround-51+input:analog-stereo
        analog-input-linein: Line In (type: Line, priority: 8100, latency offset: 0 usec, availability group: Legacy 3, not available)
            Properties:
                port.type = "line"
                port.availability-group = "Legacy 3"
                card.profile.port = "2"
            Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-21+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:analog-surround-41+input:analog-stereo, output:analog-surround-50+input:analog-stereo, output:analog-surround-51+input:analog-stereo, output:iec958-stereo+input:analog-stereo, output:iec958-ac3-surround-51+input:analog-stereo
        analog-output-lineout: analog-output-lineout (type: Unknown, priority: 9000, latency offset: 0 usec, availability group: Legacy 4, available)
            Properties:
                port.type = "unknown"
                port.availability-group = "Legacy 4"
                card.profile.port = "3"
            Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-21, output:analog-surround-21+input:analog-stereo, output:analog-surround-40, output:analog-surround-40+input:analog-stereo, output:analog-surround-41, output:analog-surround-41+input:analog-stereo, output:analog-surround-50, output:analog-surround-50+input:analog-stereo, output:analog-surround-51, output:analog-surround-51+input:analog-stereo
        analog-output-headphones: Headphones (type: Headphones, priority: 9900, latency offset: 0 usec, availability group: Legacy 5, not available)
            Properties:
                port.type = "headphones"
                port.availability-group = "Legacy 5"
                device.icon_name = "audio-headphones"
                card.profile.port = "4"
            Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo
        iec958-stereo-output: Digital Output (S/PDIF) (type: SPDIF, priority: 0, latency offset: 0 usec, availability unknown)
            Properties:
                port.type = "spdif"
                card.profile.port = "5"
            Part of profile(s): output:iec958-stereo, output:iec958-stereo+input:analog-stereo

SINKS

Sink #52
    State: SUSPENDED
    Name: alsa_output.pci-0000_0a_00.4.analog-stereo
    Description: Starship/Matisse HD Audio Controller Analog Stereo
    Driver: PipeWire
    Sample Specification: s32le 2ch 48000Hz
    Channel Map: front-left,front-right
    Owner Module: 4294967295
    Mute: no
    Volume: front-left: 32767 /  50% / -18.06 dB,   front-right: 32767 /  50% / -18.06 dB
            balance 0.00
    Base Volume: 65536 / 100% / 0.00 dB
    Monitor Source: alsa_output.pci-0000_0a_00.4.analog-stereo.monitor
    Latency: 0 usec, configured 0 usec
    Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
    Properties:
        alsa.card = "1"
        alsa.card_name = "HD-Audio Generic"
        alsa.class = "generic"
        alsa.components = "HDA:10ec0b00,10438797,00100001"
        alsa.device = "0"
        alsa.driver_name = "snd_hda_intel"
        alsa.id = "Generic"
        alsa.long_card_name = "HD-Audio Generic at 0xfc400000 irq 100"
        alsa.mixer_name = "Realtek ALCS1200A"
        alsa.name = "ALCS1200A Analog"
        alsa.resolution_bits = "16"
        alsa.subclass = "generic-mix"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.sync.id = "00000000:00000000:00000000:00000000"
        api.alsa.card.longname = "HD-Audio Generic at 0xfc400000 irq 100"
        api.alsa.card.name = "HD-Audio Generic"
        api.alsa.path = "front:1"
        api.alsa.pcm.card = "1"
        api.alsa.pcm.stream = "playback"
        audio.channels = "2"
        audio.position = "FL,FR"
        card.profile.device = "5"
        device.api = "alsa"
        device.class = "sound"
        device.id = "50"
        device.profile.description = "Analog Stereo"
        device.profile.name = "analog-stereo"
        device.routes = "2"
        factory.name = "api.alsa.pcm.sink"
        media.class = "Audio/Sink"
        device.description = "Starship/Matisse HD Audio Controller"
        node.name = "alsa_output.pci-0000_0a_00.4.analog-stereo"
        node.nick = "ALCS1200A Analog"
        node.pause-on-idle = "false"
        object.path = "alsa:acp:Generic:5:playback"
        port.group = "playback"
        priority.driver = "1009"
        priority.session = "1009"
        factory.id = "19"
        clock.quantum-limit = "8192"
        client.id = "47"
        node.driver = "true"
        node.loop.name = "data-loop.0"
        library.name = "audioconvert/libspa-audioconvert"
        object.id = "52"
        object.serial = "52"
        api.acp.auto-port = "false"
        api.alsa.card = "1"
        api.alsa.use-acp = "true"
        api.dbus.ReserveDevice1 = "Audio1"
        api.dbus.ReserveDevice1.Priority = "-20"
        device.bus = "pci"
        device.bus_path = "pci-0000:0a:00.4"
        device.enum.api = "udev"
        device.icon_name = "audio-card-analog-pci"
        device.name = "alsa_card.pci-0000_0a_00.4"
        device.nick = "HD-Audio Generic"
        device.plugged.usec = "5557062"
        device.product.id = "0x1487"
        device.product.name = "Starship/Matisse HD Audio Controller"
        device.subsystem = "sound"
        sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:0a:00.4/sound/card1"
        device.vendor.id = "0x1022"
        device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
        device.string = "1"
    Ports:
        analog-output-lineout: analog-output-lineout (type: Unknown, priority: 9000, availability group: Legacy 4, available)
        analog-output-headphones: Headphones (type: Headphones, priority: 9900, availability group: Legacy 5, not available)
    Active Port: analog-output-lineout
    Formats:
        pcm
luisbocanegra commented 1 month ago

It's working, the wording in the guide is confusing, what you should normally see without changing the description-key value is the user friendly name of the port, in your case Line Out

analog-output-lineout: Line Out (type: Line, priority...

After making the change to something that does not match (a profile?) it will show the filename of the mixer path you edited.

analog-output-lineout: analog-output-lineout (type: Unknown, priority...

Also type: will become Unknown and I forgot to mention that in the guide, doing so would have made it more obvious that something changed.

alanxptm commented 1 month ago

Thanks for that! I didn't notice the change until you pointed out.

Now at 2.4 I have added the lines to analog-output-lineout.conf and commented the other lines in the same file. But I have the next situation.

Before I could choose between Line Out or Headphones at pavucontrol, but I would only listen something on Headphones while they were plugged, Line Out was muted.

Now I can choose too. But, it doesn't matter if I choose Line Out or Headphones at pavucontrol, I listen in the Headphones while they are plugged.

Did I miss something about where to include the codes and comments?

luisbocanegra commented 1 month ago

Can you share the full path of the mixer you edited and the changes you did?

luisbocanegra commented 1 month ago

Also the output of pactl list sinks before and after the change (make sure to restart pipewire & wirepluber after the change)

alanxptm commented 1 month ago

omg I have written the info you asked for, but idk. It's just working as expected now. I'll continue with the following steps. Still, I have a question. What key do I use to change alsamixer control from Disable/Enable?

Oh, but I have lost my subwoofer now. It's only speakers that have sound

Thanks so much for your help and creating this guide btw

alanxptm commented 1 month ago

Can you share the full path of the mixer you edited and the changes you did?

path: /etc/alsa-card-profile/mixer/paths/analog-output-lineout.conf changes:

[Jack Headphone]
state.plugged = unknown
state.unplugged = unknown

[Element Headphone]
; switch = off
; volume = off
alanxptm commented 1 month ago

BEFORE:

Sink #54
    State: SUSPENDED
    Name: alsa_output.pci-0000_0a_00.4.analog-stereo
    Description: Starship/Matisse HD Audio Controller Analog Stereo
    Driver: PipeWire
    Sample Specification: s32le 2ch 48000Hz
    Channel Map: front-left,front-right
    Owner Module: 4294967295
    Mute: no
    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
    Monitor Source: alsa_output.pci-0000_0a_00.4.analog-stereo.monitor
    Latency: 0 usec, configured 0 usec
    Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
    Properties:
        alsa.card = "1"
        alsa.card_name = "HD-Audio Generic"
        alsa.class = "generic"
        alsa.components = "HDA:10ec0b00,10438797,00100001"
        alsa.device = "0"
        alsa.driver_name = "snd_hda_intel"
        alsa.id = "Generic"
        alsa.long_card_name = "HD-Audio Generic at 0xfc400000 irq 100"
        alsa.mixer_name = "Realtek ALCS1200A"
        alsa.name = "ALCS1200A Analog"
        alsa.resolution_bits = "16"
        alsa.subclass = "generic-mix"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.sync.id = "00000000:00000000:00000000:00000000"
        api.alsa.card.longname = "HD-Audio Generic at 0xfc400000 irq 100"
        api.alsa.card.name = "HD-Audio Generic"
        api.alsa.path = "front:1"
        api.alsa.pcm.card = "1"
        api.alsa.pcm.stream = "playback"
        audio.channels = "2"
        audio.position = "FL,FR"
        card.profile.device = "5"
        device.api = "alsa"
        device.class = "sound"
        device.id = "49"
        device.profile.description = "Analog Stereo"
        device.profile.name = "analog-stereo"
        device.routes = "2"
        factory.name = "api.alsa.pcm.sink"
        media.class = "Audio/Sink"
        device.description = "Starship/Matisse HD Audio Controller"
        node.name = "alsa_output.pci-0000_0a_00.4.analog-stereo"
        node.nick = "ALCS1200A Analog"
        node.pause-on-idle = "false"
        object.path = "alsa:acp:Generic:5:playback"
        port.group = "playback"
        priority.driver = "1009"
        priority.session = "1009"
        factory.id = "19"
        clock.quantum-limit = "8192"
        client.id = "46"
        node.driver = "true"
        node.loop.name = "data-loop.0"
        library.name = "audioconvert/libspa-audioconvert"
        object.id = "54"
        object.serial = "54"
        api.acp.auto-port = "false"
        api.alsa.card = "1"
        api.alsa.use-acp = "true"
        api.dbus.ReserveDevice1 = "Audio1"
        api.dbus.ReserveDevice1.Priority = "-20"
        device.bus = "pci"
        device.bus_path = "pci-0000:0a:00.4"
        device.enum.api = "udev"
        device.icon_name = "audio-card-analog-pci"
        device.name = "alsa_card.pci-0000_0a_00.4"
        device.nick = "HD-Audio Generic"
        device.plugged.usec = "5470687"
        device.product.id = "0x1487"
        device.product.name = "Starship/Matisse HD Audio Controller"
        device.subsystem = "sound"
        sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:0a:00.4/sound/card1"
        device.vendor.id = "0x1022"
        device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
        device.string = "1"
    Ports:
        analog-output-lineout: Line Out (type: Line, priority: 9000, availability group: Legacy 4, available)
        analog-output-headphones: Headphones (type: Headphones, priority: 9900, availability group: Legacy 5, available)
    Active Port: analog-output-headphones
    Formats:
        pcm

AFTER:

Sink #701
    State: RUNNING
    Name: alsa_output.pci-0000_0a_00.4.analog-surround-21
    Description: Starship/Matisse HD Audio Controller Analog Surround 2.1
    Driver: PipeWire
    Sample Specification: s32le 3ch 48000Hz
    Channel Map: front-left,front-right,lfe
    Owner Module: 4294967295
    Mute: no
    Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB,   lfe: 65536 / 100% / 0.00 dB
            balance 0.00
    Base Volume: 65536 / 100% / 0.00 dB
    Monitor Source: alsa_output.pci-0000_0a_00.4.analog-surround-21.monitor
    Latency: 0 usec, configured 0 usec
    Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
    Properties:
        alsa.card = "1"
        alsa.card_name = "HD-Audio Generic"
        alsa.class = "generic"
        alsa.components = "HDA:10ec0b00,10438797,00100001"
        alsa.device = "0"
        alsa.driver_name = "snd_hda_intel"
        alsa.id = "Generic"
        alsa.long_card_name = "HD-Audio Generic at 0xfc400000 irq 100"
        alsa.mixer_name = "Realtek ALCS1200A"
        alsa.name = "ALCS1200A Analog"
        alsa.resolution_bits = "16"
        alsa.subclass = "generic-mix"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.sync.id = "00000000:00000000:00000000:00000000"
        api.alsa.card.longname = "HD-Audio Generic at 0xfc400000 irq 100"
        api.alsa.card.name = "HD-Audio Generic"
        api.alsa.path = "surround21:1"
        api.alsa.pcm.card = "1"
        api.alsa.pcm.stream = "playback"
        audio.channels = "3"
        audio.position = "FL,FR,LFE"
        card.profile.device = "7"
        device.api = "alsa"
        device.class = "sound"
        device.id = "50"
        device.profile.description = "Analog Surround 2.1"
        device.profile.name = "analog-surround-21"
        device.routes = "1"
        factory.name = "api.alsa.pcm.sink"
        media.class = "Audio/Sink"
        device.description = "Starship/Matisse HD Audio Controller"
        node.name = "alsa_output.pci-0000_0a_00.4.analog-surround-21"
        node.nick = "ALCS1200A Analog"
        node.pause-on-idle = "false"
        object.path = "alsa:acp:Generic:7:playback"
        port.group = "playback"
        priority.driver = "1009"
        priority.session = "1009"
        factory.id = "19"
        clock.quantum-limit = "8192"
        client.id = "47"
        node.driver = "true"
        node.loop.name = "data-loop.0"
        library.name = "audioconvert/libspa-audioconvert"
        object.id = "257"
        object.serial = "701"
        node.max-latency = "16384/48000"
        api.alsa.period-size = "1024"
        api.alsa.period-num = "32"
        api.alsa.headroom = "0"
        api.acp.auto-port = "false"
        api.alsa.card = "1"
        api.alsa.use-acp = "true"
        api.dbus.ReserveDevice1 = "Audio1"
        api.dbus.ReserveDevice1.Priority = "-20"
        device.bus = "pci"
        device.bus_path = "pci-0000:0a:00.4"
        device.enum.api = "udev"
        device.icon_name = "audio-card-analog-pci"
        device.name = "alsa_card.pci-0000_0a_00.4"
        device.nick = "HD-Audio Generic"
        device.plugged.usec = "5671613"
        device.product.id = "0x1487"
        device.product.name = "Starship/Matisse HD Audio Controller"
        device.subsystem = "sound"
        sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:0a:00.4/sound/card1"
        device.vendor.id = "0x1022"
        device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
        device.string = "1"
    Ports:
        analog-output-lineout: Line Out (type: Line, priority: 9000, availability group: Legacy 4, available)
    Active Port: analog-output-lineout
    Formats:
        pcm
luisbocanegra commented 1 month ago

Still, I have a question. What key do I use to change alsamixer control from Disable/Enable?

Up and down keys.

Oh, but I have lost my subwoofer now. It's only speakers that have sound

Unfortunately I haven't tried this on a device with more than two internal speakers maybe you need to un-mute/raise their volume?

One observation:

path: /etc/alsa-card-profile/mixer/paths/analog-output-lineout.conf changes:

...
[Element Headphone] <- this line should be commented too
; switch = off
; volume = off
alanxptm commented 1 month ago

[Element Headphone] <- this line should be commented too ; switch = off ; volume = off

Idk if it's related, but commenting the line got my subwoofers sound back. I couldn't change the Independent HD control at alsamixer tho. Not with the arrow keys nor the K key (I noticed other controls change their state with the J/K keys) But at this point, having the option to change between Line Out and Headphones without needing to replug stuff is amazing. Gracias!

luisbocanegra commented 1 month ago

Idk if it's related, but commenting the line got my subwoofers sound back.

Nice!

I couldn't chance the Independent HD control at alsamixer tho. Not with the arrow keys nor the K key (I noticed other controls change their state with the J/K keys) But at this point, having the option to change between Line Out and Headphones without needing to replug stuff is amazing.

Try stopping pipewire and wireplumber before trying to enable and store Independent HP, if I remember correctly I needed to do this before being able to change it, you may have to run the systemctl command multiple times until it actually stops.

systemctl --user stop pipewire.service pipewire.socket pipewire-pulse.service pipewire-pulse.socket wireplumber.service

Gracias!

De nada!