Thinkpad x1 yoga g3 - screen brightness and Fn keys

I have just installed 13.1-RELEASE on a thinkpad x1 yoga g3 - I have setup X (i dont have it starting automatically), power saving (using intel speed shift), suspend on closing the lid, resume works reliably too. So far so good.

FreeBSD has come a LONG way for use on Laptops since the last time I installed and used it (1998-2001), Ive been stuck with Windows and MS Word due to work for the last 18 years, even so it was fairly strait-forward getting to this point.

I am having difficulty getting screen brightness working, so far i have tried using acpi_ibm and acpi_video. I tried having both activated, pressing f5 (labeled brightness down) either increased the brightness or put the screen backlight on, the same thing happens if I boot while connected to power, if I disconnect the screen gets much brighter (not sure if the machine actually has a backlight) reconnecting dosent change anything. I think acpi_ibm and acpi_video both do the same job so commented out acpi_video.

Going back to just acpi_ibm (confirmed to be running with kldstat) I ran the below to get the input of the F keys when pressed (I added the comments myself):

Code:
cat /var/run/devd.pipe
!system=ACPI subsystem=IBM type=\_SB_.PCI0.LPCB.EC__.HKEY notify=0x11 //f5 - Lowers screen brightness
!system=ACPI subsystem=IBM type=\_SB_.PCI0.LPCB.EC__.HKEY notify=0x10 //f6 - Increase screen brightness
!system=ACPI subsystem=IBM type=\_SB_.PCI0.LPCB.EC__.HKEY notify=0x07 //f7 - Access options to manage the external display - prob windows specific
!system=ACPI subsystem=IBM type=\_SB_.PCI0.LPCB.EC__.HKEY notify=0x05 //f8 - Airplane Mode on/off
!system=ACPI subsystem=IBM type=\_SB_.PCI0.LPCB.EC__.HKEY notify=0x1d //f9 - Access computer settings - windows specific
!system=ACPI subsystem=IBM type=\_SB_.PCI0.LPCB.EC__.HKEY notify=0x14 //f10 - Bluetooth on/off - i have this disabled in bios
!system=ACPI subsystem=IBM type=\_SB_.PCI0.LPCB.EC__.HKEY notify=0x05 //f15 - Keyboard settings - windows specific?
!system=ACPI subsystem=IBM type=\_SB_.PCI0.LPCB.EC__.HKEY notify=0x11 //f12 - User defined  Function


I get no input when pressing F1-4, according to lenovo docs they should be:

F1: Mutes and unmutes audio
F2: Lowers speaker volume
F3: Increase speaker volume
F4: Mutes and unmutes the microphone

Also, I have had an intermittent problem with the arrow keys, more often than not they don't work and result in a beep, so when using /dev.pipe as above I tested those; up and left did not get a response, while down got ^[[B and right got ^[[C
I have had another thing happening that sometimes interrupts the boot menu, and continues through the boot process - ^[[D repeatedly appears (also on resume after being suspended), i thought maybe it was Esc or something but suspect its left or up, any ideas what to do here?

Back to the Fn brightness keys, I wanted to find what to map to the Fn keys to, after a bit of looking around I found and ran:

Code:
sysctl -a | grep bright
hw.i915kms.invert_brightness: 0
dev.acpi_ibm.0.lcd_brightness: 0
compat.linuxkpi.915_invert_brightness: 0

Using sysctl, changing the value of hw.i915kms.invert_brightness, compat.linux.i915_invert_brightness or dev.acpi_ibm.0.lcd_brightness isn't allowed (run as normal user), it says its a read only tunable and tunable values are set in /boot/loader.conf

However, changing the value of dev.acpi_ibm.0.lcd_brightness as root is allowed but does not change brightness, although I get a message that the value should be bttween 0-5 - setting to say 2 does not change brightness.

How can I figure out how to control the brightness? Once I have done that I would like to map the controls to the f5/6 keys (maybe vol+/-to f7/8 also), any advice on that would also be appreciated.

Many thanks!
 
I should prob include some config files, I think these would be relevant:

/boot/loader.conf:

Code:
#enable LCD backlight control, ThinkPad buttons, etc
#acpi_video_load="YES"
acpi_ibm_load="YES"
#Change powersaving to use core individually - my attempt...
machdep.hwpstate_pkg_ctrl=0

/etc/rc.conf:

Code:
clear_tmp_enable="YES"
sendmail_enable="NONE"
hostname="<HOSTNAME HERE>"
keymap="uk.kbd"
wlans_iwm0="wlan0"
ifconfig_wlan0="WPA DHCP"
ifconfig_wlan0_ipv6="inet6 accept_rtadv"
create_args_wlan0="country GB regdomain ETSI"
# dont hang the boot process while waiting on DHCP
background_dhclient="YES"
sshd_enable="YES"
kld_list="/boot/modules/i915kms.ko"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
dbus_enable="YES"

/etc/sysctl.conf:

Code:
# Config Intel Speed Shift for laptop - increase default 'balance' 50 to 100
#when not connected to AC lower performance...
dev.hwpstate_intel.0.epp=100
dev.hwpstate_intel.1.epp=100
dev.hwpstate_intel.2.epp=100
dev.hwpstate_intel.3.epp=100
dev.hwpstate_intel.4.epp=100
dev.hwpstate_intel.5.epp=100
dev.hwpstate_intel.6.epp=100
dev.hwpstate_intel.7.epp=100

#config close lid, laptop goes to sleep
hw.acpi.lid_switch_state=S3

If there is anything else that would be useful please let me know.
 
[lots of info for this model]

How can I figure out how to control the brightness? Once I have done that I would like to map the controls to the f5/6 keys (maybe vol+/-to f7/8 also), any advice on that would also be appreciated.

Maybe this will work for you?

 
I have an Ideapad 720S-13ARR, with a Ryzen 5 2500U, and 8 GB of RAM. Generally, a pretty capable machine where FreeBSD is very usable. But - I've got an issue that is clearly FreeBSD-related, and it's gotten me frustrated to the point that keyboard backlight is the least of my worries. Namely - www/firefox is consuming inordinate amounts of RAM. Some research indicates that it's a symptom of a memory leak by Firefox. That is a pretty big showstopper for me.
 
I have an Ideapad 720S-13ARR, with a Ryzen 5 2500U, and 8 GB of RAM. Generally, a pretty capable machine where FreeBSD is very usable. But - I've got an issue that is clearly FreeBSD-related, and it's gotten me frustrated to the point that keyboard backlight is the least of my worries. Namely - www/firefox is consuming inordinate amounts of RAM. Some research indicates that it's a symptom of a memory leak by Firefox. That is a pretty big showstopper for me.
What version of www/firefox are you using from the ports tree. Yes, I assume there is only 1 version present, but that might change in the future when ports is updated. So for the record which version of Firefox is the memory leak happening to you? 102 111,0,1 or 111.0.2 ?

I hope your detailed efforts help us all get better results from brightness keys working on Lenovo products and thereby help us with other Laptop Hardware using defined keys.
 
Maybe this will work for you?


Thanks! The info at the start was very helpful - enabling acpi_video actually did allow the fn keys brightness to work but in such fine steps that i hadn't noticed!

I had a quick go at the script and config file but they didnt work for me, Ill have a closer look later. So far setting a value through /etc/sysctl.conf for on/off powers works (most of the time, sometimes i have to press a fnkey and it refreshes to the correct state)

Code:
#config, ibm special keys - brightness vol etc
#dev.acpi_ibm.0.handlerevents=0x10
#dev.acpi_ibm.0.handlerevents=0x11
hw.acpi.video.lcd0.economy=30
hw.acpi.video.lcd0.fullpower=90

im still struggling to get the arrow keys working, right now only down and right are working although when editing the config files in the console as root they all worked.

and then this issue:
 

Attachments

  • bootprocess.jpg
    bootprocess.jpg
    1 MB · Views: 99
What version of www/firefox are you using from the ports tree. Yes, I assume there is only 1 version present, but that might change in the future when ports is updated. So for the record which version of Firefox is the memory leak happening to you? 102 111,0,1 or 111.0.2 ?

I hope your detailed efforts help us all get better results from brightness keys working on Lenovo products and thereby help us with other Laptop Hardware using defined keys.
109.0 is what I'm using... TBH, I have no intention to upgrade until I see info that memory leak issues have been addressed somehow.

I normally compile stuff from ports, because I like to set my own options, but on this laptop, I had to make an exception (Compilation kept failing), and install from pkg. If memory leaks were not such a showstopper, then yeah, brightness keys might get some attention from me as a 'nice to have' feature. I'm probably hijacking the thread, but with this showstopper - it's so big, it overshadows everything else. I do want to be able to use FF for research on how to solve FreeBSD-related technical issues...
 
I have an Ideapad 720S-13ARR, with a Ryzen 5 2500U, and 8 GB of RAM. Generally, a pretty capable machine where FreeBSD is very usable. But - I've got an issue that is clearly FreeBSD-related, and it's gotten me frustrated to the point that keyboard backlight is the least of my worries. Namely - www/firefox is consuming inordinate amounts of RAM. Some research indicates that it's a symptom of a memory leak by Firefox. That is a pretty big showstopper for me.
FireFox is working well for me (v111), although i didnt install from ports.

There used be to a large number of browsers for FreeBSD and Linux - but there dont seem to be anymore. Over the last few years ive been using Lynx and its surprisingly usable...
 
FireFox is working well for me (v111), although i didnt install from ports.

There used be to a large number of browsers for FreeBSD and Linux - but there dont seem to be anymore. Over the last few years ive been using Lynx and its surprisingly usable...
Well, I do need Discord, ESPN, Skype, tenor.com, Forums, bugzilla instances from many projects, google, and to have lots of tabs open.

But, in Firefox on FreeBSD, Discord tab, by itself, grabs over a GB of RAM on top of 1.6 GB of RAM needed for just base Firefox.

For me, Lynx is usable in a pinch as a headless, text-mode browser, but there's only so much you can display with just text that is all the same size and color.

If FF 111 or 112 are easier to handle with respect to memory leaks, then I'd upgrade to that in a heartbeat.
 
and then this issue:
It turns out this was due to some fault with the hardware, i replaced the keyboard (thinkpads are not as servicable as they used to be!) and this issue has gone.

thanks everyone for the help!
 
(thinkpads are not as servicable as they used to be!)
Yeah, depends on the model, most of Carbon X range have the keyboard built as part of the palmrest (or C-Cover) to reduce the chances of dust or liquid getting in so it's pretty much a full factory stripdown and rebuild just to replace the keyboard since the C-Cover is the main chassis of the device. Most of the rest of the business-grade range, L, T, P series , the keyboard is a 5 minute swap out :)
Just look at where in the FRU replacement chapter the part you want to replace is in the list. Generally, the further down the list, so more other parts will need to be removed to get it out. With your X1 Yoga, it's pretty much the last item in the list, followed only by dismantling the screen assembly :)
 
Back
Top