HP Envy 15-ah150sa
19 | 25 Jan 2016APU Info : AMD A10-8700P Radeon R6, 10 Compute Cores 4C+6G
I've owned a number of HP laptops now, and this is the first one that has caused any headache.
The laptop comes with 8G ram in a single chip but has 2 slots, using dmidecode you can find the model number to get the same chip again, the chip used is marketed as having low power usage. You could get any compatible ram but i prefer to keep the same models.
Page Sections / Quick Links
- Sound
- Wifi
- Graphics
- ACPI Issues
- DSDT tables
- Firmware bugs
- Outstanding Bugs
- Editing The Brightness
- Trusted Platform Module
- Final Thoughts
- Update 21st May 2016
- Update 23rd Oct 2016
- Update 5th Nov 2016
Handle 0x0020, DMI type 17, 40 bytes
Memory Device
Array Handle: 0x001F
Error Information Handle: 0x0022
Total Width: 64 bits
Data Width: 64 bits
Size: 8192 MB
Form Factor: SODIMM
Set: None
Locator: Bottom-slot 1(left)
Bank Locator: CHANNEL A
Type: DDR3
Type Detail: Synchronous Unbuffered (Unregistered)
Speed: 800 MHz
Manufacturer: Hynix
Part Number: HMT41GS6BFR8A-PB
Rank: 2
Configured Clock Speed: 800 MHz
Minimum Voltage: 1.35 V
Maximum Voltage: 1.5 V
Configured Voltage: 1.35 V
I removed the original harddisk which is a 1Tb hybrid drive, and swapped it out for a samsung evo ssd. It's a good idea to keep the original disk around as hp only provide BIOS updates via windows exe's despite having usb images.
To open the odd chasis, unscrew all the screws on the bottom and pry from the back where the monitor joins. There is a youtube video that shows how to open this model, worth a check, but you don't need to remove the battery to remove the harddisk.
Sound...
I found the power saving modes preventing sound for working properly, so for now i've just diabled any power saving modes;
mike@mike-laptop4:~$ cat /etc/modprobe.d/snd_hda_intel.conf
options snd_hda_intel power_save=0
options snd_hda_intel power_save_controller=N
Wifi...
I grabbed the firmware from wireless.wiki.kernel.org. I had the same issues with wifi as sound regarding powersaving, disabling the powersaving makes the wireless work flawlessly, tested on both 2.4Ghz and 5Ghz.
03:00.0 Network controller: Intel Corporation Wireless 3165 (rev 81)
DeviceName: SP1
Subsystem: Intel Corporation Dual Band Wireless AC 3165
Flags: bus master, fast devsel, latency 0, IRQ 39
Memory at f1000000 (64-bit, non-prefetchable) [size=8K]
Capabilities: [c8] Power Management version 3
Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [40] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Device Serial Number dc-53-60-ff-ff-5f-cb-f2
Capabilities: [14c] Latency Tolerance Reporting
Capabilities: [154] L1 PM Substates
Kernel driver in use: iwlwifi
Kernel modules: iwlwifi
ucode download: https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi
mike@mike-laptop4:~$ cat /etc/modprobe.d/iwlwifi.conf
options iwlmvm power_scheme=1
options iwlwifi 11n_disable=1 bt_coex_active=N swcrypto=1
Graphics...
I upped the kernel and compiled it with amdgpu, this is the latest open source kernel driver for the apu. I think the apu is too new for the proprietary driver flgrx but I've not tested this... With this driver the cpu shows little to no additional load when running glxgears / Unigine_Heaven-4.0 (a quick test to see you are processing the graphics with apu/gpu rather than the cpu), the refresh rate is synced, you can check this with glxgears to see you get a refresh rate the same as your monitor, 60Ghz 60 FPS.
mike@mike-laptop4:~/src/kernel/linux-4.4.5$ cat .config | grep -i amdgpu
CONFIG_EXTRA_FIRMWARE="amdgpu/carrizo_ce.bin amdgpu/carrizo_me.bin amdgpu/carrizo_mec2.bin amdgpu/carrizo_mec.bin amdgpu/carrizo_pfp.bin amdgpu/carrizo_rlc.bin amdgpu/carrizo_sdma1.bin amdgpu/carrizo_sdma.bin amdgpu/carrizo_uvd.bin amdgpu/carrizo_vce.bin"
CONFIG_DRM_AMDGPU=m
# CONFIG_DRM_AMDGPU_CIK is not set
CONFIG_DRM_AMDGPU_USERPTR=y
The firmware ucode is availbile in debian package "firmware-amd-graphics".
ii firmware-amd-graphics 20160110-1 all Binary firmware for AMD/ATI graphics chips
I've tested the cpu in action with XCOM: Enemy Unknown, and it ran nicely.
Unigine Heaven testing results:
Although it states 256M vram, the vram is actually 512M with 256M accessible by cpu, although i belive with apu's the vram is actually an allocation of system memory.
glxinfo:
Extended renderer info (GLX_MESA_query_renderer):
Vendor: X.Org (0x1002)
Device: AMD CARRIZO (DRM 3.1.0, LLVM 3.7.1) (0x9874)
Version: 11.1.2
Accelerated: yes
Video memory: 512MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 3.2
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0
dmesg:
[ 1.581944] amdgpu 0000:00:01.0: VRAM: 512M 0x0000000000000000 - 0x000000001FFFFFFF (512M used)
[ 1.581960] [drm] Detected VRAM RAM=512M, BAR=256M
[ 1.582115] [drm] amdgpu: 512M of VRAM memory ready
[ 2.862686] [drm] vram apper at 0xE0000000
ACPI Issues
unfortunatley the laptop has shipped with terrible firmware / DSDT tables, I had tweeked and compiled into the kernel, however the latest bios update (2016-04-14) includes these tweeks.
The first stop for diagnosing / testing acpi issues is with command line options / boot paramiters passed to the kernel which instruct the kernel to load / not load certain acpi modules.
At first I had installed without uefi, using acpi=off the laptop performed perfectly, however graphic were slow and the kernel was presented a single core. Jumpling up to acpi=ht most of the issues present with default boot were still present.
reviewing the OSI, there were a number of forums online where there were suggestions for acpi_osi=linux, however reading the documentation, this is not a great help.
/*
* The story of _OSI(Linux)
*
* From pre-history through Linux-2.6.22,
* Linux responded TRUE upon a BIOS OSI(Linux) query.
*
* Unfortunately, reference BIOS writers got wind of this
* and put OSI(Linux) in their example code, quickly exposing
* this string as ill-conceived and opening the door to
* an un-bounded number of BIOS incompatibilities.
*
* For example, OSI(Linux) was used on resume to re-POST a
* video card on one system, because Linux at that time
* could not do a speedy restore in its native driver.
* But then upon gaining quick native restore capability,
* Linux has no way to tell the BIOS to skip the time-consuming
* POST -- putting Linux at a permanent performance disadvantage.
* On another system, the BIOS writer used OSI(Linux)
* to infer native OS support for IPMI! On other systems,
* OSI(Linux) simply got in the way of Linux claiming to
* be compatible with other operating systems, exposing
* BIOS issues such as skipped device initialization.
*
* So "Linux" turned out to be a really poor chose of
* OSI string, and from Linux-2.6.23 onward we respond FALSE.
*
* BIOS writers should NOT query _OSI(Linux) on future systems.
* Linux will complain on the console when it sees it, and return FALSE.
* To get Linux to return TRUE for your system will require
* a kernel source update to add a DMI entry,
* or boot with "acpi_osi=Linux"
*/
so if you are to play arround with the acpi_osi, i'd reccomend check the values availible from a DSTD dump and pick one of the windows osi's, for example "Windows 2015". This firmware does try to check if you are booting linux;
[ 0.407587] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored
Extracting the DSDT tables from bios / firmware
You'll not only want the DSDT but the SSDT also... (when compiling you'll see the correct field data types and slightly differnt results regarding error output). This shouldn't cause any issues when using a custom dsdt, but it's nice to get the full picture.
sudo cat /sys/firmware/acpi/tables/DSDT > dsdt.aml
sudo cat /sys/firmware/acpi/tables/SSDT1 > ssdt1.aml
sudo cat /sys/firmware/acpi/tables/SSDT2 > ssdt2.aml
sudo cat /sys/firmware/acpi/tables/SSDT3 > ssdt3.aml
sudo cat /sys/firmware/acpi/tables/SSDT4 > ssdt4.aml
sudo cat /sys/firmware/acpi/tables/SSDT5 > ssdt5.aml
sudo cat /sys/firmware/acpi/tables/SSDT6 > ssdt6.aml
sudo cat /sys/firmware/acpi/tables/SSDT7 > ssdt7.aml
Decompile DSDT
iasl -e ssdt1.aml ssdt2.aml ssdt3.aml ssdt4.aml ssdt5aml ssdt6.aml ssdt7.aml -d dsdt.aml
Compile DSDT
iasl -ta dsdt.dsl -e ssdt1.dsl ssdt2.dsl ssdt3.dsl ssdt4.dsl ssdt5.dsl ssdt6.dsl ssdt7.dsl
Verifying the DSDT table has been overridden
mike@mike-laptop4:~$ dmesg | grep -i acpi
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.4.5-M1 root=UUID=293cc091-177b-4bf4-aac3-e4a8a73287cb ro initrd=/install/gtk/initrd.gz "acpi_osi=Windows 2015" acpi.debug_layer=0xffffffff acpi.debug_level=0x2
...
[ 0.000000] ACPI: FACP 0x00000000DFBF1000 00010C (v05 HPQOEM SLIC-MPC 00000001 HP 00040000)
[ 0.000000] ACPI: Override [DSDT-SLIC-MPC], this is unsafe: tainting kernel
[ 0.000000] ACPI: DSDT 0x00000000DFBE2000 Logical table override, new table: 0xFFFFFFFF81AACEA0
[ 0.000000] ACPI: DSDT 0xFFFFFFFF81AACEA0 008C1F (v01 HPQOEM SLIC-MPC 00040000 INTL 20160318)
[ 0.000000] ACPusI: FACS 0x00000000DFB30000 000040
Firmware bugs
1. Missing function for the default backlight, this function sets the default backlight level to 30, on this machine the max is 255 (/sys/class/backlight/amdgpu_bl0/max_brightness).
[ 0.412648] [Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness
// Mike Added for backlight
Method (_BQC, 0, NotSerialized) // _BQC: Brightness Query Current
{
Return (0x14) // = 20%, v=9/49, actual=51/255
}
I had thought the latest BIOS update introduced this method, but it hasn't. When you take subsequent DSDT dumps, it will include functions from an override DSDT.
2. Compiler Errors;
original:
Method (APCL, 0, NotSerialized)
{
Local0 = PTVL /* _SB_.PCI0.LPC0.EC0_.PTVL */
Name (MPEN, 0x04)
_PR.C000._PPC = Local0
If ((MPEN >= One))
{
_PR.C001._PPC = Local0
If ((MPEN >= 0x02))
{
_PR.C002._PPC = Local0
If ((MPEN >= 0x03))
{
_PR.C003._PPC = Local0
}
}
}
Notify (_PR.C000, 0x80) // Performance Capability Change
If ((MPEN >= One))
{
Notify (_PR.C001, 0x80) // Performance Capability Change
If ((MPEN >= 0x02))
{
Notify (_PR.C002, 0x80) // Performance Capability Change
If ((MPEN >= 0x03))
{
Notify (_PR.C003, 0x80) // Performance Capability Change
}
}
}
}
Edits I had made:
// Mike edit...
Method (APCL, 0, NotSerialized)
{
Local0 = PTVL /* _SB_.PCI0.LPC0.EC0_.PTVL */
Name (MPEN, 0x04)
Store (_PR.C000._PPC, Local0)
If ((MPEN >= One))
{
Store (_PR.C001._PPC, Local0)
If ((MPEN >= 0x02))
{
Store (_PR.C002._PPC, Local0)
If ((MPEN >= 0x03))
{
Store (_PR.C003._PPC, Local0)
}
}
}
Notify (_PR.C000, 0x80) // Performance Capability Change
If ((MPEN >= One))
{
Notify (_PR.C001, 0x80) // Performance Capability Change
If ((MPEN >= 0x02))
{
Notify (_PR.C002, 0x80) // Performance Capability Change
If ((MPEN >= 0x03))
{
Notify (_PR.C003, 0x80) // Performance Capability Change
}
}
}
}
Latest from new BIOS update;
Method (APCL, 0, NotSerialized)
{
Local0 = PTVL /* _SB_.PCI0.LPC0.EC0_.PTVL */
Name (MPEN, 0x04)
Local0 = _PR.C000._PPC ()
If ((MPEN >= One))
{
Local0 = _PR.C001._PPC ()
If ((MPEN >= 0x02))
{
Local0 = _PR.C002._PPC ()
If ((MPEN >= 0x03))
{
Local0 = _PR.C003._PPC ()
}
}
}
Notify (_PR.C000, 0x80) // Performance Capability Change
If ((MPEN >= One))
{
Notify (_PR.C001, 0x80) // Performance Capability Change
If ((MPEN >= 0x02))
{
Notify (_PR.C002, 0x80) // Performance Capability Change
If ((MPEN >= 0x03))
{
Notify (_PR.C003, 0x80) // Performance Capability Change
}
}
}
}
3. Compiler Error
dsdt.dsl 6054: ~Arg1
Error 6114 - ^ Result is not used, operator has no effect
original:
Method (ALWR, 2, NotSerialized)
{
If (^^LPC0.ECOK ())
{
If (((Arg0 == 0x29) || (Arg0 == 0x2B)))
{
If ((Arg0 == 0x29))
{
ACCW (0x2B, Arg1)
}
Else
{
~Arg1
Arg1++
ACCW (0x29, Arg1)
}
}
Else
{
ACCW (Arg0, Arg1)
}
}
}
Edits I made:
Method (ALWR, 2, NotSerialized)
{
If (^^LPC0.ECOK ())
{
If (((Arg0 == 0x29) || (Arg0 == 0x2B)))
{
If ((Arg0 == 0x29))
{
ACCW (0x2B, Arg1)
}
Else
{
//Mike edit
//~Arg1
Not(Arg1,Arg0)
Arg1++
ACCW (0x29, Arg1)
}
}
Else
{
ACCW (Arg0, Arg1)
}
}
}
Other changes brought in by the BIOS update:
within a battery information function (BIFX);
Local2 = (Local2 * BASC)
changed to;
Local2 *= BASC /* _SB_.PCI0.LPC0.BAT1.BASC */
Outstanding Bugs
1. ACPI Warning: Large Reference Count
Causes massive logging output
/*******************************************************************************
*
* FUNCTION: acpi_ut_update_ref_count
*
* PARAMETERS: object - Object whose ref count is to be updated
* action - What to do (REF_INCREMENT or REF_DECREMENT)
*
* RETURN: None. Sets new reference count within the object
*
* DESCRIPTION: Modify the reference count for an internal acpi object
*
******************************************************************************/
/*
* Sanity check the reference count, for debug purposes only.
* (A deleted object will have a huge reference count)
*/
if (new_count > ACPI_MAX_REFERENCE_COUNT) {
ACPI_WARNING((AE_INFO,
"Large Reference Count (0x%X) in object %p, Type=0x%.2X",
new_count, object, object->common.type));
}
2. ACPI / DSDT causing occasional system freeze
3. Regular oops on boot
4. acpi bug: "WLVD Namespace"
from the decompiled DSDT, i've found a reference to WLVD, but it's an external function, one that i've not found in the SSDT's...
On digging WLVD is part of WMI (Windows Management Instrumentation), which obviously does not exist in linux, removing these functions may provide better stablility... under testing...
[ 0.526888] ACPI Error: [WLVD] Namespace lookup failure, AE_NOT_FOUND (20150930/psargs-359)
[ 0.526903] Initialized Local Variables for method [_STA]:
[ 0.526908] Local0: ffff8803ec48f278 Integer 0000000000000000
[ 0.526919] No Arguments are initialized for method [_STA]
[ 0.526924] ACPI Error: Method parse/execution failed [_SB.WLBU._STA] (Node ffff8803ee8b1158), AE_NOT_FOUND (20150930/psparse-542)
5. acpi bug: "_SB_.RTC_.RTCW Namespace"
[ 6.001499] ACPI Error: [_SB_.RTC_.RTCW] Namespace lookup failure, AE_NOT_FOUND (20150930/psargs-359)
[ 6.004545] No Local Variables are initialized for method [ESDT]
[ 6.007505] No Arguments are initialized for method [ESDT]
[ 6.010566] ACPI Error: Method parse/execution failed [_SB.WMID.ESDT] (Node ffff8803ee8d81f8), AE_NOT_FOUND (20150930/psparse-542)
[ 6.012448] ACPI Error: Method parse/execution failed [_SB.PCI0.LPC0.EC0._Q42] (Node ffff8803ee8bb748), AE_NOT_FOUND (20150930/psparse-542)
Updating Display Brightness without the Firmware
If you've disabled acpi or disabled the ssdts then the brighness buttons won't work. As a work around you can edit the brightness via the pci device in sysfs, this could be scripted.
root@mike-laptop4:/home/mike# cd /sys/class/backlight/amdgpu_bl0
root@mike-laptop4:/sys/class/backlight/amdgpu_bl0# echo "100" > brightness
Updating Display Brightness with the Firmware
The brightness buttons trigger the DSDT methods "_Q11" and "_Q12", Q11 will notify VGA.LCD with 0x87 (ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS), and the Q12 method will notify VGA.LCD with 0x86 (ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS). These notifications should be handled by video.ko. Once the video kernel module has been loaded the directory "/sys/class/backlight/acpi_video0" should be present. The brightness levels used via acpi are defined in BCL, which in this DSDT contains 49 presets.
to force the use of the kernel video driver you can use the kernel command line option "acpi_backlight=video".
$ acpi_listen
video/brightnessdown BRTDN 00000087 00000000
video/brightnessup BRTUP 00000086 00000000
once the DSDT is clean, and the video module is loaded the volume buttons will work but you can also edit the acpi brightness manually.
root@mike-laptop4:/home/mike# cd /sys/class/backlight/acpi_video0
root@mike-laptop4:/sys/class/backlight/acpi_video0# echo 9 > brightness
Trusted Platform Module (TPM) Device
Debian does have packages for managing TPM, but for now, i've simpley hidden the device, making it availible caused issues when booting, the device can be hidden in the BIOS.
ii tpm-tools 1.3.8-2+b1 amd64 Management tools for the TPM hardware (tools)
Final Thoughts
Great laptop, just a shame about the firmware... hopefully the final kinks will get ironed out soon...
Update 21st May 2016
I've now managed to get 100% succesful boot with hyperthreading and uefi, something i'd only achieved before with the legacy boot and acpi switched off.
Kernel params used;
mike@mike-laptop4:~$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-4.6.0-M2 root=UUID=293cc091-177b-4bf4-aac3-e4a8a73287cb ro initrd=/install/gtk/initrd.gz pci=noearly acpi=ht acpi_no_static_ssdt amd_iommu=force_isolation
Update 23rd Oct 2016
I've created a github repo which has a skel of the config files I'm using. (kernel config, kernel modules, module params, and a few other little bits). Note with the kernel boot time params, there is no need to tweek the firmware as a bunch of it is skipped.
In order to get the missing functionality for example TPM I expect some of the SSDT's that don't break linux would need loading into a custom DSDT, but it's a pretty boring job... (maybe later...)
Github Repo: https://github.com/mikejonesey/hp-envy-15-ah150sa
Update 5th Nov 2016
I've started working on a custom DSDT that will allow the tpm device to work. Seccond on the list will be enabling the various CPU frequencies, although I expect this is the SSDT causing most of this issues.
SSDT Details
ssdt1.dsl : Windows Management Instrumentation Device
ssdt2.dsl : Performance Control (Guessing cpu stuff)
ssdt3.dsl : PNP Motherboard Resources
ssdt4.dsl : TPM2 (Trusted Platform Module)
ssdt5.dsl : AS34 (Something to do with the fan or laptop cooling)
ssdt6.dsl : VGA (Something to do with the monitor)
ssdt7.dsl : CPNV (Maybe system memory)
ssdt8.dsl : SATA Controller (Disk Control)
Using a DSDT override, i've got cpu-frequency stats which show "Turbo Mode" enabled;
$ sudo cpupower frequency-info
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 4.0 us
hardware limits: 1.30 GHz - 1.80 GHz
available frequency steps: 1.80 GHz, 1.60 GHz, 1.30 GHz
available cpufreq governors: conservative powersave userspace ondemand performance
current policy: frequency should be within 1.30 GHz and 1.80 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency: 1.80 GHz (asserted by call to hardware)
boost state support:
Supported: yes
Active: yes
Boost States: 5
Total States: 8
Pstate-Pb0: 3200MHz (boost state)
Pstate-Pb1: 3000MHz (boost state)
Pstate-Pb2: 2700MHz (boost state)
Pstate-Pb3: 2300MHz (boost state)
Pstate-Pb4: 2100MHz (boost state)
Pstate-P0: 1800MHz
Pstate-P1: 1600MHz
Pstate-P2: 1300MHz
Testing CPU Boost (stress)
CPU Average freq(KHz) Time in C0 Time in Cx C0 percentage
000 3024000 00 sec 443 ms 00 sec 556 ms 44
001 3006000 00 sec 534 ms 00 sec 465 ms 53
002 1332000 00 sec 043 ms 00 sec 956 ms 04
003 1332000 00 sec 064 ms 00 sec 935 ms 06