Skip to content

Instantly share code, notes, and snippets.

@Brainiarc7
Last active August 7, 2019 21:02
Show Gist options
  • Save Brainiarc7/e21f25333ad0704d729337a44ec60e4b to your computer and use it in GitHub Desktop.
Save Brainiarc7/e21f25333ad0704d729337a44ec60e4b to your computer and use it in GitHub Desktop.
Get the Clevo P75x-series SKUs running optimally with Ubuntu 16.04LTS

References:

  1. http://bazaar.launchpad.net/%7Esystem76-dev/system76-driver/trunk/view/head:/system76driver/tests/test_model.py
  2. http://bazaar.launchpad.net/%7Esystem76-dev/system76-driver/trunk/view/head:/system76driver/products.py
  3. http://bazaar.launchpad.net/%7Esystem76-dev/system76-driver/trunk/view/head:/system76driver/actions.py

Notes:

We will use the work above as a reference on which the work below is based upon:

For the P751DM2-G model, we can see that the matching model here is the serw10 identifier, whose workarounds are shown below:

system76-driver/products.py

'serw10': {
    'name': 'Serval WS',
    'drivers': [
        actions.backlight_vendor,
        actions.dac_fixup,
        actions.pulseaudio_hp_spdif_desc,
        actions.hidpi_scaling,
    ],
},

Armed with that knowledge, we can now infer as to what each mapped action does and what changes need to be made.

So, for the actions.backlight_vendor, all it needs is an appending of the option acpi_backlight=vendor to the kernel option line in /etc/default/grub and we're done. Regenerate the grub configuration by running:

sudo update-grub

And you're good to go.

The second action, dac_fixup, is a two-step process, inferred from the actions.py subroutine:

(a). Create a /lib/firmware/system76-audio-patch with the following entry:

[codec]
0x{vendor_id:08x} 0x{subsystem_id:08x} 0

[pincfg]
0x1b 0x01111060

[verb]
0x1b 0x707 0x0004

(b). Create an /etc/modprobe.d/system76-alsa-base.conf file with the following entries:

 options snd-hda-intel patch=system76-audio-patch

Then reboot the system. Confirm the successful override by grepping dmesg on boot:

 dmesg | grep system76

The next workaround is the pulseaudio_hp_spdif_desc , which applies the following workarounds:

(a). Create the file usr/share/pulseaudio/alsa-mixer/paths/iec958-stereo-output.conf and populate it with:

# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of the
# License, or (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.


[General]
description = Headphones + Digital Output (S/PDIF)

[Element IEC958]
switch = mute

When done, issue a reboot.

Optional: System76's quirk for the Nvidia driver:

Populate the file /usr/share/nvidia-common/quirks/system76-nvidia-quirks-serw10 with the content below:

Section "Quirk"
    Identifier "system76-0-serw10"
    Handler "nvidia-375"
    Match "sys_vendor" "System76, Inc.|System76"
    Match "product_version" "serw10"
    XorgSnippet
        Section "Device"
            Identifier "System76 nVidia Card"
            Driver "nvidia"
            Option "NoLogo" "True"
            Option "FlatPanelProperties" "DFP-1: Dithering = Enabled"
        EndSection
    EndXorgSnippet
EndSection

The quirk is optional, as the default Nvidia installer does it's job fairly well.

Extra troubleshooting hints:

You can view sound card pin configurations by running:

sudo cat /sys/devices/pci0000:00/0000:00:1f.3/sound/card0/hwC0D0/init_pin_configs

In my case, this is the output, useful when you need to confirm the pin configuration before applying firmware patches as shown above:

0x11 0x4004d000
0x12 0x90a60140
0x14 0x90170110
0x15 0x411111f0
0x16 0x411111f0
0x17 0x01011050
0x18 0x01a11030
0x19 0x411111f0
0x1a 0x0181103f
0x1b 0x411111f0
0x1c 0x411111f0
0x1d 0x40350d29
0x1e 0x01441120
0x1f 0x411111f0
@Brainiarc7
Copy link
Author

What works with the workarounds above:

  1. Backlight control is restored.

  2. The SPDIF profile can now be selected by userland controls such as pavucontrol.

What doesn't:

  1. The ESS Sabre Audio jack does not work (yet)

  2. The integrated fingerprint reader isn't recognized by libfprintd (yet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment