Bad audio quality from earphones

Hi all,

I recently got a Lenovo C940 laptop and switched from Ubuntu to Manjaro. I followed the instructions here to take care of some small issues (such as no sound from speakers) https://wiki.archlinux.org/index.php/Lenovo_Yoga_c940 Other than a few quicks, my experience has been pretty smooth.

But I noticed that my earphones have pretty bad sound quality. (plugged in through the good-old audio jack) The same earphones have spectacular sound quality in my older laptop. I also get very good sound from my bluetooth speakers, no problems there. Probably I messed something up in my setup. Below are some diagnostic information. Any ideas would be much appreciated.

Here is the output of alsa-info.sh --upload: http://alsa-project.org/db/?f=8285b615d3d896de89f80f120fcd4682dd44df91

And here is the output of pactl list cards

Card #0
	Name: alsa_card.pci-0000_00_1f.3
	Driver: module-alsa-card.c
	Owner Module: 6
	Properties:
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0x601d160000 irq 167"
		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 = "34c8"
		device.product.name = "Smart Sound Technology Audio Controller"
		device.form_factor = "internal"
		device.string = "0"
		device.description = "Built-in Audio"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Profiles:
		input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 65, available: yes)
		output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6500, available: yes)
		output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6565, available: yes)
		output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5900, available: no)
		output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5965, available: no)
		output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: no)
		output:hdmi-surround+input:analog-stereo: Digital Surround 5.1 (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 865, available: no)
		output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: no)
		output:hdmi-surround71+input:analog-stereo: Digital Surround 7.1 (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 865, available: no)
		output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (sinks: 1, sources: 0, priority: 5700, available: no)
		output:hdmi-stereo-extra1+input:analog-stereo: Digital Stereo (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5765, available: no)
		output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround-extra1+input:analog-stereo: Digital Surround 5.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: no)
		output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround71-extra1+input:analog-stereo: Digital Surround 7.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: no)
		output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (sinks: 1, sources: 0, priority: 5700, available: no)
		output:hdmi-stereo-extra2+input:analog-stereo: Digital Stereo (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5765, available: no)
		output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround-extra2+input:analog-stereo: Digital Surround 5.1 (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: no)
		output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround71-extra2+input:analog-stereo: Digital Surround 7.1 (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: no)
		output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (sinks: 1, sources: 0, priority: 5700, available: no)
		output:hdmi-stereo-extra3+input:analog-stereo: Digital Stereo (HDMI 4) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5765, available: no)
		output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround-extra3+input:analog-stereo: Digital Surround 5.1 (HDMI 4) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: no)
		output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround71-extra3+input:analog-stereo: Digital Surround 7.1 (HDMI 4) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: no)
		output:hdmi-stereo-extra4: Digital Stereo (HDMI 5) Output (sinks: 1, sources: 0, priority: 5700, available: no)
		output:hdmi-stereo-extra4+input:analog-stereo: Digital Stereo (HDMI 5) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5765, available: no)
		output:hdmi-surround-extra4: Digital Surround 5.1 (HDMI 5) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround-extra4+input:analog-stereo: Digital Surround 5.1 (HDMI 5) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: no)
		output:hdmi-surround71-extra4: Digital Surround 7.1 (HDMI 5) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround71-extra4+input:analog-stereo: Digital Surround 7.1 (HDMI 5) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: no)
		output:hdmi-stereo-extra5: Digital Stereo (HDMI 6) Output (sinks: 1, sources: 0, priority: 5700, available: no)
		output:hdmi-stereo-extra5+input:analog-stereo: Digital Stereo (HDMI 6) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5765, available: no)
		output:hdmi-surround-extra5: Digital Surround 5.1 (HDMI 6) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround-extra5+input:analog-stereo: Digital Surround 5.1 (HDMI 6) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: no)
		output:hdmi-surround71-extra5: Digital Surround 7.1 (HDMI 6) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround71-extra5+input:analog-stereo: Digital Surround 7.1 (HDMI 6) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: no)
		output:hdmi-stereo-extra6: Digital Stereo (HDMI 7) Output (sinks: 1, sources: 0, priority: 5700, available: no)
		output:hdmi-stereo-extra6+input:analog-stereo: Digital Stereo (HDMI 7) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5765, available: no)
		output:hdmi-surround-extra6: Digital Surround 5.1 (HDMI 7) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround-extra6+input:analog-stereo: Digital Surround 5.1 (HDMI 7) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: no)
		output:hdmi-surround71-extra6: Digital Surround 7.1 (HDMI 7) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround71-extra6+input:analog-stereo: Digital Surround 7.1 (HDMI 7) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: no)
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
	Active Profile: output:analog-stereo+input:analog-stereo
	Ports:
		analog-input-internal-mic: Internal Microphone (priority: 8900, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "audio-input-microphone"
			Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround+input:analog-stereo, output:hdmi-surround71+input:analog-stereo, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1+input:analog-stereo, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2+input:analog-stereo, output:hdmi-stereo-extra3+input:analog-stereo, output:hdmi-surround-extra3+input:analog-stereo, output:hdmi-surround71-extra3+input:analog-stereo, output:hdmi-stereo-extra4+input:analog-stereo, output:hdmi-surround-extra4+input:analog-stereo, output:hdmi-surround71-extra4+input:analog-stereo, output:hdmi-stereo-extra5+input:analog-stereo, output:hdmi-surround-extra5+input:analog-stereo, output:hdmi-surround71-extra5+input:analog-stereo, output:hdmi-stereo-extra6+input:analog-stereo, output:hdmi-surround-extra6+input:analog-stereo, output:hdmi-surround71-extra6+input:analog-stereo
		analog-input-mic: Microphone (priority: 8700, latency offset: 0 usec, available)
			Properties:
				device.icon_name = "audio-input-microphone"
			Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround+input:analog-stereo, output:hdmi-surround71+input:analog-stereo, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1+input:analog-stereo, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2+input:analog-stereo, output:hdmi-stereo-extra3+input:analog-stereo, output:hdmi-surround-extra3+input:analog-stereo, output:hdmi-surround71-extra3+input:analog-stereo, output:hdmi-stereo-extra4+input:analog-stereo, output:hdmi-surround-extra4+input:analog-stereo, output:hdmi-surround71-extra4+input:analog-stereo, output:hdmi-stereo-extra5+input:analog-stereo, output:hdmi-surround-extra5+input:analog-stereo, output:hdmi-surround71-extra5+input:analog-stereo, output:hdmi-stereo-extra6+input:analog-stereo, output:hdmi-surround-extra6+input:analog-stereo, output:hdmi-surround71-extra6+input:analog-stereo
		analog-output-speaker: Speakers (priority: 10000, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "audio-speakers"
			Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo
		analog-output-headphones: Headphones (priority: 9900, latency offset: 0 usec, available)
			Properties:
				device.icon_name = "audio-headphones"
			Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo
		hdmi-output-0: HDMI / DisplayPort (priority: 5900, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround, output:hdmi-surround+input:analog-stereo, output:hdmi-surround71, output:hdmi-surround71+input:analog-stereo
		hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo-extra1, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1, output:hdmi-surround71-extra1+input:analog-stereo
		hdmi-output-2: HDMI / DisplayPort 3 (priority: 5700, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo-extra2, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2, output:hdmi-surround71-extra2+input:analog-stereo
		hdmi-output-3: HDMI / DisplayPort 4 (priority: 5600, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo-extra3, output:hdmi-stereo-extra3+input:analog-stereo, output:hdmi-surround-extra3, output:hdmi-surround-extra3+input:analog-stereo, output:hdmi-surround71-extra3, output:hdmi-surround71-extra3+input:analog-stereo
		hdmi-output-4: HDMI / DisplayPort 5 (priority: 5500, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo-extra4, output:hdmi-stereo-extra4+input:analog-stereo, output:hdmi-surround-extra4, output:hdmi-surround-extra4+input:analog-stereo, output:hdmi-surround71-extra4, output:hdmi-surround71-extra4+input:analog-stereo
		hdmi-output-5: HDMI / DisplayPort 6 (priority: 5400, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo-extra5, output:hdmi-stereo-extra5+input:analog-stereo, output:hdmi-surround-extra5, output:hdmi-surround-extra5+input:analog-stereo, output:hdmi-surround71-extra5, output:hdmi-surround71-extra5+input:analog-stereo
		hdmi-output-6: HDMI / DisplayPort 7 (priority: 5300, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo-extra6, output:hdmi-stereo-extra6+input:analog-stereo, output:hdmi-surround-extra6, output:hdmi-surround-extra6+input:analog-stereo, output:hdmi-surround71-extra6, output:hdmi-surround71-extra6+input:analog-stereo

And here is the output of pacmd list-sinks

1 sink(s) available.
  * index: 4
	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: (none)
	priority: 9039
	volume: front-left: 39363 /  60% / -13,28 dB,   front-right: 39363 /  60% / -13,28 dB
	        balance 0,00
	base volume: 65536 / 100% / 0,00 dB
	volume steps: 65537
	muted: no
	current latency: 65,08 ms
	max request: 14 KiB
	max rewind: 14 KiB
	monitor source: 6
	sample spec: s16le 2ch 48000Hz
	channel map: front-left,front-right
	             Stereo
	used by: 1
	linked by: 1
	configured latency: 75,00 ms; range is 0,50 .. 1837,50 ms
	card: 0 <alsa_card.pci-0000_00_1f.3>
	module: 6
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC298 Analog"
		alsa.id = "ALC298 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 0x601d160000 irq 167"
		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 = "34c8"
		device.product.name = "Smart Sound Technology Audio Controller"
		device.form_factor = "internal"
		device.string = "front:0"
		device.buffering.buffer_size = "352800"
		device.buffering.fragment_size = "176400"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		device.description = "Built-in Audio Analog Stereo"
		alsa.mixer_name = "Realtek ALC298"
		alsa.components = "HDA:10ec0298,17aa3818,00100103 HDA:8086280f,80860101,00100000"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-speakers"
		analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "audio-headphones"
	active port: <analog-output-headphones>

You've only partially tested the variables, e.g. check another set of headphones to make sure it's not just the hardware.

Also,

In what way? Buzzing? Crackling? Muted? Muddy? Missing frequencies?

Possibly not a software/configuration issue then?

ALSA data is showing in !!Modprobe options (Sound related) that kernel option to disable dmic (internal microphone array) dmic_detect=0 has been added to system twice

message in section !!ALSA/HDA dmesg suggests this option has been added as a GRUB boot option

Command line: BOOT_IMAGE=/boot/vmlinuz-5.7-x86_64 root=UUID=e19c2d0e-4aa5-40ca-999d-f90056759821 rw quiet apparmor=1 security=apparmor udev.log_priority=3 snd_hda_intel.dmic_detect=0 intel_iommu=off

suggest edit file /etc/default/grub to remove this option from GRUB_CMDLINE_LINUX_DEFAULT
then update grub to remove duplicated boot option

sudo update-grub

another message in section !!ALSA/HDA dmesg states

snd_hda_intel 0000:00:1f.3: dmic_detect option is deprecated, pass snd-intel-dspcfg.dsp_driver=1 option instead

suggest find the file in folder /etc/modprobe.d/ where option dmic_detect=0 was added

grep snd /etc/modprobe.d/*.conf

edit file and replace options snd-hda-intel dmic_detect=0 with options snd-intel-dspcfg.dsp_driver=1


Comment on Archwiki page mentions that only 2 of the 5 speakers on this laptop work on Linux

I have read in other articles from other Lenovo devices, like the X1 Yoga that they solve this by making the alsa/pulseaudio use 4 channels instead of 2. I haven't tried this so I cannot report on it

an earlier section on the same archwiki page has the solution from the X1 Yoga that may get 4 speakers working - see Linux 5.5 and later

latest information from the kernel bug report suggests that data for Realtek audio codec and Texas Instrument amplifier chip cannot be found to help with a solution - Bug 205755
problem with the TI amp may also be affecting audio to headphone socket

2 Likes

Hi all, thanks for the useful suggestions. They led me down the correct path. First, the problem was that the laptop was using the wrong driver. I blacklisted snd_hda_intel and installed sof-firmware. After reboot it started using the sof-audio-pci driver, which seems to be beter.

With the new driver the sound from the laptop is muuch better. The sound from the headphones appear to be more or less the same, but now I feel like I'm on the right track for debugging.

This also made my laptop mic to start working. I had not noticed that it was broken because I almost always use mic from headphones.

Here is the update alsa log: http://alsa-project.org/db/?f=a6ab762c1a2f1f496fbeffc014c7e201833588a9

1 Like

Another update: The latest Pulseaudio solved the remainder of my issues. Manjaro stable gives me Pulseaudio 13, which had problems with new high-end Lenovo laptops. I followed the advice here, which led to me the pulseaudio-git AUR for pulseaudio 13.99 (or soon 14). I uninstalled the Pulseaudio that came with Manjaro and installed the one in AUR. Everything seems to work ok now.

I was hoping to get some profound and deep insight into Linux sound architechture, but in the end it all came down to "install latest version & reboot" :slight_smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by