Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 35

Thread: Script only does anything when launched in Terminal

  1. #21
    Join Date
    Nov 2008
    Beans
    9,635
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Script only does anything when launched in Terminal

    Sure. We need to do some more diagnostics.

    Assuming you are seeing hp-wmi in the lsmod output go ahead and run this command in a terminal with screen in laptop:
    Code:
    cat /sys/devices/platform/hp-wmi/tablet
    and then again when the screen is rotated to tablet:
    Code:
    cat /sys/devices/platform/hp-wmi/tablet
    Then run again when back in laptop. The outputs should be something like 0,1,0, post them.

  2. #22
    Join Date
    Dec 2008
    Beans
    256

    Re: Script only does anything when launched in Terminal

    Yay, my tablet mode sensor isn't broken!

    Code:
    $ cat /sys/devices/platform/hp-wmi/tablet
    0
    $ cat /sys/devices/platform/hp-wmi/tablet
    1
    $ cat /sys/devices/platform/hp-wmi/tablet
    0

  3. #23
    Join Date
    Nov 2008
    Beans
    9,635
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Script only does anything when launched in Terminal

    Yep, that be a swivel hinge signal for sure. So you should be able to at least use the Method 2 automatic rotation script.

    Now check in /etc/udev/rules.d. Is there a file called 62-magick.rules? Are there contents in it, i.e. it isn't empty? Magick Rotation should have installed it.

  4. #24
    Join Date
    Dec 2008
    Beans
    256

    Re: Script only does anything when launched in Terminal

    It's there and not empty.

    Code:
    # Magick Rotation's udev rules for tablet PC's using an OEM-WMI or OEM-ACPI
    #
    # These rules were compiled for the Ubuntu/Debian GNU/Linux distribution, but others may,
    # and indeed are encouraged to, use them also.
    #
    # Should you do so, PLEASE CO-ORDINATE ANY CHANGES OR ADDITIONS to 62-magick.rules with
    # Jayhawk so that we can present users with a standard set of device nodes which they
    # can rely on.
    
    KERNEL!="event[0-9]*", GOTO="magick-rotation"
    
    SUBSYSTEM=="input", ATTRS{name}=="HP WMI hotkeys", MODE="640", GROUP="magick", SYMLINK="input/magick-rotation"
    SUBSYSTEM=="input", ATTRS{name}=="Dell WMI hotkeys", MODE="640", GROUP="magick", SYMLINK="input/magick-rotation"
    SUBSYSTEM=="input", ATTRS{name}=="ThinkPad Extra Buttons", MODE="640", GROUP="magick", SYMLINK="input/magick-rotation"
    
    LABEL="magick-rotation"
    Oh, I missed that link you posted on page 1. I have to drive for a few hours right now, but I'll try these new methods soon.
    Last edited by Cadeyrn; December 29th, 2011 at 09:00 PM.

  5. #25
    Join Date
    Nov 2008
    Beans
    9,635
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Script only does anything when launched in Terminal

    That looks good so far. So let's make sure the symlink that should be is established is working and that the TM2t is putting out usable output. When you get a chance in a terminal enter:
    Code:
    sudo evtest /dev/input/magick-rotation
    Starting with the screen in laptop again swivel to tablet and back to laptop. Use ctrl-c or ctrl-z to exit. You should see output like:
    Code:
    Input driver version is 1.0.0
    Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
    Input device name: "HP WMI hotkeys"
    Supported events:
      Event type 0 (Sync)
      Event type 1 (Key)
        Event code 138 (Help)
        Event code 148 (Prog1)
        Event code 153 (Direction)
        Event code 224 (Brightness down)
        Event code 225 (Brightness up)
        Event code 226 (Media)
        Event code 358 (Info)
      Event type 5 (?)
        Event code 1 (?)
        Event code 5 (?)
    Testing ... (interrupt to exit)
    Event: time 1292260147.412318, type 5 (?), code 1 (?), value 1
    Event: time 1292260147.412360, -------------- Report Sync ------------
    Event: time 1292260151.669418, type 5 (?), code 1 (?), value 0
    Event: time 1292260151.669457, -------------- Report Sync ------------
    The part we're primarily interested in is:
    Code:
    Testing ... (interrupt to exit)
    Event: time 1292260147.412318, type 5 (?), code 1 (?), value 1
    Event: time 1292260147.412360, -------------- Report Sync ------------
    Event: time 1292260151.669418, type 5 (?), code 1 (?), value 0
    Event: time 1292260151.669457, -------------- Report Sync ------------
    Which should appear after you rotate the screen. But post the whole thing please.

  6. #26
    Join Date
    Dec 2008
    Beans
    256

    Re: Script only does anything when launched in Terminal

    Confirmed, Magick Rotation won't notice tablet mode.

    Code:
    $ sudo evtest /dev/input/magick-rotation
    Input driver version is 1.0.1                                               
    Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0                
    Input device name: "HP WMI hotkeys"                                         
    Supported events:                                                           
      Event type 0 (Sync)                                                       
      Event type 1 (Key)                                                        
        Event code 138 (Help)                                                   
        Event code 148 (Prog1)                                                  
        Event code 153 (Direction)                                              
        Event code 224 (Brightness down)                                        
        Event code 225 (Brightness up)                                          
        Event code 226 (Media)                                                  
        Event code 240 (Unknown)                                                
        Event code 358 (Info)                                                   
      Event type 4 (Misc)                                                       
        Event code 4 (ScanCode)                                                 
      Event type 5 (?)                                                          
        Event code 1 (?)                                                        
        Event code 5 (?)                                                        
    Testing ... (interrupt to exit)
    It never gave more output when I switched modes a few times.

  7. #27
    Join Date
    Nov 2008
    Beans
    9,635
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Script only does anything when launched in Terminal

    Thanks for doing that Cadeyrn! That seems to be an important finding. The hp-wmi.ko should be reporting the mode, laptop or screen, both ways.
    Confirmed, Magick Rotation won't notice tablet mode.
    Correct, because Magick now reads the type 5 Event key value 0 or 1 from "HP WMI hotkeys". And what evtest is showing us is that for some reason the hp-wmi.ko on the TM2t no longer provides that key value although it does still have the Event type 5, i.e. tablet mode switch. It just isn't supplying us actual information. That's why you aren't seeing the extra output when rotating the screen.

    Magick used to read the /sys/devices/platform/hp-wmi/tablet, and that part is still working.

    We had TM2t's reporting Magick worked for them. But recently several, including you, said it isn't working. I thought we had reports of it still working after we changed to reading "HP WMI hotkeys" but perhaps I am mistaken? I don't think I've ever had enough follow up with diagnostics to figure that out at this point.

    The only thing I'm coming up with right now is this is likely a BIOS problem.

    What you could do is check what BIOS version you have and its date. It would also help if you checked HP's site and see what BIOS versions and their dates are out there. It is possible you have a BIOS that was partly broken and a more recent one would fix things. Or perhaps it is the other way around and more recent BIOS's broke things. So it would be helpful to have an idea on the BIOS situation.

    It is possible that the hp-wmi.c just needs a little adjustment to the code to get things working again.

    I'll need to digest this a bit. Ouch.

  8. #28
    Join Date
    Dec 2008
    Beans
    256

    Re: Script only does anything when launched in Terminal

    I'll try the other methods. I'd rather not risk updating my BIOS when I already have buttons for rotating the screen.

  9. #29
    Join Date
    Nov 2008
    Beans
    9,635
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Script only does anything when launched in Terminal

    Sure I can understand that. But I would still appreciate it if you could tell me your BIOS version and the date it was released. That would start giving me something to work with.

    I'd like to point out you could still use Magick Rotation if you wanted to. It would just have to be version 1.1 or earlier. And for Natty and Oneiric you'd have to manually whitelist it so its icon appears in the system tray.

  10. #30
    Join Date
    Dec 2008
    Beans
    256

    Re: Script only does anything when launched in Terminal

    Here's the BIOS version I'm running:

    Code:
    $ sudo dmidecode --type 0
    # dmidecode 2.9
    SMBIOS 2.6 present.                                                         
                                                                                
    Handle 0x0000, DMI type 0, 24 bytes                                         
    BIOS Information                                                            
            Vendor: Insyde                                                      
            Version: F.25                                                       
            Release Date: 02/18/2011                                            
            ROM Size: 2048 kB                                                   
            Characteristics:                                                    
                    PCI is supported                                            
                    BIOS is upgradeable                                         
                    BIOS shadowing is allowed                                   
                    Boot from CD is supported                                   
                    Selectable boot is supported                                
                    EDD is supported                                            
                    Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)  
                    Japanese floppy for Toshiba 1.2 MB is supported (int 13h)   
                    5.25"/360 KB floppy services are supported (int 13h)        
                    5.25"/1.2 MB floppy services are supported (int 13h)        
                    3.5"/720 KB floppy services are supported (int 13h)         
                    3.5"/2.88 MB floppy services are supported (int 13h)        
                    8042 keyboard services are supported (int 9h)               
                    CGA/mono video services are supported (int 10h)             
                    ACPI is supported                                           
                    USB legacy is supported                                     
                    BIOS boot specification is supported                        
                    Targeted content distribution is supported                  
            BIOS Revision: 15.25                                                
            Firmware Revision: 131.32
    Glad I was about to help you fix a bug. I think I'll start using 1.1, then. Also, my service manual and the HP Customer Care site for my laptop don't have a BIOS version anywhere, so I don't think we'll find a control group here.

    EDIT: Aaaaaaand it works.
    Last edited by Cadeyrn; December 30th, 2011 at 06:55 PM.

Page 3 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •