mikeeq / mbp-fedora-kernel

65 stars 12 forks source link

Can't turn on F-keys on touchbar on MBP 15,4 #12

Closed atodorov closed 2 years ago

atodorov commented 4 years ago
# uname -r
5.6.13-300.mbp.fc32.x86_64
[root@localhost atodorov]# cat /etc/modprobe.d/hid_apple.conf 
options hid_apple fnmode=2
[root@localhost atodorov]# cat /sys/module/hid_apple/parameters/fnmode 
1

I don't seem to be able to make the touchbar display function keys by default and only show media keys if the Fn key is pressed down.

For some reason the file in /etc/modprobe.d/ doesn't have any effect.

I can change this parameter to 2 after being logged in:

# echo 2 > /sys/module/hid_apple/parameters/fnmode 
[root@localhost atodorov]# cat /sys/module/hid_apple/parameters/fnmode 
2

but that doesn't seem to have any effect. Any ideas ?

Full HW info at: https://github.com/Dunedan/mbp-2016-linux/tree/master/MacBookPro15%2C4

mikeeq commented 4 years ago

You are trying to change the parameter in a wrong module - hid_apple instead of apple_ib_tb.

➜ modinfo apple_ib_tb
filename:       /lib/modules/5.6.13-300.mbp.fc32.x86_64/extra/apple-ib-tb.ko
license:        GPL v2
description:    MacBookPro Touch Bar driver
author:         Ronald Tschalär
alias:          hid:b0003g*v000005ACp00008302
alias:          hid:b0003g*v000005ACp00008102
alias:          hid:b0003g*v00001D6Bp00000301
depends:        apple-ibridge
retpoline:      Y
name:           apple_ib_tb
vermagic:       5.6.13-300.mbp.fc32.x86_64 SMP mod_unload 
parm:           idle_timeout:Default touch bar idle timeout:
    >0 - turn touch bar display off after no keyboard, trackpad, or touch bar input has been received for this many seconds;
         the display will be turned back on as soon as new input is received
     0 - turn touch bar display off (input does not turn it on again)
    -1 - turn touch bar display on (does not turn off automatically)
    -2 - disable touch bar completely (int)
parm:           dim_timeout:Default touch bar dim timeout:
    >0 - dim touch bar display after no keyboard, trackpad, or touch bar input has been received for this many seconds
         the display will be returned to full brightness as soon as new input is received
     0 - dim touch bar display (input does not return it to full brightness)
    -1 - disable timeout (touch bar never dimmed)
    [-2] - calculate timeout based on idle-timeout (int)
parm:           fnmode:Default Fn key mode:
    0 - function-keys only
    [1] - fn key switches from special to function-keys
    2 - inverse of 1
    3 - special keys only
    4 - escape key only (int)
echo 2 > /sys/class/input/*/device/fnmode
atodorov commented 4 years ago

I got confused by the existing README, sent PR. However I can't verify the fix.

After turning off the computer last night and turning it on again today the touchbar only displays the media buttons and pressing Fn key doesn't change them to F1, F2, etc.

I made sure I don't have any of my hid_apple changes under /etc/modprobe.d but the touchbar appears to start like this from early boot. Previously I've played around with it pressing Fn during early boot and I was able to see the F-x buttons.

mikeeq commented 4 years ago

Try to boot MacOS or Windows and then come back to Linux - touchbar likes to freeze sometimes.

atodorov commented 4 years ago

Try to boot MacOS or Windows and then come back to Linux - touchbar likes to freeze sometimes.

I nuked MacOS so that isn't really an option. This freeze sounds like a legitimate bug which needs to be investigated and fixed. I will check my logs again but I didn't see anything obvious when I posted the previous comment.

berrfred commented 4 years ago

I have the same problem on 5.6.13 while it is working fine on v5.6.7 and previous kernels. It seems to be only a visual effect not showing the function keys but if you press on the touchbar it does call the underlying function key ( see https://github.com/roadrunner2/macbook12-spi-driver/issues/46 ).

mikeeq commented 2 years ago

Should be fixed now!

allco commented 1 year ago

You are trying to change the parameter in a wrong module - hid_apple instead of apple_ib_tb

On my MBP 2019 it is:

modinfo apple_touchbar

Also lsusb helped to identify which input device to use in /sys/class/input/*/device/fnmode (in my case it was /sys/class/input/input9/device/fnmode)