You are not logged in.

#1 2022-04-07 11:21:51

Einsam
Member
Registered: 2020-08-10
Posts: 15

I want to make the headset work with its microphone at the same time

Here is my alsa-info.sh
alsa-info.sh
In the past my laptop couldn't automatically switch speakers to headphones, I had to switch manually. Later I found related questions on archwiki. This is related to the 3.5mm headphone jack detection. So i followed the tutorial, and added the module option with "module=headset-mode". it worked.
But recently I found my headphone microphone can not work together with headphone. So I changed the module to "headset-mic", "dell-headset-multi", "alc256-asus-mic", but headphone and mic always one of them woks, or neither.

cat alsa-base.conf
#options snd_hda_intel index=0 model=headset-mode
#options snd_hda_intel index=0 model=dell-headset-multi
options snd_hda_intel index=0 model=1b50:5809

Model is set to `1b50:5809`  because I want to try the method in kernel doc.
kernel doc
A new style for the model option that was introduced since 5.15 kernel is to pass the PCI or codec SSID in the form of model=XXXX:YYYY where XXXX and YYYY are the sub-vendor and sub-device IDs in hex numbers, respectively.

cat /proc/asound/card*/codec* | grep Codec
Codec: Realtek ALC256
Codec: Intel Kabylake HDMI
pactl list sources | grep Ports -C 5
		audio.adapt.follower = ""
		library.name = "audioconvert/libspa-audioconvert"
		object.id = "44"
		object.serial = "44"
		node.max-latency = "16384/48000"
	Ports:
		analog-input-internal-mic: Internal Microphone (type: Mic, priority: 8900, availability group: Legacy 1, availability unknown)
		analog-input-mic: Microphone (type: Mic, priority: 8700, availability group: Legacy 2, not available)
	Active Port: analog-input-mic
	Formats:
		pcm
lspci -vvnn | grep Audio -A 5
00:1f.3 Audio device [0403]: Intel Corporation Cannon Point-LP High Definition Audio Controller [8086:9dc8] (rev 30)
	DeviceName: Onboard - Sound
	Subsystem: Device [1b50:5809]
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 32, Cache Line Size: 64 bytes
cat /proc/asound/card*/codec* | grep "Vendor Id" -A 5
Vendor Id: 0x10ec0256
Subsystem Id: 0x1b505809
Revision Id: 0x100002
No Modem Function Group found
Default PCM:
    rates [0x560]: 44100 48000 96000 192000
--
Vendor Id: 0x8086280b
Subsystem Id: 0x80860101
Revision Id: 0x100000
No Modem Function Group found
Default PCM:
    rates [0x0]:

Offline

#2 2022-04-07 12:15:18

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,944

Re: I want to make the headset work with its microphone at the same time

Using the literal vid and pid as they are detected for the system already for your module has zero effect.  For this to have any effect you'd need to use something that actually has an existing quirk you can try to alias to e.g. like https://github.com/torvalds/linux/blob/ … ek.c#L8828 so you could use 1025:1269 to apply the ALC256_FIXUP_ACER_HEADSET_MIC quirk.

Does it actually not work or is it just a misdetection of jack state? Does enforcing

pactl set-source-port $source$ analog-input-internal-mic

not work? (you've cut out the source name, so look at the full output to know what you have to fill in there.

Just to get what your end goal is, you have a single headphone jack, but no mic in your headphone and want to use the internal mic as well as the headphone, or do you have a combined mic/headphone and it doesn't work?

Offline

#3 2022-04-07 14:04:09

Einsam
Member
Registered: 2020-08-10
Posts: 15

Re: I want to make the headset work with its microphone at the same time

V1del wrote:

Using the literal vid and pid as they are detected for the system already for your module has zero effect.  For this to have any effect you'd need to use something that actually has an existing quirk you can try to alias to e.g. like https://github.com/torvalds/linux/blob/ … ek.c#L8828 so you could use 1025:1269 to apply the ALC256_FIXUP_ACER_HEADSET_MIC quirk.

Does it actually not work or is it just a misdetection of jack state? Does enforcing

pactl set-source-port $source$ analog-input-internal-mic

not work? (you've cut out the source name, so look at the full output to know what you have to fill in there.

Just to get what your end goal is, you have a single headphone jack, but no mic in your headphone and want to use the internal mic as well as the headphone, or do you have a combined mic/headphone and it doesn't work?

Thank you. I have a combined mic/headphone and it doesn't work together.
When i execute this command:

pactl set-source-port alsa_input.pci-0000_00_1f.3.analog-stereo analog-input-headset-mic

headset-mic can work. But when I plugged it out, it turned into internal mic. And I must execute this command again to make headset-mic work, when I plugged in again.

aliases I test

# only headset-mic can auto change but output always speaker.
#options snd_hda_intel index=0 model=dell-headset-multi

# only headphone work but no headset-mic
# options snd_hda_intel index=0 model=alc256-asus-headset

# only headphone work but no headset-mic
#options snd_hda_intel index=0 model=alc256-asus-mic

# neither
# options snd_hda_intel index=0 model=alc256-asus-aio

# only headphone work but no headset-mic
# options snd_hda_intel index=0 model=alc256-medion-headset

# neither
# options snd_hda_intel index=0 model=alc256-samsung-headphone

# only headset-mic can auto change but output always speaker.
options snd_hda_intel index=0 model=dell-inspiron-7559

pactl list source
after I execute the set-source-port and the module option model is "dell-inspiron-7559"

Source #43
	State: SUSPENDED
	Name: alsa_output.pci-0000_00_1f.3.analog-stereo.monitor
	Description: Monitor of Built-in Audio 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 of Sink: alsa_output.pci-0000_00_1f.3.analog-stereo
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE DECIBEL_VOLUME LATENCY
	Properties:
		object.path = "alsa:pcm:0:front:0:playback"
		api.alsa.path = "front:0"
		api.alsa.pcm.card = "0"
		api.alsa.pcm.stream = "playback"
		audio.channels = "2"
		audio.position = "FL,FR"
		device.routes = "2"
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "monitor"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC256 Analog"
		alsa.id = "ALC256 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 0x6013118000 irq 137"
		alsa.driver_name = "snd_hda_intel"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		card.profile.device = "9"
		device.id = "40"
		factory.name = "api.alsa.pcm.sink"
		priority.driver = "1009"
		priority.session = "1009"
		media.class = "Audio/Sink"
		node.nick = "HDA Intel PCH"
		node.name = "alsa_output.pci-0000_00_1f.3.analog-stereo"
		device.description = "Built-in Audio Analog Stereo"
		device.icon_name = "audio-card-analog"
		device.bus = "pci"
		device.bus_path = "pci-0000:00:1f.3"
		device.form_factor = "internal"
		node.pause-on-idle = "false"
		factory.id = "18"
		client.id = "32"
		clock.quantum-limit = "8192"
		node.driver = "true"
		factory.mode = "merge"
		audio.adapt.follower = ""
		library.name = "audioconvert/libspa-audioconvert"
		object.id = "43"
		object.serial = "43"
		node.max-latency = "16384/48000"
	Formats:
		pcm

Source #167
	State: SUSPENDED
	Name: alsa_input.pci-0000_00_1f.3.analog-stereo
	Description: Built-in Audio 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: 6554 /  10% / -60.00 dB
	Monitor of Sink: n/a
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
	Properties:
		object.path = "alsa:pcm:0:front:0:capture"
		api.alsa.path = "front:0"
		api.alsa.pcm.card = "0"
		api.alsa.pcm.stream = "capture"
		audio.channels = "2"
		audio.position = "FL,FR"
		device.routes = "2"
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC256 Analog"
		alsa.id = "ALC256 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 0x6013118000 irq 137"
		alsa.driver_name = "snd_hda_intel"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		card.profile.device = "0"
		device.id = "40"
		factory.name = "api.alsa.pcm.source"
		priority.driver = "2009"
		priority.session = "2009"
		media.class = "Audio/Source"
		node.nick = "HDA Intel PCH"
		node.name = "alsa_input.pci-0000_00_1f.3.analog-stereo"
		device.description = "Built-in Audio Analog Stereo"
		device.icon_name = "audio-input-microphone-analog"
		device.bus = "pci"
		device.bus_path = "pci-0000:00:1f.3"
		device.form_factor = "internal"
		node.pause-on-idle = "false"
		factory.id = "18"
		client.id = "32"
		clock.quantum-limit = "8192"
		node.driver = "true"
		factory.mode = "split"
		audio.adapt.follower = ""
		library.name = "audioconvert/libspa-audioconvert"
		object.id = "50"
		object.serial = "167"
	Ports:
		analog-input-headphone-mic: Microphone (type: Mic, priority: 8700, availability group: Legacy 1, availability unknown)
		analog-input-headset-mic: Headset Microphone (type: Headset, priority: 8800, availability group: Legacy 1, availability unknown)
	Active Port: analog-input-headset-mic
	Formats:
		pcm

Last edited by Einsam (2022-04-07 14:08:44)

Offline

#4 2022-04-07 16:48:12

Maniaxx
Member
Registered: 2014-05-14
Posts: 757

Re: I want to make the headset work with its microphone at the same time

Install 'wireplumber', restart the OS and try again.


sys2064

Offline

#5 2022-04-07 17:05:12

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,944

Re: I want to make the headset work with its microphone at the same time

Not gonna help if it doesn't work from a codec perspective, which is quite common with these kind of boards I'm afraid.

Offline

#6 2022-04-07 18:46:25

Maniaxx
Member
Registered: 2014-05-14
Posts: 757

Re: I want to make the headset work with its microphone at the same time

I would expect a mode where both sources are available just not routed correctly. That was a problem on pipewire's simple session manager indeed (like here). This might be solved by wireplumber.

To make it more comfortable what's going on look up the audio graph with a graphical node representation. Install something like qpwgraph, helvum or carla. If you haven't done so install pipewire-pulse and pavucontrol, set a corresponding profile and watch the graphs and its connections during jack connect/disconnect. If there are valid nodes for mic/heaphones (that work when you manually connect them) that don't get automatically connected there might be a profile problem only.

What you do with 'pactl' above just connects the sinks. The sinks though are profile dependent. They come and go when you switch the profiles (card/hw dependent). I'm not too sure about that, but the low level ALSA interfaces (or the codec) cannot be fully configured/modified in userspace. But there might be things that can be done programmatically (by the audioserver/profiles), e.g. the pro-audio profile that provides all raw sockets.

And yes, if the sinks itself are not working (or not getting initialized) properly it might be a lower level problem.

Last edited by Maniaxx (2022-04-07 20:20:04)


sys2064

Offline

#7 2022-04-08 15:35:27

Einsam
Member
Registered: 2020-08-10
Posts: 15

Re: I want to make the headset work with its microphone at the same time

Maniaxx wrote:

I would expect a mode where both sources are available just not routed correctly. That was a problem on pipewire's simple session manager indeed (like here). This might be solved by wireplumber.

To make it more comfortable what's going on look up the audio graph with a graphical node representation. Install something like qpwgraph, helvum or carla. If you haven't done so install pipewire-pulse and pavucontrol, set a corresponding profile and watch the graphs and its connections during jack connect/disconnect. If there are valid nodes for mic/heaphones (that work when you manually connect them) that don't get automatically connected there might be a profile problem only.

What you do with 'pactl' above just connects the sinks. The sinks though are profile dependent. They come and go when you switch the profiles (card/hw dependent). I'm not too sure about that, but the low level ALSA interfaces (or the codec) cannot be fully configured/modified in userspace. But there might be things that can be done programmatically (by the audioserver/profiles), e.g. the pro-audio profile that provides all raw sockets.

And yes, if the sinks itself are not working (or not getting initialized) properly it might be a lower level problem.

Thanks you both for your help. I seem to have finally solved the problem.
I finally used the "alc256-asus-mic" model, because it can make headphone auto switch and also headset-mic can be detected.

pactl list sources | grep -A 5 Ports
	Ports:
		analog-input-internal-mic: Internal Microphone (type: Mic, priority: 8900, availability group: Legacy 1, availability unknown)
		analog-input-headset-mic: Headset Microphone (type: Headset, priority: 8800, availability group: Legacy 2, availability unknown)
	Active Port: analog-input-internal-mic

But the active port always "internal-mic", until I set-source-port manually. After search for many information about pipewire-pulse profile, I ended up thinking that changing the priority of headset-mic might have an effect. Because both ports are active, and no matter how I modify the `$HOME/.config/pipewire/media-session.d/alsa-monitor.conf`, it didn't fix it.
Finally I edited the `/usr/share/alsa-card-profile/mixer/paths/analog-input-headset-mic.conf`, and changed the priority from 88 to 101 and restarted the pipewire.service. It worked. Both headphone and headset-mic will automatically switch, when I plug in my headphone to the 3.5 mm port. And it will switch to speaker and internal-mic when headphone is plugged out.

Last edited by Einsam (2022-04-08 15:36:29)

Offline

#8 2022-04-08 18:22:46

Maniaxx
Member
Registered: 2014-05-14
Posts: 757

Re: I want to make the headset work with its microphone at the same time

Einsam wrote:

no matter how I modify the `$HOME/.config/pipewire/media-session.d/alsa-monitor.conf`, it didn't fix it.

'media-session.d' is abandoned and probably outdated. It still works but its officially recommended to use 'wireplumber' instead. That's what i meant in the first place... 'wireplumber' has much more and different rules. Patching the profiles itself might not be the best solution. It probably will be overridden on next update.


sys2064

Offline

Board footer

Powered by FluxBB