Flipping or Folding 2-in-1 Laptop disables Bluetooth and Wifi

Hello all,
I'm Lava and I'm quite new to Linux, although I'd been wanting to switch for awhile.
I recently got a convertible HP ENVY x360, and I installed Garuda alongside windows 11 because it looked the prettiest out of anything I'd seen. I really, really like it, but a few weird things are happening. The keyboard is designed to turn off if:

  1. You fold the laptop back on itself (specifically, past 180 degrees) for use like a tablet, or
  2. You rotate it enough so that it's sideways or upside-down.
    In windows, when the keyboard turns off, the orientation of the display and the input flips to accommodate the orientation of the machine. In Garuda, however, that doesn't happen, and instead both Wifi and Bluetooth become disabled (not disconnected, disabled.) When you return the laptop to its original position, the keyboard comes back on and Bluetooth and Wifi are restored. I can start either connection while the keyboard is off, but they just disable again after a few seconds. All I can figure is that whatever sensors would normally control display and input orientation are controlling Wifi and Bluetooth instead, and I have no idea why. Can anyone tell me what's happening, or even give me a place to start my investigations?
    Thanks!

garuda -inxi:

System:
Kernel: 5.16.9-zen1-1-zen x86_64 bits: 64 compiler: gcc v: 11.2.0
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=949f1291-843a-49d5-a0cf-30cb83ca910e rw [email protected]
quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0 loglevel=3
Desktop: KDE Plasma 5.24.1 tk: Qt 5.15.2 info: latte-dock wm: kwin_x11
vt: 1 dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
Type: Convertible System: HP product: HP ENVY x360 Convertible 15-ed1xxx
v: Type1ProductConfigId serial: <superuser required> Chassis: type: 31
serial: <superuser required>
Mobo: HP model: 8825 v: 48.42 serial: <superuser required> UEFI: Insyde
v: F.21 date: 12/13/2021
Battery:
ID-1: BAT1 charge: 26.5 Wh (53.9%) condition: 49.2/51.0 Wh (96.4%)
volts: 12.3 min: 11.6 model: Hewlett-Packard PABAS0241231 type: Li-ion
serial: <filter> status: Charging
Device-1: hid-0018:04F3:2B11.0001-battery model: ELAN2514:00 04F3:2B11
serial: N/A charge: N/A status: N/A
CPU:
Info: model: 11th Gen Intel Core i7-1165G7 bits: 64 type: MT MCP
arch: Tiger Lake family: 6 model-id: 0x8C (140) stepping: 1 microcode: 0x9A
Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
L1: 320 KiB desc: d-4x48 KiB; i-4x32 KiB L2: 5 MiB desc: 4x1.2 MiB
L3: 12 MiB desc: 1x12 MiB
Speed (MHz): avg: 594 high: 882 min/max: 400/4700 scaling:
driver: intel_pstate governor: powersave cores: 1: 440 2: 472 3: 537 4: 564
5: 882 6: 435 7: 854 8: 570 bogomips: 44851
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Vulnerabilities:
Type: itlb_multihit status: Not affected
Type: l1tf status: Not affected
Type: mds status: Not affected
Type: meltdown status: Not affected
Type: spec_store_bypass
mitigation: Speculative Store Bypass disabled via prctl
Type: spectre_v1
mitigation: usercopy/swapgs barriers and __user pointer sanitization
Type: spectre_v2
mitigation: Enhanced IBRS, IBPB: conditional, RSB filling
Type: srbds status: Not affected
Type: tsx_async_abort status: Not affected
Graphics:
Device-1: Intel TigerLake-LP GT2 [Iris Xe Graphics] vendor: Hewlett-Packard
driver: i915 v: kernel bus-ID: 0000:00:02.0 chip-ID: 8086:9a49
class-ID: 0300
Device-2: Chicony HP Wide Vision HD Camera type: USB driver: uvcvideo
bus-ID: 3-5:2 chip-ID: 04f2:b748 class-ID: fe01 serial: <filter>
Display: x11 server: X.Org 1.21.1.3 compositor: kwin_x11 driver:
loaded: intel unloaded: modesetting alternate: fbdev,vesa display-ID: :0
screens: 1
Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2")
s-diag: 582mm (22.9")
Monitor-1: eDP1 res: 1920x1080 hz: 60 dpi: 143
size: 340x190mm (13.4x7.5") diag: 389mm (15.3")
OpenGL: renderer: Mesa Intel Xe Graphics (TGL GT2) v: 4.6 Mesa 21.3.6
direct render: Yes
Audio:
Device-1: Intel Tiger Lake-LP Smart Sound Audio vendor: Hewlett-Packard
driver: sof-audio-pci-intel-tgl
alternate: snd_hda_intel,snd_sof_pci_intel_tgl bus-ID: 0000:00:1f.3
chip-ID: 8086:a0c8 class-ID: 0401
Sound Server-1: ALSA v: k5.16.9-zen1-1-zen running: yes
Sound Server-2: PulseAudio v: 15.0 running: no
Sound Server-3: PipeWire v: 0.3.46 running: yes
Network:
Device-1: Intel Wi-Fi 6 AX201 driver: iwlwifi v: kernel
bus-ID: 0000:00:14.3 chip-ID: 8086:a0f0 class-ID: 0280
IF: wlo1 state: up mac: <filter>
Bluetooth:
Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: USB
driver: btusb v: 0.8 bus-ID: 3-10:4 chip-ID: 8087:0aaa class-ID: e001
Report: bt-adapter ID: hci0 rfk-id: 0 state: up address: <filter>
RAID:
Hardware-1: Intel Volume Management Device NVMe RAID Controller driver: vmd
v: 0.6 port: N/A bus-ID: 0000:00:0e.0 chip-ID: 8086:9a0b rev:
class-ID: 0104
Drives:
Local Storage: total: 238.47 GiB used: 12.52 GiB (5.2%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung
model: MZVLQ256HAJD-000H1 size: 238.47 GiB block-size: physical: 512 B
logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
rev: HPS4NFXV temp: 33.9 C scheme: GPT
Partition:
ID-1: / raw-size: 48.83 GiB size: 48.83 GiB (100.00%)
used: 12.45 GiB (25.5%) fs: btrfs dev: /dev/nvme0n1p5 maj-min: 259:5
ID-2: /boot/efi raw-size: 260 MiB size: 256 MiB (98.46%)
used: 65.2 MiB (25.5%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
ID-3: /home raw-size: 48.83 GiB size: 48.83 GiB (100.00%)
used: 12.45 GiB (25.5%) fs: btrfs dev: /dev/nvme0n1p5 maj-min: 259:5
ID-4: /var/log raw-size: 48.83 GiB size: 48.83 GiB (100.00%)
used: 12.45 GiB (25.5%) fs: btrfs dev: /dev/nvme0n1p5 maj-min: 259:5
ID-5: /var/tmp raw-size: 48.83 GiB size: 48.83 GiB (100.00%)
used: 12.45 GiB (25.5%) fs: btrfs dev: /dev/nvme0n1p5 maj-min: 259:5
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: zram size: 15.38 GiB used: 0 KiB (0.0%) priority: 100
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 53.0 C mobo: 10.0 C
Fan Speeds (RPM): cpu: 0 fan-2: 0
Info:
Processes: 257 Uptime: 40m wakeups: 2212 Memory: 15.38 GiB
used: 3.24 GiB (21.1%) Init: systemd v: 250 tool: systemctl Compilers:
gcc: 11.2.0 clang: 13.0.1 Packages: pacman: 1409 lib: 327 Shell: fish
v: 3.3.1 default: Bash v: 5.1.16 running-in: konsole inxi: 3.3.12
Garuda (2.5.4-2):
System install date:     2022-02-16
Last full system update: 2022-02-18
Is partially upgraded:   No
Relevant software:       NetworkManager
Windows dual boot:       Probably (Run as root to verify)
Snapshots:               Snapper
Failed units:

Welcome :slight_smile:

Check in arch wiki if your notebook is listed and if there are drivers for your Convertible.

BTW, Garuda Linux dos'nt support dual boot.

1 Like

Thanks! :slight_smile:

Dual-booting isn't supported because windows likes to overwrite grub, right? Is it a possibility that I will lose data because of that, or is it just a I'll have to fix grub kind of thing?
There are no drivers in any of the pages of envy x360s. :frowning:
I did find the name of the sensor that is probably causing the wifi and bluetooth thing, but it doesn't show up in xinput.
I know a way I can setup the autorotate functionality myself, but I am going to need to find a fix for the wifi and bluetooth thing.
Do you think this is more of a general Arch Linux thing then Garuda thing? When I find a solution, should I post it in the Arch forums instead of these?

Have you installed this package?

https://archlinux.org/packages/?name=iio-sensor-proxy

Orientation Sensor

You currently need to install iio-sensor-proxy and reboot to make the orientation sensor work. This will disable the keyboard and touchpad, and invert the side volume buttons when the screen is held at the right orientation or is folded. The Gnome desktop environment does support the rotation natively. Other desktop enviroments may need extra software. You could compile and use this daemon [1] written in C.

This ^^^ is from the Archwiki:

https://wiki.archlinux.org/title/HP_Envy_X360_15-bq102ng

Not your exact model (but probably close enough).

2 Likes

I have not tried reloading the driver. I'm going to be honest, I have no idea how to do that.

I installed iio-sensor-proxy a bit ago. It was my understanding that I would need to write a script (like here: [Solved] - Mint 18.1 Cinnamon Touchscreen Rotation - Linux Mint Forums) to get that to work, so I was going to do that later (it was the solution i had in mind.) I have restarted my machine sense then, and it didn't fix it, which makes sense because I think just installing it only works for GNOME (I'm using KDE.) I've read every HP ENVY x360 page on arch, and they did give me some information that might turn out to be useful, like the name of the orientation sensor.

Thanks for the help!

Try this mega one liner:

su -c '/usr/bin/env bash -c echo "unloading network"; nmcli networking off; sleep 1; systemctl stop NetworkManager; sleep 2; echo "$(hwinfo --wlan | grep "Device File" | cut -d " " -f5)" > /tmp/device; $device="(cat /tmp/device)"; ip link set $device down; echo -e "\n--- unloading network ---\n"; sleep 3; lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs sudo rmmod; sleep 3; echo -e "\n--- restarting network ---\n"; sleep 3; modprobe -v iwlwifi; sleep 3; ip link set $device up; sleep 2; systemctl start NetworkManager; sleep 2; nmcli networking on; sleep 2; nmcli r wifi off; sleep 2; nmcli r wifi on; echo -e "\n--- process completed ---\n"'
2 Likes
λ su -c '/usr/bin/env bash -c echo "unloading network"; nmcli networking off; sleep 1; systemctl stop NetworkManager; sleep 2; echo "$(hwinfo --wlan | grep "Device File" | cut -d " " -f5)" > /tmp/device; $device="(cat /tmp/device)"; ip link set $device down; echo -e "\n--- unloading network ---\n"; sleep 3; lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs sudo rmmod; sleep 3; echo -e "\n--- restarting network ---\n"; sleep 3; modprobe -v iwlwifi swcrypto=1 11n_disable=8; sleep 3; ip link set $device up; sleep 2; systemctl start NetworkManager; sleep 2; nmcli networking on; sleep 2; nmcli r wifi off; sleep 2; nmcli r wifi on; echo -e "\n--- process completed ---\n"'


Password:

bash: line 1: =(cat /tmp/device): No such file or directory
Not enough information: "dev" argument is required.

--- unloading network ---


--- restarting network ---

insmod /lib/modules/5.16.10-zen1-1-zen/kernel/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko.zst swcrypto=1 11n_disable=8
Not enough information: "dev" argument is required.

--- process completed ---

I think the reload worked, because wifi disconnected and reconnected. But after, folding the laptop still caused it to disconnect :frowning:

Make sure your bios is up to date.

Test linux-mainline & other kernels.

Install linux-firmware-git, reboot.

Run rfkill list when wifi/bt not working, post output.

You can use this command to restart bluetooth when it's not working:

bash -c "nmcli networking off; sleep 1; bluetoothctl power off; sleep 1; sudo systemctl stop bluetooth; sleep 1; sudo rfkill block bluetooth; sleep 1; modprobe -r btusb; sleep 2; sudo rfkill unblock bluetooth; sleep 3; sudo modprobe btusb; sleep 2; sudo systemctl start bluetooth; sleep 2; bluetoothctl power on; sleep 1; nmcli networking on"
2 Likes

Yes, basically.

Never have seen or read of that happening--yet.

Yep. You break it, you fix it.

Here. Only. Never, ever post in the Arch forums unless you are running Arch that's installed "the Arch Way." They'll crucify you, and it gives Garuda a black bad (for the culturally sensitive) mark. And it belongs here, so that all here may benefit. Dig? You run Garuda Linux, not Arch. Isn't that awesome!!
:smiley:

Oh yeah, welcome to Garuda Linux, where the beer is free as long as you're buying!

4 Likes

Thanks! I was actually planning on not being crucified this weekend.

For future viewers of this thread with a similar problem, you can setup autorotation functionality yourself with iio-sensor-proxy and inotify-tools like done in this thread: [Solved] - Mint 18.1 Cinnamon Touchscreen Rotation - Linux Mint Forums
This script only rotates the touchscreen input, though. You'll need to add calls to xrandr for your display and extra calls to xinput for any other input devices you might want to rotate (like the stylus!) You also might want to make sure '11' is the correct device id xinput has for your touchscreen; it worked for me but based on the reading I've done it could be different for different people.

I'm still working on the wifi and bluetooth being disabled thing. If I find a solution, I will update this thread.

2 Likes

I did a fair bit of searching and I did not find one case online similar to yours, (which is very unusual). I really can't think of any further suggestions as this is a new one on me.

2 Likes

I've made some more discoveries.

So, I found the input device causing the issue. It's listed in xinput as Intel HID events. Everytime I turn the device around and trigger the accelerometer, it triggers an event5:

λ inotifywait /dev/input/event5 --monitor
Setting up watches.
Watches established.
/dev/input/event5 ACCESS
/dev/input/event5 ACCESS
/dev/input/event5 ACCESS

The wifi/bluetooth disables or enables with each event5, depending on its previous state.

As you can see, the input device associated with event5 is Intel HID events:

🧱] × xinput list-props 'Intel HID events'
Device 'Intel HID events':
Device Enabled (184):   1
Coordinate Transformation Matrix (186): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Send Events Modes Available (305):     1, 0
libinput Send Events Mode Enabled (306):        0, 0
libinput Send Events Mode Enabled Default (307):        0, 0
Device Node (308):      "/dev/input/event5"
Device Product ID (309):        0, 0

So, I should disable Intel HID events and see what happens, right? Well, I did- and event5 stopped happening. But - the wifi and bluetooth kept disabling, so the accelerometer must have still been working. And sure enough, iio-proxy-sensor was still picking it up:

λ monitor-sensor
Waiting for iio-sensor-proxy to appear
+++ iio-sensor-proxy appeared
=== Has accelerometer (orientation: normal)
=== No ambient light sensor
=== No proximity sensor
Accelerometer orientation changed: left-up
Accelerometer orientation changed: normal
Accelerometer orientation changed: right-up
Accelerometer orientation changed: normal

But event5 happened every single time the accelerometer orientation changed while Intel HID events was enabled. So it had to be connected somehow. Eventually I found something online, I honestly forget what and where, that sent me on a wild goose chase through dolphin going through a bunch of folders related to event5 and input5. While I was trying to make sense of what I was seeing, I realized that the wifi and bluetooth were disabling and enabling as I navigated through the files. After some mucking around I narrowed it down to one directory: /sys/devices/platform/INTC1051:00/driver. Like clockwork, each time I entered it, both the wifi and the bluetooth would activate or deactivate.

INTC1051:00 seems to be a combined driver for a few of my laptop's input devices. Its subfolder input has three subfolders: input5, input6, and input7. Inside input5 there's a text file entitled name with the value Intel HID events. input6's name has Intel HID 5 button array, which is also listed in xinput. However, input7's name has Intel HID Switches, which is not listed in xinput. While Intel HID events has event5 in its properties, and Intel HID 5 button array has event6, event7 is not in the properties of any input device.

I don't know to what extent this is useful, but inside every input folder there's a file called uevent. event5 and event6 have KEY and MSC fields in their uevent while event7 instead has an SW field.

I have no idea if this could be related but xinput lists two power buttons and as far as I can tell, one of them does absolutely nothing. Maybe it's mistaking Intel HID Switches for a power button?

I can't move the INTC1051:00 folder around to see what happens if it's not there; I don't have permission even as the root user. Something tells me this is because that would be a bad idea, but I stopped using Windows because I'm tired of being protected from myself on my own computer! I wanna move the folder, gosh darn it! :angry:

So this is all way out of my realm of understanding. I think the accelerometer accesses that driver folder, which disables/enables the bluetooth and wifi. Why on god's green earth would just viewing the contents of a folder cause wifi and bluetooth to switch on or off? Why can't I actually disable Intel HID Events or Intel HID 5 button array? Hopefully y'all smart people look at this information and it makes sense to you, because a few days ago I didn't know what a shell script was, so it's safe to say I'm in a biiiiit over my head here. Nevertheless, if you can't help me, I shall continue trudging on in my infinite stubbornness. Garuda is the coolest, best-looking, most fun OS I've ever used and I really want it to work on my laptop.

1 Like

Look for a udev rule controlling the actions.

If your model isn't exactly the HP ENVY x360 Convertible 15-ed1000, please disregard this message
I was poking around the HP support sites, and the only thing that came up with a search starting with
"HP ENVY x360 Convertible 15-ed1" on their site was the 15-ed1000. Now what is odd, if that IS your model, the last BIOS version is F.20 Rev.A from Aug 20, 2021 and somehow you have newer.
I am hoping somehow the support site is just giving me issues looking for other models in ed1XXX. On that point I am not sure how good their bios detection is for similar model's BIOS to prevent issues while installing them.

I am unsure if:

  1. HP retracted a recent bad BIOS update
  2. Somehow a slightly different BIOS got offered to you
  3. I am wrong about your exact model as its partially redacted
1 Like

I noticed that before, but I didn't consider that they might have retracted an update. I just assumed they're bad at managing their site. Funny thing is, despite my shell saying my laptop is 15-ed1xxx, on the bottom of my computer the model is printed with a 't': 15t-ed100. If I enter in the product id, it brings me to ' HP ENVY x360 Convertible Laptop PC 15-ed1000 IDS Base Model', whatever that means. But that page has the exact same BIOS, F.20 Rev. A from August. Do you recommend I revert?

Considering you double checked and that should be the latest version, I would see into reverting. Triple check first to make sure its not just a minor release for a specific region you are in.
After searching your model laptop (and Arch), I saw a blog that urged users of this laptop to make sure the BIOS is in its latest working one.

3 Likes

Could it be a BIOS thing if the issue is not present in Windows? The wifi and bluetooth function perfectly fine on it, regardless of any orientation changes.

After a few days of confusion about how to run a BIOS update (the people in the tutorials tell me to run files that aren't there, the complete lack of an option in my bios to update from usb or otherwise) I want to be sure it's worth risking messing it up.

I think it's a driver issue, because whatever mechanism disables the keyboard disables the wifi and bluetooth as well (but only on Linux.) And, the fact that reading any of the files related to the Sesnor Hub driver also prompts the issue.

Well, if you think that still, I am unsure if you read about tbg's previous post that recommends to test other kernels and the git version of the firmware? Did you try anything he listed here?

Sounds like a kernel, firmware, and/or bios issue. Not going to get anywhere by not eliminating some of the possibilities.

2 Likes

Oops, my bad. I didn't see that . . . I don't know how I didn't see that. I'll definitely try that stuff.