CF-31 Linux

Discussion in 'Panasonic' started by kode-niner, Jan 11, 2019.

  1. kode-niner

    kode-niner Notebook Consultant

    Reputations:
    22
    Messages:
    234
    Likes Received:
    76
    Trophy Points:
    41
    I now have a CF-31 Mk2 and Mk4. As usual I am installing Linux and that means plenty of fiddling. Luckily I actually enjoy this as opposed to some of us *cough*SHAWN*cough* so I usually get by and tweak my systems to my liking. I am concentrating on the Mk4 CF-31W with Debian 9.6. I added a Sierra MC7700, GPS and optical drive. (Thanks Shawn)

    Naturally not all things work properly. Hopefully this thread will eventually contain enough information to help out others.

    Using Debian 9.6 LXDE with Openbox and customized Slim login manager, kernel 4.9.0-8-amd64

    What didn't work:
    • WIFI missing firmware package
    • Sound channel mixer volume for headset mistakenly controls internal speaker
    • LCD brightness Fn keys
    • Cannot calibrate touch screen
    Wifi missing package is easy to fix. I had https://packages.debian.org/stretch/all/firmware-iwlwifi/download on a USB drive when prompted by the installation package. Otherwise if installed without it, just download firmware-iwlwifi (or your distro's equivalent) from the non-free repository with a wired ethernet connection.

    Sound channel is an ALSA SNAFU which I remember having fixed once. I don't remember now.

    LCD brightness is annoying. Various ACPI kernel parameters didn't work and the CF-31 doesn't directly support hardware backlight dimming with xbacklight as far as I can tell, so I wrote up a quick script that uses xrandr --brightness

    EDIT: Script in later post supersedes this

    Code:
    #!/bin/bash
    #Change device to match your hardware - figure this out with "xrandr | grep connected"
    device=LVDS-1
    #Limit xrandr range. 1.0 is maximum brightness  but you can go beyond these limits
    #Strange things can happen if you go below 0.0 and way above 1.0
    upper=1.0
    lower=0.0
    #Steps for each up and down command. Increase for larger steps.
    increment=0.1
    decrement=0.1
    #Get the current brightness value
    current=`xrandr --verbose | grep -i brightness | awk '{ print $2 }'`
    #Define values for adding and subtracting from the current value
    subinc=`bc <<< $current-$decrement`
    addinc=`bc <<< $current+$increment`
    #define up and down arguments
    case $1 in
       up)
          if (( $(echo "$addinc <= $upper" | bc -l) )) ; then
               xrandr --output $device --brightness $addinc
          fi
       ;;
       down)
          if (( $(echo "$subinc >= $lower" | bc -l) )) ; then
               xrandr --output $device --brightness $subinc
          fi
       ;;
       *)
       ;;
    esac
    
    #echo $current
    
    Shoved the above in a file named it brightness and chmodded it executable. Then typing brightness up or brightness down does the trick. After that it's just a question of using the desktop manager's hotkey configs to assign the up and down commands to the XF86MonBrightnessDown/XF86MonBrightnessUp keys. This script should work for almost any computer.


    For the touch screen, I didn't get far yet. xinput_calibrator recognizes the Fujitsu panel but does little else. Xorg doesn't seem to be able to control it by using the "Fujitsu Component USB Touch Panel" name although that is what the kernel is reporting the device as. This one I'm still trying to figure out.

    Plenty of other things to do and try out. Questions? Need clarifications? Got other bugs for other MK? Solutions? This is the thread. I think.
     
    Last edited: Jan 15, 2019
  2. Shawn

    Shawn Crackpot Search Ninja and Options Whore

    Reputations:
    1,490
    Messages:
    7,730
    Likes Received:
    1,520
    Trophy Points:
    331
    Harumpf! Software still frustrates me. I am a hardware guy. Going to attempt a repair on my Nikon D610 this weekend. 40-50 screws much smaller than the ones that hold a wifi card in.

    You should have witnessed the Linux circus of Jeff and I. We tried about 20 distros on a CF U1.

    Currently I am trying Elementary OS on a FZ G1 mk3.
     
  3. kode-niner

    kode-niner Notebook Consultant

    Reputations:
    22
    Messages:
    234
    Likes Received:
    76
    Trophy Points:
    41
    Linux circus? You guys have all the fun.

    I installed your GPS in the Mk4 earlier today. Easy peasy.

    Speaking of which, today I found Gnome Maps which is a neat little GPS map and navigation application for Linux. It uses Openstreetmap under the hood. It was downloadable from the Debian repos.
     
  4. Shawn

    Shawn Crackpot Search Ninja and Options Whore

    Reputations:
    1,490
    Messages:
    7,730
    Likes Received:
    1,520
    Trophy Points:
    331
  5. kode-niner

    kode-niner Notebook Consultant

    Reputations:
    22
    Messages:
    234
    Likes Received:
    76
    Trophy Points:
    41
    Still tinkering. Apparently xrandr --brightness and my script only changes the monitor gamma values and doesn't really dim the backlight. So no help in power savings.
     
  6. theoak2

    theoak2 Notebook Evangelist

    Reputations:
    102
    Messages:
    404
    Likes Received:
    69
    Trophy Points:
    41
    Concerning touchscreen calibration, I found this webpage with useful advice:
    https://cubiclenate.com/2018/04/

    Relevant lines being:

    Using this info, my calibration script (Touchscreen.sh) contains the following:

    Code:
    #!/bin/sh
    # Coordinate touch panel to screen
    xinput set-prop "Fujitsu Component USB Touch Panel" "Coordinate Transformation Matrix" 1.075, 0, -.03, 0, 1.1, -0.07, 0, 0, 1
    Calibration utility can be used to fine-tune.
     
    kode-niner likes this.
  7. kode-niner

    kode-niner Notebook Consultant

    Reputations:
    22
    Messages:
    234
    Likes Received:
    76
    Trophy Points:
    41
    Thanks, seems to work. Too bad it has to go into a startup script instead of an xorg conf file, but it's progress!
     
  8. kode-niner

    kode-niner Notebook Consultant

    Reputations:
    22
    Messages:
    234
    Likes Received:
    76
    Trophy Points:
    41
    Dug up this old post here that has sort of a solution for the sound mixer problem
    http://forum.notebookreview.com/threads/linux-ubuntu-touch-pad-sound-fix-cf-31-mk2.813539/
    Kudos for ToughbreaK for having posted it. However he did not describe what the problem was in the first place.
    After applying the fix from that post, it still uses what is identified as Headphones in alsa-mixer for volume control but things line up properly in Pulseaudio. The speaker volume slider in alsa-mixer appears to do nothing at all. The speaker is not auto-muted as if it were headphones so it essentially fixes my problem. Otherwise I had to go in alsa-mixer, unmute and crank up the headphone volume to get sound through the speaker.

    As for the touchpad, the only thing I have with mine is that it is detected as ImPS/2 Generic Wheel Mouse and I have little control in Xorg to modifying buttons, tapping and scrolling behaviour, very much like the Fujitsu touchscreen. Otherwise it works flawlessly and doesn't throw up any errors. The i8042.notimeout i8042.nomux kernel parameters don't seem necessary in my case.
     
    Last edited: Jan 13, 2019
  9. kode-niner

    kode-niner Notebook Consultant

    Reputations:
    22
    Messages:
    234
    Likes Received:
    76
    Trophy Points:
    41
    Found a program that actually controls the backlight. Downloaded it from repos and it runs like this example for 50% brightness (values go from 0 to 1414)
    Code:
    brightnessctl -d intel_backlight s 707
    Only problem is that it needs root permissions to access the device so commands may need to be preceded by sudo.
    Code:
    sudo brightnessctl -d intel_backlight s 707
    /usr/bin/brightnessctl could be added to /etc/sudoers as a workaround, but I don't like it. I guess I could also change permissions on the device file.

    If anyone is interested, here is an adaptation of my script with this program. If anybody needs specifics on how to get it to work, let me know. I am assuming, perhaps wrongly, a minimum of Linux knowledge to those who are following this thread so I apologize in advance if this isn't clear so just ask for help. Debian-like distros may need to
    Code:
    sudo apt-get brightnessctl
    The script below copied into a file and made executable (chmod +x yournewfile)
    Code:
    #!/bin/bash
    #Change device to match your hardware - figure this out with "brightnessctl -l"
    device=intel_backlight
    #No real need to change anything below this
    #min/max values
    upper=1414
    lower=0
    #Steps for each up and down command.
    increment=10
    decrement=10
    #Get the current brightness value
    current=`brightnessctl -d $device g`
    #Define values for adding and subtracting from the current value
    subinc=$(($current - $decrement))
    addinc=$(($current + $increment))
    #define arguments for up and down
    case $1 in
       up)
           if (( $(echo "$addinc <= $upper") )) ; then
               brightnessctl -q -d $device s $addinc
           fi
       ;;
       down)
           if (( $(echo "$subinc >= $lower") )) ; then
               brightnessctl -q -d $device s $subinc
           fi
       ;;
       *)
           brightnessctl -d $device
           echo "Use \"up\" or \"down\" as arguments"
       ;;
    esac
    Properly dimming the backlight instead of mucking around with xrandr and its silly gamma tweaking makes a huge difference on battery usage. I am thinking that all I need is some ACPI-related package or suite of scripts to do what I need instead of scripting from scratch. I just haven't found it yet. But this is fun.
     
    Last edited: Jan 14, 2019
    UNCNDL1 and Shawn like this.
  10. kode-niner

    kode-niner Notebook Consultant

    Reputations:
    22
    Messages:
    234
    Likes Received:
    76
    Trophy Points:
    41
    One other thing of note: I had to disable WICD as a network management utility which is now the new default for my distro. I don't particularly like Network Manager, which was the previous default in Debian 8, but in this case it supports WWAN connections while WICD does not. And I had dozens of saved Network Manager system-connections files from my CF-30 and CF-19 that I needed to copy over in order to keep my connection preferences/passwords for all the LANs/WLANs I use.

    I wouldn't mind knowing what other CF-31 Linux users do to address this issue, what is your preferred network management software and so forth. I would have kept WICD had it been able to talk to the WWAN card. I've used it before and it works really well.
     
Loading...

Share This Page