t2linux / T2-Debian-and-Ubuntu-Kernel

Ubuntu Kernel for T2 Macs.
130 stars 14 forks source link

options hid_apple fnmode=2 does not work #37

Closed jaroslavtyc closed 1 year ago

jaroslavtyc commented 1 year ago

I have installed Linux Mint 21.1 to MacBook Pro 2021 Intel, used https://wiki.t2linux.org/distributions/debian/installation/#adding-t2-support to use latest LTS T2 kernel, followed audio and wifi steps to make it working. Everything good so far.

Then I have used echo 2 >> /sys/module/hid_apple/parameters/fnmode following https://wiki.archlinux.org/title/Apple_Keyboard to get F? keys always on, but no success.

Also tried https://github.com/free5lot/hid-apple-patched, but that disabled touch pad and keyboard completely.

Every other hid_apple options works, just the F? keys lock does not.

options hid_apple fnmode=2
options hid_apple swap_fn_leftctrl=1
options hid_apple swap_opt_cmd=1
options hid_apple rightalt_as_rightctrl=1

I suppose it is something with used hid_apple module, which knows fnmode parameter, but do not use it

/sbin/modinfo hid_apple
filename:       /lib/modules/6.1.23-t2-jammy/kernel/drivers/hid/hid-apple.ko
parm:           fnmode:Mode of fn key on Apple keyboards (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst, [3] = auto) (uint)
parm:           iso_layout:Swap the backtick/tilde and greater-than/less-than keys. ([-1] = auto, 0 = disabled, 1 = enabled) (int)
parm:           swap_opt_cmd:Swap the Option ("Alt") and Command ("Flag") keys. (For people who want to keep Windows PC keyboard muscle memory. [0] = as-is, Mac layout. 1 = swapped, Windows layout.) (uint)
parm:           swap_fn_leftctrl:Swap the Fn and left Control keys. (For people who want to keep PC keyboard muscle memory. [0] = as-is, Mac layout, 1 = swapped, PC layout) (uint)

My hid_apple configuration

cat /etc/modprobe.d/hid_apple.conf
options hid_apple fnmode=2
options hid_apple swap_fn_leftctrl=1
options hid_apple swap_opt_cmd=1
options hid_apple rightalt_as_rightctrl=1
options hid_apple ejectcd_as_delete=1

Initframs were rebuilt update-initramfs -u and system rebooted.

My system details

lsb_release -a
No LSB modules are available.
Distributor ID: Linuxmint
Description:    Linux Mint 21.1
Release:    21.1
Codename:   vera
root@jaroslav-MacBookPro:/home/jaroslav# inxi -Fxz
System:
  Kernel: 6.1.23-t2-jammy x86_64 bits: 64 compiler: gcc v: 11.3.0
    Desktop: Cinnamon 5.6.8 Distro: Linux Mint 21.1 Vera
    base: Ubuntu 22.04 jammy
Machine:
  Type: Laptop System: Apple product: MacBookPro16,1 v: 1.0 serial: <filter>
  Mobo: Apple model: Mac-E1008331FDC96864 v: MacBookPro16,1
    serial: <filter> UEFI: Apple v: 1916.60.2.0.0 (iBridge: 20.16.2059.0.0,0)
    date: 11/30/2022
Battery:
  ID-1: BAT0 charge: 84.0 Wh (99.9%) condition: 84.1/100.2 Wh (83.9%)
    volts: 12.5 min: 11.4 model: SMP bq40z651 status: Full
CPU:
  Info: 6-core model: Intel Core i7-9750H bits: 64 type: MT MCP
    arch: Coffee Lake rev: A cache: L1: 384 KiB L2: 1.5 MiB L3: 12 MiB
  Speed (MHz): avg: 2507 high: 2600 min/max: 800/4500 cores: 1: 2600
    2: 2600 3: 2600 4: 1489 5: 2600 6: 2600 7: 2600 8: 2600 9: 2600 10: 2600
    11: 2600 12: 2600 bogomips: 62399
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: AMD Navi 14 [Radeon RX 5500/5500M / Pro 5500M] vendor: Apple
    driver: amdgpu v: kernel bus-ID: 03:00.0
  Device-2: Apple FaceTime HD Camera (Built-in) type: USB driver: uvcvideo
    bus-ID: 7-2:3
  Display: server: X.Org v: 1.21.1.3 driver: X: loaded: amdgpu,ati
    unloaded: fbdev,modesetting,radeon,vesa gpu: amdgpu
    resolution: 3072x1920~60Hz
  OpenGL: renderer: NAVI14 (navi14 LLVM 15.0.6 DRM 3.49 6.1.23-t2-jammy)
    v: 4.6 Mesa 22.2.5 direct render: Yes
Audio:
  Device-1: AMD Navi 10 HDMI Audio driver: snd_hda_intel v: kernel
    bus-ID: 03:00.1
  Device-2: Apple Audio driver: aaudio bus-ID: 04:00.3
  Sound Server-1: ALSA v: k6.1.23-t2-jammy running: yes
  Sound Server-2: PulseAudio v: 15.99.1 running: no
  Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Broadcom BCM4364 802.11ac Wireless Network Adapter vendor: Apple
    driver: brcmfmac v: kernel bus-ID: 05:00.0
  IF: wlp5s0 state: up mac: <filter>
  IF-ID-1: enxacde48001122 state: down mac: <filter>
Drives:
  Local Storage: total: 465.92 GiB used: 56.42 GiB (12.1%)
  ID-1: /dev/nvme0n1 vendor: Apple model: SSD AP0512N size: 465.92 GiB
    temp: 39.9 C
Partition:
  ID-1: / size: 273.92 GiB used: 28.2 GiB (10.3%) fs: ext4
    dev: /dev/nvme0n1p3
  ID-2: /boot/efi size: 299.3 MiB used: 24.4 MiB (8.2%) fs: vfat
    dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: file size: 2 GiB used: 0 KiB (0.0%) file: /swapfile
Sensors:
  System Temperatures: cpu: 64.0 C pch: 60.0 C mobo: N/A gpu: amdgpu
    temp: 71.0 C
  Fan Speeds (RPM): cpu: 3289 fan-2: 3039 gpu: amdgpu fan: 0
Info:
  Processes: 309 Uptime: 11m Memory: 15.51 GiB used: 2.13 GiB (13.7%)
  Init: systemd runlevel: 5 Compilers: gcc: 11.3.0 Packages: 2355 Shell: Bash
  v: 5.1.16 inxi: 3.3.13

I do not think that it is hid_apple module issue as I do not find any clue on internet about such fnmode problem.

Thank you.

Redecorating commented 1 year ago

your macbook has a touchbar for the fn keys right? in this case the apple-touchbar module is the one you'll need to use. you can also have a look at this section too https://wiki.t2linux.org/guides/postinstall/#setting-up-the-touch-bar

jaroslavtyc commented 1 year ago

Thank you kind sir, that is it :clap: