Arch Linux on 15,6" Defiance XS II

tqre

Member
Linux on 15,6" Defiance XS II

So I got my new laptop and proceeded to install ArchLinux on it.

Initially I had some hardware issues:

For starters I had to blacklist nouveau kernel module, which is the
open source version for Nvidia cards. The module made the machine freeze
when entering 'lspci' on command line.

That sorted, I installed a desktop environment and other necessary software, which in
most distros supply by default. Arch doesn't ;)

First problem was the 4G Module, Huawei ME936, which connected to my ISP
but I didn't get any internet connection. I solved this by using wvdial,
which sets up a ppp connection. Now it works, but not flawlessly: connection
disappears randomly, and modem refuses to reinitilize. Only option is to
reboot the machine, and it works again. Note that wvdial has to be run
as root, and all other network interfaces must be down. I have a backup
connection, so I'm using it as this is not reliable yet.

Next issue was the sounds. Both ALSA and Pulseaudio seemed to work by
all metrics, but no sound was coming out whatsoever. After some intense
googling and lots of frustration I found a solution:

Linux kernel module snd-hda-intel has an option to set model.
In Arch system I had to create following file:

/etc/modprobe.d/alsa.conf

and put the following line in:

options snd-hda-intel model=no-primary-hp

Now sound works almost as intended, only the 3-in-one input jack doesn't seem
to recognize my headset mic yet. Might be some minor issue, I'm just happy
I got decent sound controls.

Proprietary Nvidia drivers cause a lot of headaches for Linux users, but I
got them working too. There seems to be Intel video card inside too, the
switching videocard stuff I'll leave for later.

Still some things to figure out:
-Keyboard light controls, its just blue, looks like there is no driver for Linux
-Screen light controls work, but it's just on/off.

Overall the machine works, and I'm happy.
 
Last edited:

tqre

Member
Updates: got the 4G module working with some udev rules tweaking, it seems there is a bug with this modem (Huawei ME936), and Philipp Hufnagl posted a workaround.

Here is the relevant thread.
https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1735981

And here is the workaround (this is for Ubuntu):

edit udev rule /lib/udev/rules.d/77-mm-huawei-configuration.rules (create if not existent)
comment out everything in there
replace with:

ACTION=="add|change", SUBSYSTEM=="usb", \
ENV{DEVTYPE}=="usb_device", \
ATTR{idVendor}=="12d1", ATTR{idProduct}=="15bb", \
ATTR{bNumConfigurations}=="3", ATTR{bConfigurationValue}!="3" \
ATTR{bConfigurationValue}="3"

On Arch Linux udev rules have to be written in /etc/udev/rules.d to avoid overwriting during update process. Also
the relevant file is named 77-mm-huawei-net-port-types.rules
 
Last edited:

tqre

Member
Some more issues turned up when I plugged in my 2 external monitors: if I booted with the monitors plugged in, the terminal prompt just went nuts, and spammed ^@ characters all over the place, which made login impossible. One of the cpu cores was running close to 100%.
Task manager showed the instance causing the core load was Kworker/0:1, which is a Linux kernel process working on system calls.

The solution was not easy to find, but I finally found it from the Mac-section: one of the ACPI-interrupts was out of control and was sending thousands of interrupts to kernel, which could be seen with the command:

# grep . -r /sys/firmware/acpi/interrupts

...
/sys/firmware/acpi/interrupts/gpe35: 0 invalid unmasked
/sys/firmware/acpi/interrupts/gpe6F: 234873 enabled unmasked
/sys/firmware/acpi/interrupts/gpe63: 0 invalid unmasked
...

With the help of Arch wiki, by putting in the terminal:

# echo "disable" > /sys/firmware/acpi/interrupts/gpe6F

and the spam stopped. Ahhhh. Peace and quiet. Wiki warned not to disable random ACPI interrupts, as it could cause all kinds of problems. There was another interrupt with about the same amount of interrupt numbers (/interrupts/sci), which I didn't touch, but it eased up when I disabled gpe6F.

To load this command on boot, you have to make a custom systemd service.
I created the file:

/etc/systemd/system/suppress-gpe6F.service
[Unit]
Description=Disables runaway interrupt gpe6F

[Service]
ExecStart=/usr/bin/bash -c 'echo "disable" > /sys/firmware/acpi/interrupts/gpe6F'

[Install]
WantedBy=multi-user.target

and then proceeded to enable it on boot:
# systemctl enable suppress-gpe6F.service

A word on the multi-monitor setup:

Only way for me to get persistent monitor layout was using xrandr on x startup, other tools failed or behaved strangely.
So in /etc/X11/xinit/xinitrc file, I put the lines:
xrandr --output eDP-1-1 --primary --pos 1024x1050
xrandr --output HDMI-0 --pos 1024x0
xrandr --output DP-0 --pos 0x488

You should of course adjust the positions according to your needs. Also xinitrc can be user-specific, with the file /home/user/.xinitrc
 

SpyderTracks

We love you Ukraine
Really helpful info, I'm sure that will help a lot of people out, thanks a lot for sharing, posted lots of +rep
 

tqre

Member
Some more news on this front, found some time to configure my system :)
First of all, I was mistaken with the motherboard model, it is of Clevo P950ER series, not EP...

Some additional options for alsa.conf:

options snd-hda-intel model=no-primary-hp power_save=1

Unmuting channels automatically can be done with following script.
Put this into usr/local/bin/ and have your desktop environment autostart it on login.

soundfix.sh
amixer -c 0 sset Headphone 100 unmute

This unmutes headphones without the need to unmute things everytime. The routing with pulseaudio is still not correct, but this is good enough for now.

Keyboard backlight - I found the Linux drivers:

AUR (Arch User Repository) has the driver packages to build keyboard backlight drivers:

Packages needed:
clevo-xsm-wmi-dkms (the kernel module)
clevo-xsm-wmi-util (gui, optional I guess)

I chose to built the driver as dkms (Dynamic Kernel Module Support) module.
You have to build these packages from source with additional patching specific to Defiance XS II.

The problem was that the driver didn't find the hardware, because the identification tag is PC Specialist specific.
I made a patch to supply the correct identifier for the module to load, and magic started to happen on my keyboard:

The module source has a long list of identification tags, the following lines have to be found in the driver source (clevo-xsm-wmi.c) to get the driver working:

Code:
        {
		.ident = "Clevo P950ER",
		.matches = {
			DMI_MATCH(DMI_PRODUCT_NAME, "DefianceXS II 15"),
		},
		.callback = clevo_xsm_dmi_matched,
		.driver_data = &kb_full_color_ops,
	},
You have to compile the driver with this patched in, and then enable and load the driver with systemd.
systemctl enable clevo-xsm-wmi
systemctl start clevo-xsm-wmi

This will most likely work with other Clevo machines and Linux distros too. You can find the right dmi identification string with dmidecode tool, which should be available on most distros. Correct dmi id string is found in 'System Information' handle when using dmidecode, not Base Board information as I first thought.

You can find some more information on the keyboard backlight driver here (along with the latest source code). This was my ultimate source for help with this problem:
https://bitbucket.org/tuxedocomputers/clevo-xsm-wmi

Additionally, this module supposedly makes the airplane button to work (have to test it properly still, at least the indicator led is responding now).
All the shortcuts for keyboard backlight (Fn+numpad buttons) _do_ work now!
 

tqre

Member
A solution to screen backlight control:

to /etc/modprobe.d create file i915.conf with contents:
options i915 enable_dpcd_backlight=1

This doesn't work correctly yet, but it makes the brightness buttons respond. You need additional kernel parameters. Most Linux users have these already there because of lspci lockup issue:
acpi_osi="!Windows 2015" acpi_backight=video

to make this persistent in grub, edit /etc/default/grub file:
HTML:
GRUB_CMDLINE_LINUX_DEFAULT="acpi_osi=\"!Windows 2015\" acpi_backlight=video"

and regenerate your grub.cfg

Screen brightness keys work now. Fn+F8 and Fn+F9 for brightness and Fn+F2 for turning off LCD display.
 
Last edited:

sentinel

Member
@tqre Thanks for the info! Are you having any issues related to the fans being very noisy even with non-intensive use and being super loud with heavy usage, such as compiling or using editing / rendering software?
 

tqre

Member
Indeed, the laptop can get quite hot and noisy. Especially withcompiling or heavy graphics stuff going on.

Laptops in general get hot when used intensively. I use a cooling pad, but in the summertime it might not be enough. While gaming, my dmesg gets often cluttered with CPU running too hot warnings.

I found out that the turbo-boost mode with this machine is by default turned on. Extra kick is there whenever needed, but when clockspeeds are constantly at 4GHz+, it sure generates a lot of heat.

This turbo-boost can be toogled on and off, which for me solves heating and fan noise issues.
Following command tells if the turbo is on or off. Note that it's a bit counter-intuitive, as when no_turbo is on, turbo is off...

Code:
cat sys/devices/system/cpu/intel_pstate/no_turbo

This displays 0 or 1 whether the turbo is off or on.

This can be toggled off (as root) with:

Code:
echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo

I made a small script to toggle turbo boost:

Code:
#!/bin/bash

if [ "$(id -u)" != "0" ] ; then
	echo Log in as root and run this!
	exit
fi

if [ "$(cat /sys/devices/system/cpu/intel_pstate/no_turbo)" = "0" ] ; then
	echo Turbo is ON, deactivating...
	echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
	cat /proc/cpuinfo | grep "cpu MHz"
	echo Intel pstates turbo boost is now OFF
else
	echo Turbo is OFF, activating...
	echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo
	cat /proc/cpuinfo | grep "cpu MHz"
	echo Intel pstates turbo boost is now ON
fi
 
Last edited:

tqre

Member
Note on sound config:

With the latest kernel (4.20.1), soundboard is now recognized correctly, and should work out of the box. So earlier alsa.conf with scripts I mentioned to mute and unmute headphones are no longer needed. Speakers and headphones mute and unmute now correctly. One small detail still remains: after plugging and unplugging headphones, the red led inside the jack sometimes stays on. It might be a mechanical thing, but now as I'm testing it, the led turns off correctly.
 

sentinel

Member
Thanks for the info, I disabled the turbo but I'm assuming this only has an impact with heavy use. In my case, fans are quite noisy even when in very light use or idle, the just get crazy loud when usage gets intense.
 

Lavaridge

Active member
Have you had any luck resolving the fan noise issue? I tried fancontrol but got "There are no pwm-capable sensor modules installed" when running pwmconfig, and not sure how to go any further. The noise seems to be the last major Linux pain for me on this machine.
 
Top