Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lineout output doesn't work while headphones are plugged in. #19

Open
Tyranpl opened this issue Oct 6, 2024 · 17 comments
Open

Lineout output doesn't work while headphones are plugged in. #19

Tyranpl opened this issue Oct 6, 2024 · 17 comments

Comments

@Tyranpl
Copy link

Tyranpl commented Oct 6, 2024

System information:

OS: Arch Linux
DE: Hyprland v0.43.0
Kernel: 6.11.1-arch1-1
Graphics Platform: Wayland
CPU: AMD Ryzen 5 2600 (12) @ 3.400GHz
GPU: NVIDIA GeForce RTX 2060

Codecs:

Codec: Nvidia GPU 92 HDMI/DP
Address: 0
Vendor Id: 0x10de0092
Subsystem Id: 0x14583fc1
Codec: Realtek ALC887-VD
Address: 0
Vendor Id: 0x10ec0887
Subsystem Id: 0x1458a182

Cards:

Card #52
	Name: alsa_card.pci-0000_09_00.3
	Driver: alsa
	Owner Module: n/a
	Properties:
		api.alsa.path = "hw:1"
		device.product.id = "0x1457"
		device.vendor.id = "0x1022"
 Profiles:
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
		output:analog-stereo-speaker+input:analog-stereo-input: Speakers Output + Microphone Input (sinks: 1, sources: 1, priority: 5050, available: yes)
		output:analog-stereo-headphones+input:analog-stereo-input: Headphones Output + Microphone Input (sinks: 1, sources: 1, priority: 5050, available: yes)
		output:analog-stereo-speaker: Speakers Output (sinks: 1, sources: 0, priority: 5000, available: yes)
		output:analog-stereo-headphones: Headphones Output (sinks: 1, sources: 0, priority: 5000, available: yes)
		output:analog-stereo-headphones+output:analog-stereo-speaker+input:analog-stereo-input: Analog Stereo Duplex (sinks: 2, sources: 1, priority: 80, available: yes)
		output:analog-stereo-headphones+output:analog-stereo-speaker: Analog Stereo Outputs Only (sinks: 2, sources: 0, priority: 70, available: yes)
		input:analog-stereo-input: Microphone Input (sinks: 0, sources: 1, priority: 50, available: yes)
		pro-audio: Pro Audio (sinks: 3, sources: 2, priority: 1, available: yes)
	Active Profile: output:analog-stereo-headphones+output:analog-stereo-speaker+input:analog-stereo-input
	Ports:
		analog-output-headphones: Headphones (type: Headphones, priority: 9900, latency offset: 0 usec, availability group: Legacy 4, available)
			Properties:
				port.type = "headphones"
				port.availability-group = "Legacy 4"
				device.icon_name = "audio-headphones"
				card.profile.port = "0"
			Part of profile(s): output:analog-stereo-headphones+output:analog-stereo-speaker+input:analog-stereo-input, output:analog-stereo-headphones+output:analog-stereo-speaker, output:analog-stereo-headphones, output:analog-stereo-headphones+input:analog-stereo-input
		analog-output-lineout-split: Line Out (type: Line, priority: 9000, latency offset: 0 usec, availability group: Legacy 5, available)
			Properties:
				port.type = "line"
				port.availability-group = "Legacy 5"
				card.profile.port = "1"
			Part of profile(s): output:analog-stereo-headphones+output:analog-stereo-speaker+input:analog-stereo-input, output:analog-stereo-headphones+output:analog-stereo-speaker, output:analog-stereo-speaker, output:analog-stereo-speaker+input:analog-stereo-input
		analog-input-front-mic: Front Microphone (type: Mic, priority: 8500, latency offset: 0 usec, availability group: Legacy 1, not available)

Sinks:

Sink #1173
	State: RUNNING
	Name: alsa_output.pci-0000_09_00.3.analog-stereo-speaker
	Description: Family 17h (Models 00h-0fh) HD Audio Controller Speakers
	Driver: PipeWire
	...
	Ports:
		analog-output-lineout-split: Line Out (type: Line, priority: 9000, availability group: Legacy 5, available)
	Active Port: analog-output-lineout-split
	Formats:
		pcm

Aplay:

card 1: Generic [HD-Audio Generic], device 0: ALC887-VD Analog [ALC887-VD Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 1: ALC887-VD Digital [ALC887-VD Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 2: ALC887-VD Alt Analog [ALC887-VD Alt Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

So as in the title. While headphones are plugged in I can't hear anything from line out, but in the pavucontrol I see that there is sound.
image

Before the changes I could choose in pavucontrol between line out and headphones without a problem but i couldn't hear audio simultaneously on those outputs.

Please help.

@luisbocanegra
Copy link
Owner

Did you get noise sound from speaker-test in https://github.com/luisbocanegra/linux-guide-split-audio-ports?tab=readme-ov-file#331-identify-what-output-each-device-corresponds-to?

Can you share all the modifications you made and the files for the firmware patch please.

@Tyranpl
Copy link
Author

Tyranpl commented Oct 7, 2024

Yes, but same as in the title. I got noise from line out only when headphones were disconnected.
I did everything as in the tutorial (or at least that's what I think).

split-ports-profile.conf

; This will let alsa generate automatic profiles (e.g internal speaker + microphone)
[General]
auto-profiles = yes


; device-strings describes the ALSA device string(s) that PulseAudio uses to open the device, where "%f" specifies the card number (should always be present in the string).

; This is the mapping for the internal speaker
; If needed, change the 0 in "hw:%f,0" to your sub device location
; You can change the description for this and other mappings if you want
; in paths output put the name of the previously created custom mixer path
[Mapping analog-stereo-speaker]
description = Speakers
device-strings = hw:%f,0
paths-output = analog-output-lineout-split
channel-map = left,right
direction = output

; This is the mapping for the jack output (headphones)
; If needed, change the 2 in "hw:%f,2" to your sub device location
; in paths output put the name of the from card details
[Mapping analog-stereo-headphones]
description = Headphones
device-strings = hw:%f,2
paths-output = analog-output-headphones
channel-map = left,right
direction = output


; This is the mapping that will handle internal and external microphones, as you could see in `cat /proc/asound/pcm`, the card also had a capture port
; in the 0,0 sub device location so let's add it here too (change the 0 in "hw:%f,0" to your sub device location that has the capture port)
; All the paths-input names here came from the default.conf profile set and you may have to adapt it if your input port name is not included

[Mapping analog-stereo-input]
description = Microphone
device-strings = hw:%f,0
channel-map = left,right
paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headphone-mic analog-input-headset-mic
direction = input


; Broken in parts the profile name means to join
; The name of the Mapping containing the analog-output-headphones (output:analog-stereo-headphones)
; The name of the Mapping containing the analog-output-speaker (output:analog-stereo-speaker)
; The name of the Mapping containing the analog-stereo-input (input:analog-stereo-input)

; in output-mappings put the name of the output mappings
; input-mappings put the name of the input mappings

; NOTE: Not to be confused width the paths-output/paths-input inside the mapping, we're not using those directly

; This is the profile that will have the internal speakers + jack output + all microphones
; in paths output put the name of the from card details
[Profile output:analog-stereo-headphones+output:analog-stereo-speaker+input:analog-stereo-input]
description = Analog Stereo Duplex
output-mappings = analog-stereo-headphones analog-stereo-speaker
input-mappings = analog-stereo-input
priority = 80

; This profile will have the internal speakers + jack output, but not microphones
[Profile output:analog-stereo-headphones+output:analog-stereo-speaker]
description = Analog Stereo Outputs Only
output-mappings = analog-stereo-headphones analog-stereo-speaker
priority = 70

analog-output.conf.common

# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of the
# License, or (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

; Common part of all paths

; So here's generally how mixer paths are used by PA: PA goes through
; a mixer path file from top to bottom and checks if a mixer element
; described therein exists. If so it is added to the list of mixer
; elements PA will control, keeping the order it read them in. If a
; mixer element described here has set the required= or
; required-absent= directives a path might not be accepted as valid
; and is ignored in its entirety (see below). However usually if a
; element listed here is missing this one element is ignored but not
; the entire path.
;
; When a device shall be muted/unmuted *all* elements listed in a path
; file with "switch = mute" will be toggled.
;
; When a device shall change its volume, PA will got through the list
; of all elements with "volume = merge" and set the volume on the
; first element. If that element does not support dB volumes, this is
; where the story ends. If it does support dB volumes, PA divides the
; requested volume by the volume that was set on this element, and
; then go on to the next element with "volume = merge" and then set
; that there, and so on.  That way the first volume element in the
; path will be the one that does the 'biggest' part of the overall
; volume adjustment, with the remaining elements usually being set to
; some value next to 0dB. This logic makes sure we get the full range
; over all volume sliders and a very high granularity of volumes
; already in hardware.
;
; All switches and enumerations set to "select" are exposed via the
; "port" functionality of sinks/sources. Basically every possible
; switch setting and every possible enumeration setting will be
; combined and made into a "port". So make sure you don't list too
; many switches/enums for exposing, because the number of ports might
; rise exponentially.
;
; Only one path can be selected at a time. All paths that are valid
; for an audio device will be exposed as "port" for the sink/source.


; [General]
; type = ...                             # The device type. It's highly recommended to set a type for every path.
;                                        # See parse_type() in alsa-mixer.c for supported values.
; priority = ...                         # Priority for this path
; description-key = ...                  # The path description is looked up from a table in path_verify() in
;                                        # src/modules/alsa/alsa-mixer.c. By default the path name (i.e. the file name
;                                        # minus the ".conf" suffix) is used as the lookup key, but if this option is
;                                        # set, then the given string is used as the key instead. In any case the
;                                        # "description" option can be used to override the path description.
; description = ...                      # Description for this path. Overrides the normal description lookup logic, as
;                                        # described in the "description-key" documentation above.
; mute-during-activation = yes | no      # If this path supports hardware mute, should the hw mute be used while activating this
;                                        # path? In some cases this can reduce extra noises during port switching, while in other
;                                        # cases this can increase such noises. Default: no.
; eld-device = ...                       # If this is an HDMI port, set to "auto" so that PulseAudio will try to read
;                                        # the monitor ELD information from the ALSA mixer. By default the ELD information
;                                        # is not read, because it's only applicable with HDMI. Earlier the "auto" option
;                                        # didn't exist, and the hw device index had to be manually configured. For
;                                        # backwards compatibility, it's still possible to manually configure the device
;                                        # index using this option.
;
; [Properties]                           # Property list for this path. The list is merged into the port property list.
; <key> = <value>                        # Each property is defined on its own line.
; ...
;
; [Option ...:...]                       # For each option of an enumeration or switch element
;                                        # that shall be exposed as a sink/source port. Needs to
;                                        # be named after the Element, followed by a colon, followed
;                                        # by the option name, resp. on/off if the element is a switch.
; name = ...                             # Logical name to use in the path identifier
; priority = ...                         # Priority if this is made into a device port
; required = ignore | enumeration | any            # In this element, this option must exist or the path will be invalid. ("any" is an alias for "enumeration".)
; required-any = ignore | enumeration | any        # In this element, either this or another option must exist (or an element)
; required-absent = ignore | enumeration | any     # In this element, this option must not exist or the path will be invalid
;
; [Element ...]                          # For each element that we shall control. The "..." here is the element name,
;                                        # or name and index separated by a comma.
; required = ignore | switch | volume | enumeration | any     # If set, require this element to be of this kind and available,
;                                                             # otherwise don't consider this path valid for the card
; required-any = ignore | switch | volume | enumeration | any # If set, at least one of the elements or jacks with required-any in this
;                                                             # path must be present, otherwise this path is invalid for the card
; required-absent = ignore | switch | volume                  # If set, require this element to not be of this kind and not
;                                                             # available, otherwise don't consider this path valid for the card
;
; switch = ignore | mute | off | on | select # What to do with this switch: ignore it, make it follow mute status,
;                                            # always set it to off, always to on, or make it selectable as port.
;                                            # If set to 'select' you need to define an Option section for on
;                                            # and off
; volume = ignore | merge | off | zero | <volume step> # What to do with this volume: ignore it, merge it into the device
;                                                      # volume slider, always set it to the lowest value possible, or always
;                                                      # set it to 0 dB (for whatever that means), or always set it to
;                                                      # <volume step> (this only makes sense in path configurations where
;                                                      # the exact hardware and driver are known beforehand).
; volume-limit = <volume step>           # Limit the maximum volume by disabling the volume steps above <volume step>.
; enumeration = ignore | select          # What to do with this enumeration, ignore it or make it selectable
;                                        # via device ports. If set to 'select' you need to define an Option section
;                                        # for each of the items you want to expose
; direction = playback | capture         # Is this relevant only for playback or capture? If not set this will implicitly be
;                                        # set the direction of the PCM device is opened as. Generally this doesn't need to be set
;                                        # unless you have a broken driver that has playback controls marked for capture or vice
;                                        # versa
; direction-try-other = no | yes         # If the element does not supported what is requested, try the other direction, too?
;
; override-map.1 = ...                   # Override the channel mask of the mixer control if the control only exposes a single channel
; override-map.2 = ...                   # Override the channel masks of the mixer control if the control only exposes two channels
;                                        # Override maps should list for each element channel which high-level channels it controls via a
;                                        # channel mask. A channel mask may either be the name of a single channel, or the words "all-left",
;                                        # "all-right", "all-center", "all-front", "all-rear", and "all" to encode a specific subset of
;                                        # channels in a mask
; [Jack ...]                           # For each jack that we will use for jack detection
;                                      # The name 'Jack Foo' must match ALSA's 'Foo Jack' control.
; required = ignore | any              # If not set to ignore, make the path invalid if this jack control is not present.
; required-absent = ignore | any       # If not set to ignore, make the path invalid if this jack control is present.
; required-any = ignore | any          # If not set to ignore, make the path invalid if no jack controls and no elements with
;                                      # the required-any are present.
; state.plugged = yes | no | unknown   # Normally a plugged jack would mean the port becomes available, and an unplugged means it's
; state.unplugged = yes | no | unknown # unavailable, but the port status can be overridden by specifying state.plugged and/or state.unplugged.
; append-pcm-to-name = no | yes        # Add ",pcm=N" to the jack name? N is the hw PCM device index. HDMI jacks have
;                                      # the PCM device index in their name, but different drivers use different
;                                      # numbering schemes, so we can't hardcode the full jack name in our configuration
;                                      # files.

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

[Element External Amplifier]
switch = select

[Option External Amplifier:on]
name = output-amplifier-on
priority = 10

[Option External Amplifier:off]
name = output-amplifier-off
priority = 0

[Element Bass Boost]
switch = select

[Option Bass Boost:on]
name = output-bass-boost-on
priority = 0

[Option Bass Boost:off]
name = output-bass-boost-off
priority = 10

[Element IEC958]
switch = off

[Element IEC958 Optical Raw]
switch = off

;;; 'Analog Output'

[Element Analog Output]
enumeration = select

[Option Analog Output:Speakers]
name = output-speaker
priority = 10

[Option Analog Output:Headphones]
name = output-headphones
priority = 9

[Option Analog Output:FP Headphones]
name = output-headphones
priority = 8

;;; 'Output Select'

[Element Output Select]
enumeration = select

[Option Output Select:Speakers]
name = output-speaker
priority = 10

[Option Output Select:Headphone]
name = output-headphones
priority = 9

analog-output-lineout-split.conf

# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of the
# License, or (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

[General]
priority = 90
description-key = analog-output-lineout

[Jack Line Out]
required-any = any
 
[Jack Headphone]
state.plugged = unknown
state.unplugged = unknown

[Jack Line Out Phantom]
state.plugged = unknown
state.unplugged = unknown
required-any = any

[Jack Front Line Out]
required-any = any

[Jack Front Line Out Phantom]
state.plugged = unknown
state.unplugged = unknown
required-any = any

[Jack Rear Line Out]
required-any = any

[Jack Rear Line Out Phantom]
state.plugged = unknown
state.unplugged = unknown
required-any = any

[Jack Line Out Front]
required-any = any

[Jack Line Out Front Phantom]
state.plugged = unknown
state.unplugged = unknown
required-any = any

[Jack Line Out CLFE]
state.plugged = unknown
state.unplugged = unknown
required-any = any

[Jack Line Out CLFE Phantom]
state.plugged = unknown
state.unplugged = unknown
required-any = any

[Jack Line Out Surround]
state.plugged = unknown
state.unplugged = unknown
required-any = any

[Jack Line Out Surround Phantom]
state.plugged = unknown
state.unplugged = unknown
required-any = any

[Jack Line Out Side]
state.plugged = unknown
state.unplugged = unknown
required-any = any

[Jack Line Out Side Phantom]
state.plugged = unknown
state.unplugged = unknown
required-any = any

[Jack Dock Line Out]
required-any = any

[Jack Dock Line Out Phantom]
state.plugged = unknown
state.unplugged = unknown
required-any = any

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

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

[Element Speaker+LO]
switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
required-any = any

; [Element Headphone+LO]
; switch = mute
; volume = merge
; override-map.1 = all
; override-map.2 = all-left,all-right
; required-any = any

[Element Master Mono]
switch = off
volume = off

[Element Line HP Swap]
switch = off
required-any = any

; This profile path is intended to control line out, let's mute headphones
; else there will be a spike when plugging in headphones
; [Element Headphone]
; switch = off
; volume = off

; [ Element Headphone,1]
; switch = off
; volume = off

; [Element Headphone2]
; switch = off
; volume = off

[Element Speaker]
switch = off
volume = off

[Element Desktop Speaker]
switch = off
volume = off

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

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

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

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

[Element Center]
switch = mute
volume = merge
override-map.1 = all-center
override-map.2 = all-center,all-center

[Element LFE]
switch = mute
volume = merge
override-map.1 = lfe
override-map.2 = lfe,lfe

[Element CLFE]
switch = mute
volume = merge
override-map.1 = all-center
override-map.2 = all-center,lfe

[Element Center/LFE]
switch = mute
volume = merge
override-map.1 = all-center
override-map.2 = all-center,lfe

[Element Bass Speaker]
switch = off
volume = off

[Element Speaker Front]
switch = off
volume = off

[Element Speaker Surround]
switch = off
volume = off

[Element Speaker Side]
switch = off
volume = off

[Element Speaker CLFE]
switch = off
volume = off

But in this file i didn't have [Jack Headphone] so i added it. I tried with and without it and results were same.

@luisbocanegra
Copy link
Owner

luisbocanegra commented Oct 7, 2024

Can you send a screenshot of alsamixer -c0 I think you may have to change 0 to 1 if it doesn't show Realtek ALC887-VD chip, also does anything happen if you try to mute/un-mute/raise volume of the outputs there?

@luisbocanegra
Copy link
Owner

Could you also share the full output of pactl list cards?

@Tyranpl
Copy link
Author

Tyranpl commented Oct 8, 2024

alsamixer -c1
image

Okay, when I play music and raise volume on headphones it's working. But, when I do the same with line out, nothing is changing. NVM. It is working but when I change volume on "Front", not on "Line".

pactl list cards

Card #48
	Name: alsa_card.pci-0000_09_00.3
	Driver: alsa
	Owner Module: n/a
	Properties:
		api.acp.auto-port = "false"
		api.alsa.card = "1"
		api.alsa.card.longname = "HD-Audio Generic at 0xf7700000 irq 79"
		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:09:00.3"
		device.description = "Family 17h (Models 00h-0fh) HD Audio Controller"
		device.enum.api = "udev"
		device.icon_name = "audio-card-analog-pci"
		device.name = "alsa_card.pci-0000_09_00.3"
		device.nick = "HD-Audio Generic"
		device.plugged.usec = "20060689"
		device.product.id = "0x1457"
		device.product.name = "Family 17h (Models 00h-0fh) HD Audio Controller"
		device.profile-set = "/etc/alsa-card-profile/mixer/profile-sets/split-ports-profile.conf"
		device.subsystem = "sound"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:09:00.3/sound/card1"
		device.vendor.id = "0x1022"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
		media.class = "Audio/Device"
		factory.id = "15"
		client.id = "46"
		object.id = "48"
		object.serial = "48"
		object.path = "alsa:acp:Generic"
		alsa.card = "1"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HD-Audio Generic at 0xf7700000 irq 79"
		alsa.driver_name = "snd_hda_intel"
		alsa.mixer_name = "Realtek ALC887-VD"
		alsa.components = "HDA:10ec0887,1458a182,00100302"
		alsa.id = "Generic"
		device.string = "1"
	Profiles:
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
		output:analog-stereo-speaker+input:analog-stereo-input: Speakers Output + Microphone Input (sinks: 1, sources: 1, priority: 5050, available: yes)
		output:analog-stereo-headphones+input:analog-stereo-input: Headphones Output + Microphone Input (sinks: 1, sources: 1, priority: 5050, available: no)
		output:analog-stereo-speaker: Speakers Output (sinks: 1, sources: 0, priority: 5000, available: yes)
		output:analog-stereo-headphones: Headphones Output (sinks: 1, sources: 0, priority: 5000, available: no)
		output:analog-stereo-headphones+output:analog-stereo-speaker+input:analog-stereo-input: Analog Stereo Duplex (sinks: 2, sources: 1, priority: 80, available: yes)
		output:analog-stereo-headphones+output:analog-stereo-speaker: Analog Stereo Outputs Only (sinks: 2, sources: 0, priority: 70, available: yes)
		input:analog-stereo-input: Microphone Input (sinks: 0, sources: 1, priority: 50, available: yes)
		pro-audio: Pro Audio (sinks: 3, sources: 2, priority: 1, available: yes)
	Active Profile: output:analog-stereo-headphones+output:analog-stereo-speaker+input:analog-stereo-input
	Ports:
		analog-output-headphones: Headphones (type: Headphones, priority: 9900, latency offset: 0 usec, availability group: Legacy 4, not available)
			Properties:
				port.type = "headphones"
				port.availability-group = "Legacy 4"
				device.icon_name = "audio-headphones"
				card.profile.port = "0"
			Part of profile(s): output:analog-stereo-headphones+output:analog-stereo-speaker+input:analog-stereo-input, output:analog-stereo-headphones+output:analog-stereo-speaker, output:analog-stereo-headphones, output:analog-stereo-headphones+input:analog-stereo-input
		analog-output-lineout-split: Line Out (type: Line, priority: 9000, latency offset: 0 usec, availability group: Legacy 5, available)
			Properties:
				port.type = "line"
				port.availability-group = "Legacy 5"
				card.profile.port = "1"
			Part of profile(s): output:analog-stereo-headphones+output:analog-stereo-speaker+input:analog-stereo-input, output:analog-stereo-headphones+output:analog-stereo-speaker, output:analog-stereo-speaker, output:analog-stereo-speaker+input:analog-stereo-input
		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 = "2"
			Part of profile(s): output:analog-stereo-headphones+output:analog-stereo-speaker+input:analog-stereo-input, input:analog-stereo-input, output:analog-stereo-speaker+input:analog-stereo-input, output:analog-stereo-headphones+input:analog-stereo-input
		analog-input-rear-mic: Rear Microphone (type: Mic, priority: 8200, latency offset: 0 usec, availability group: Legacy 2, available)
			Properties:
				port.type = "mic"
				port.availability-group = "Legacy 2"
				device.icon_name = "audio-input-microphone"
				card.profile.port = "3"
			Part of profile(s): output:analog-stereo-headphones+output:analog-stereo-speaker+input:analog-stereo-input, input:analog-stereo-input, output:analog-stereo-speaker+input:analog-stereo-input, output:analog-stereo-headphones+input:analog-stereo-input
		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 = "4"
			Part of profile(s): output:analog-stereo-headphones+output:analog-stereo-speaker+input:analog-stereo-input, input:analog-stereo-input, output:analog-stereo-speaker+input:analog-stereo-input, output:analog-stereo-headphones+input:analog-stereo-input

EDIT: I realized that now "line out" mutes automatically, when I plug out headphones.

@luisbocanegra
Copy link
Owner

luisbocanegra commented Oct 8, 2024

This is extremely similar to #20 maybe is the same problem under the hood.

I found this [Solved] PulseAudio does not use hardware volume control, it seems you need to tell to pipewire which control to use https://docs.pipewire.org/page_man_pipewire-pulse-modules_7.html please try that it seems that the way to configure that now is through wireplumber https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/alsa.html.

EDIT: I realized that now "line out" mutes automatically, when I plug out headphones.

May be related to #13 but I suggest ignoring that for now

@Tyranpl
Copy link
Author

Tyranpl commented Oct 8, 2024

Okay, so I did something opposite. It's problem with mute I think. I configured my waybar today and saw that it says "mute" after I connected headphones. I just unmutted it with my keyboard and it started magically working🤦‍♂️.
Now I need to somehow disable this automute. On pavuvontrol it's not muted, in alsamixer too. Only wpctl unmutes. Maybe it's something with wpctl, idk.

@luisbocanegra
Copy link
Owner

luisbocanegra commented Oct 8, 2024

Maybe adding auto_mute=no to the firmware patch under [hints]? Though not sure if this will help at all since alsamixer says it is already disabled.

[hints]
indep_hp=yes
vmaster=no
auto_mute=no

source: https://www.kernel.org/doc/html/v6.7/sound/hd-audio/notes.html

In my case it was common for one of my outputs to be muted and #13 seemed to help maybe you need something like that too.

@luisbocanegra
Copy link
Owner

Also in my case when is muted like this it does unmute from KDE's audio widget, that may indicate a different issue in your case.

@Tyranpl
Copy link
Author

Tyranpl commented Oct 8, 2024

For now, it's not working, nor #13, nor adding auto_mute=no to firmware patch. I'm too tired to do this today, but maybe some script that execute wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle every time I connect or disconnect headphones will do.

@luisbocanegra
Copy link
Owner

Yeah that could work too. Maybe is something with the drivers and no way around that, but if you want, give https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1297 a shot another day.

@sflavelle
Copy link

sflavelle commented Dec 29, 2024

If it helps, I found that on my ALC897 chipset, I had to add another option to the modprobe snd-hda-intel file before I could get speaker audio to play while headphones were connected:
options snd-hda-intel model=dual-codecs

The exact "model" might differ for you, dual-codecs was just the one that worked for me. There's a list here that I used: https://lxr.linux.no/#linux+v6.7/Documentation/sound/hd-audio/models.rst

@luisbocanegra
Copy link
Owner

If it helps, I found that on my ALC897 chipset, I had to add another option to the modprobe snd-hda-intel file before I could get speaker audio to play while headphones were connected: options snd-hda-intel model=dual-codecs

The exact "model" might differ for you, dual-codecs was just the one that worked for me. There's a list here that I used: lxr.linux.no#linux+v6.7/Documentation/sound/hd-audio/models.rst

Interesting, did you get both sinks to play separate audio streams at the same time too?

@sflavelle
Copy link

sflavelle commented Dec 29, 2024 via email

@luisbocanegra
Copy link
Owner

I did admittedly write the comment while in the middle of following this guide, but I can since confirm that I can play different audio streams through the now-separate outputs.

Nice! So if I understand correctly, you needed model=dual-codecs to get until part 2 to work, that is, being able to play sound from Line Out output without needing to unplug Headphones?

If that's the case, is there any difference if you remove that option now?

I will add your finding to the guide but want to be sure where to put it.

It also could be useful to know what are your system details hardware/distribution and the card/sinks information in case they may be useful reference for others, you can share that in this issue (there is an example) or here

@sflavelle
Copy link

Without the model bit I could select either port, but audio would forcibly cut out on the speaker port when headphones were plugged in, even as a 'Pro Audio' device or changing the port in KDE back to 'Line Out'. Finding the model setting allowed me to at least use either port without unplugging a device, though not at the same time with Pro Audio.

I'll get back to you on undoing the model bit and seeing what that does, I'm not gonna have much opportunity to play with it until probably NYE lmao. I'll craft the details in #9 about the same time.

@luisbocanegra
Copy link
Owner

Without the model bit I could select either port, but audio would forcibly cut out on the speaker port when headphones were plugged in, even as a 'Pro Audio' device or changing the port in KDE back to 'Line Out'. Finding the model setting allowed me to at least use either port without unplugging a device, though not at the same time with Pro Audio.

Thanks, will add it as a note at the end of part 2

I'll get back to you on undoing the model bit and seeing what that does, I'm not gonna have much opportunity to play with it until probably NYE lmao. I'll craft the details in #9 about the same time.

No problem, happy holidays!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants