vitorafsr / i8kutils

Fan control for some Dell laptops
https://launchpad.net/i8kutils
GNU General Public License v3.0
216 stars 29 forks source link

i8kctl fan causes USB audio issue #15

Open ino1sr opened 5 years ago

ino1sr commented 5 years ago

When i8kctl fan is used on a dell XPS 9560, it causes an audio dropout of a few ms, which is manifested by an audio "click".

If used with i8kmon, at for example an interval of 2sec, it will cause a click every 2 seconds.

The problem manifests itself only with an USB sound card (mine is a focusrite scarlett 2i2).

I'm not sure if this is an issue that i8kutils can fix, but I think it could be documented.

x-hgg-x commented 5 years ago

I have the same problem on a Dell XPS 9570, but for me the audio glitches occurs even on the internal sound card. I have committed a fix (https://github.com/x-hgg-x/i8kutils/commit/c7823a0433b01e47ec3f804a714f3afcf263d36d) in which the program does not call i8kctl fan every 2 seconds, only when fan state must be changed.

laurentdebricon commented 4 years ago

confirming bug on dell xps 9370 with a focusrite 4i4 3gen, bios up to date, i get glitches, it's low but when you do music production, it's too much:

$ ./probe_i8k_calls_time 
functions time
i8k_get_bios_version() = 0.027462
i8k_get_machine_id() = 0.000003
i8k_get_cpu_temp() = 0.000580
i8k_get_fan_status() = 0.011954
i8k_get_fan_status() = 0.012316
i8k_get_fan_speed() = 0.001258
i8k_get_fan_speed() = 0.000640
i8k_get_power_status() = 0.000440
i8k_get_fn_status() = 0.000390
i8k_set_fan() = 0.012282
i8k_set_fan() = 0.013541
i8k_set_fan() = 0.013247
i8k_set_fan() = 0.013838
i8k_set_fan() = 0.013148
i8k_set_fan() = 0.012911

(got that with this manual https://bugs.launchpad.net/i8kutils/+bug/1349176/comments/11)

$sensors : no lag but

$ cat /proc/i8k : lag

x-hgg-x commented 4 years ago

The call times on a Dell XPS 9570 with bios 1.13 are much lower:

./probe_i8k_calls_time
functions time
i8k_get_bios_version() = 0.005874
i8k_get_machine_id() = 0.000001
i8k_get_cpu_temp() = 0.000849
i8k_get_fan_status() = 0.000785
i8k_get_fan_status() = 0.001928
i8k_get_fan_speed() = 0.000848
i8k_get_fan_speed() = 0.000785
i8k_get_power_status() = 0.000306
i8k_get_fn_status() = 0.000324
i8k_set_fan() = 0.002793
i8k_set_fan() = 0.001650
i8k_set_fan() = 0.002769
i8k_set_fan() = 0.001582
i8k_set_fan() = 0.002546
i8k_set_fan() = 0.001711

I had some problems with specific versions of bios where the lag was much greater, so you may try to downgrade your bios to see if the call times are affected.

laurentdebricon commented 4 years ago

i am building your patch now ... :P

khimaros commented 3 years ago

this is also a problem with XPS 13 9350 (0704) running BIOS firmware 1.11.1

for any following along, the patch above appears to have been merged with https://github.com/vitorafsr/i8kutils/commit/c7823a0433b01e47ec3f804a714f3afcf263d36d

however, the last debian/changelog entry (1.43) predates this by several months.

khimaros commented 3 years ago

i just tested @x-hgg-x patch above on a debian bullseye install, the problem persists

breedx2 commented 2 years ago

+1 confirming problem.

Laptop is XPS9550. Debian unstable, upgraded to tip last night and also included i8kutils (1.43+nmu1) in hopes it would reduce fan usage. Instead, USB audio started glitching. Much troubleshooting, nothing worked, removed package and audio is fine again (but fan stays on).

khimaros commented 2 years ago

@breedx2 i believe you can enable BIOS fan control to work around fan always on issue.

breedx2 commented 2 years ago

@breedx2 i believe you can enable BIOS fan control to work around fan always on issue.

Thanks @khimaros ....in my case I ended up blowing out the laptop with compressed air and the fan seems to be back to normal. This doesn't change the fact that usb audio is wrecked by i8kutils tho. :)

Wer-Wolf commented 2 years ago

The mentioned patch will cause i8kutils to stop working on older models which do not support fan speed readings. Maybe i8kutils could just stop checking the fan state after each timeout, since they are not useful for normal operation.