thesofproject / linux

Linux kernel source tree
Other
90 stars 130 forks source link

[BUG] Lenovo C940 no bass when playng via headphone jack #2375

Closed torotil closed 3 years ago

torotil commented 4 years ago

Describe the bug

I got sound working on my Lenovo Yoga C940 (i7-1065G7 Ice Lake). As expected not all of the speakers are working (https://bugzilla.kernel.org/show_bug.cgi?id=205755#c4). In addition to that I don’t get any bass from the headphone jacks.

To Reproduce Play some music when the headphones are plugged (using any player or even aplay). Result: Music is playing but lower frequencies are somehow filtered.

Reproduction Rate Always reproducible

Expected behavior Full range of frequencies is played.

Impact Sound is recognizable, but not enjoyable.

Environment 1) This is on gentoo linux using kernel 5.7.11 and sof-firmware 1.5.1 from the official repositories. 2) Name of the topology file

Screenshots or console output Here is the output of alsa-info.sh: http://alsa-project.org/db/?f=f562bb2f8ac9c15ff9653d26f198d83113bc12fb

Please let me know if there is any more information that would be useful.

plbossart commented 4 years ago

I am afraid this is again a codec configuration issue, not really something where SOF developers can help

juimonen commented 4 years ago

@torotil as @plbossart said we are not probably doing anything in SOF to make this happen... Have to say I've never heard/seen this kind of problems. I don't think we currently have any high-pass filters etc. on the playback path in DSP that could even accidentally remove your bass. Only thing I could think of is that there's some kind of filtering in the codec for the special 5 speaker setup and that it is "on" for some reason for your headphones also.

torotil commented 4 years ago

@juimonen @plbossart thanks for taking the time to like at this and answer!

Yes, it does sound like some high-pass filtering is enabled. Would the kernel bugzilla be the right place to post this?

juimonen commented 4 years ago

@torotil sorry about the delay... hmm I would ask first from Realtek folks do they have any idea (could be that kernel bugzilla is also good for that). @bardliao you have any idea from whom we could ask this in Realtek?

bardliao commented 4 years ago

@torotil sorry about the delay... hmm I would ask first from Realtek folks do they have any idea (could be that kernel bugzilla is also good for that). @bardliao you have any idea from whom we could ask this in Realtek?

I will contact with @shumingfan when I don't know who is the right person for this issue. @torotil The speaker issue is more like a codec config issue. However, for the headphone issue, what do you expect the bass? I think the only thing we can do is to check if there is any filter applied.

torotil commented 4 years ago

@bardliao Thanks for your input. I’m rather certain that sound is somehow filtered. It cuts off low frequencies (100Hz is OK, 80Hz almost imperceptible). When plugging the same headphones into another laptop I can hear basically every frequency from 15Hz up (and frequencies below at least as some kind of wobbling). So it does look like some filtering is being applied.

Here is the youtube video I’ve used for testing: https://www.youtube.com/watch?v=Sxs7GVbmWqs

bardliao commented 4 years ago

@torotil Do you know which topology do you use? There should be no filter if you use sof-hda-generic.tplg, but there is eq applied if you use sof-hda-generic-eq-2ch. You can find it in /lib/firmware/intel/sof-tplg folder. BTW, have you tried it on the same laptop with Windows? I am wandering if it is a codec limitation.

torotil commented 4 years ago

@torotil Do you know which topology do you use? There should be no filter if you use sof-hda-generic.tplg, but there is eq applied if you use sof-hda-generic-eq-2ch. You can find it in /lib/firmware/intel/sof-tplg folder.

I’ve found the folder and it shows me loads of different topologies. How can I find out which one is in use?

BTW, have you tried it on the same laptop with Windows? I am wandering if it is a codec limitation.

I’ve not ever run windows on this machine. I plan to get some Windows running in a Virtualbox this week (with PCI passthrough).

bardliao commented 4 years ago

@torotil Do you know which topology do you use? There should be no filter if you use sof-hda-generic.tplg, but there is eq applied if you use sof-hda-generic-eq-2ch. You can find it in /lib/firmware/intel/sof-tplg folder.

I’ve found the folder and it shows me loads of different topologies. How can I find out which one is in use?

Add options snd_sof dyndbg=+p in /etc/modprobe.d/sof-dyndbg.conf. You can create one if there is no sof-dyndbg.conf in your file system. And search loading topology:intel/sof-tplg/xxx.tplg where xxx.conf is what you are using.

torotil commented 4 years ago

Thanks. With this I get:

[ 2.580221] sof-audio-pci 0000:00:1f.3: loading topology:intel/sof-tplg/sof-hda-generic-2ch.tplg

plbossart commented 4 years ago

@bardliao Thanks for your input. I’m rather certain that sound is somehow filtered. It cuts off low frequencies (100Hz is OK, 80Hz almost imperceptible). When plugging the same headphones into another laptop I can hear basically every frequency from 15Hz up (and frequencies below at least as some kind of wobbling). So it does look like some filtering is being applied.

15 Hz sounds very very low... "Under ideal laboratory conditions, humans can hear sound as low as 12 Hz" https://en.wikipedia.org/wiki/Hearing_range#:~:text=Under%20ideal%20laboratory%20conditions%2C%20humans,between%202%2C000%20and%205%2C000%20Hz.

bardliao commented 4 years ago

Thanks. With this I get:

[ 2.580221] sof-audio-pci 0000:00:1f.3: loading topology:intel/sof-tplg/sof-hda-generic-2ch.tplg

There should be no filter applied on headset playback with sof-hda-generic-2ch.tplg. So I will wait for the test result of Windows.

juimonen commented 4 years ago

@plbossart @bardliao I guess we can argue what one of us can hear and can't hear.. :)

Anyway I think the thing is that @torotil can hear the relative difference between "normal" laptop and this one.

@plbossart @bardliao do we know the audio hw schematics (even roughly) with this device? What codec is it using and is there some special vendor hw (like dolby) on the audio patch? As said, with this topology we should not use any dsp filtering on the playback path.

@singalsu do you have this device? Can you quickly try out the headphone path, does it sound strange?

singalsu commented 4 years ago

I have a Lenovo Yoga X1 4th gen but it's Whiskey Lake-U based so not the same as C940 (Ice Lake). SOF firmware is v1.5.1. It plays the lowest bass OK.

To eliminate electrical/mechanical issue with 3.5 mm plug could you mix a e.g. 50 Hz stereo sine wave file with channels in-phase (copy same sine to L and R) and opposite-phase (invert polarity of one channel)? If they sound very different the headphone ground connection could be the problem. I assume you are a technical person able to do this since you use Github!

torotil commented 4 years ago

To eliminate electrical/mechanical issue with 3.5 mm plug could you mix a e.g. 50 Hz stereo sine wave file with channels in-phase (copy same sine to L and R) and opposite-phase (invert polarity of one channel)? If they sound very different the headphone ground connection could be the problem. I assume you are a technical person able to do this since you use Github!

Did that. [For me] there was no audible difference.

I will try it with windows next, but it will take me some time to get either qemu or Windown on another SSD to work.

Again thanks for your hints!

singalsu commented 4 years ago

Also is there difference if you hook it with line cable to a line-in of another amplifier (a high-impedance load)? Or headphones with much higher ohms rating (100 or more). If still the same sounds to me like codec programming issue if you are using a distributed topology (not e.g. a SOF high-pass EQ placed to headphones path).

torotil commented 4 years ago

Also is there difference if you hook it with line cable to a line-in of another amplifier (a high-impedance load)?

Same result as before: It sounds like the sound is being played through the headphones lying on my desk instead of through the speakers (and amplifier).

davidfers commented 3 years ago

I have this problem aswell, with the same yoga C940 i7-1065G7, on ubuntu 20.04. In windows it works fine. Any updates?

torotil commented 3 years ago

I have this problem aswell, with the same yoga C940 i7-1065G7, on ubuntu 20.04. In windows it works fine. Any updates?

Great to have someone else in the same boat. That makes it less likely that it’s just on fluke on my specific setup. And also great that you were able to test it on Windows!

So if this is indeed not a hardware issue and it does work in Windows: How can we proceed with debugging this?

torotil commented 3 years ago

It seems that the BIOS update from https://bugzilla.kernel.org/show_bug.cgi?id=205755 solved the issue for me (and also enabled the speakers).

I haven’t tested this for a while so there is a chance that updating my kernel to 5.10.10-gentoo (including the quirks also introduced in the linked issue) was enough to fix this problem.

plbossart commented 3 years ago

Closing since it's not clear if the problem still exists.