pi-topUtils 1.05

Keyboard/HID driver and battery indicator for pi-top laptops
Vanfanel
Posts: 476
Joined: Mon Sep 16, 2013 12:01 am

Re: pi-top utilities

Post by Vanfanel » Thu Sep 06, 2018 5:29 pm

@Jon: I finally got a 2nd hand PiTop (original model), and I have been trying this. However, I can't make it fly. The battery icon apears on the bottom part of the screen, yes, but there's nothing I can do. The right PiTop key is supposed to be the middle-mouse button, but it does not act as such.
Also, no sound comes out of my PiTop speaker, and I can't see any levers to manage volume.

What am I supposed to do, other than double-clicking the !pi-topUtils icon?

JonAbbott
Posts: 2107
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: pi-top utilities

Post by JonAbbott » Thu Sep 06, 2018 7:20 pm

The tray icon only displays battery usage, it doesn't do anything else.

Everything else is handled by the HID Module - check the pitopUtils Module has loaded, which also contains the pi-top speaker driver code. Its been a while since I coded it, but I think it executes the "playback/configure" script in the apps directory.

The volume is controlled via keys: fn+F8 / fn+F9 / fn+F10

Vanfanel
Posts: 476
Joined: Mon Sep 16, 2013 12:01 am

Re: pi-top utilities

Post by Vanfanel » Fri Sep 07, 2018 12:18 am

@Jon: Thanks for your support. I can't make it sound. I have manually clicked on the pitopUtils Module, but still I see nothing but the battery icon, which works and reports the right remaining battery.
Using fn+F8 / fn+F9 / fn+F10 does not do anything, should I see something on screen indicating the volume has been changed? No sound comes out of the speaker.

JonAbbott
Posts: 2107
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: pi-top utilities

Post by JonAbbott » Fri Sep 07, 2018 7:32 am

Go to the F12 command line and use *MODULES to confirm the pitopUtils Module is loaded.

Once confirmed, find out what the USB device ID is for the keyboard. Off the top of my head, "*SHOW USB*" lists the USB devices. Just list all of them here if you're not sure which one it is.

Confirm you've forced HDMI audio in CONFIG/TXT for the speaker to work:

Code: Select all

hdmi_force_edid_audio=1

Vanfanel
Posts: 476
Joined: Mon Sep 16, 2013 12:01 am

Re: pi-top utilities

Post by Vanfanel » Fri Sep 07, 2018 1:02 pm

@Jon: Got it to work! I simply added

Code: Select all

hdmi_drive=2
to config.txt and the pitop-speaker sounds now! Great!
Can you add it to the instructions on the first post, please?

However, there are some problems and questions:

-With the 50Hz video mode you recommend to use with the PiTop, there's a noticeable hiccup once in a while on games. You can easily see it on smooth-scrollers like PacMania tittle screen, or Poizone waving+scrolling test. You have to wait some seconds for it to happen, but it does happen.
Maybe adjusting the video mode timings can fix it?
I have also tried that video mode with my TV and the same hiccups are present, so the PiTop screen is not to blame, but the video mode.
I have also noticed that native games also have problems with this video mode, there seems to be tearing, look at Manic Miner scrolling text for example. It's not an ADFFS problem, but something with the video mode...

-How can I totally disable the screen dimming?
It makes no sense when writing text or playing ADFFS games that don't use mouse.
I tried setting pitopUtils$DimTimeout to 0, but it will then dim every second...

-How can I have the PiTop Utils automatically loaded on boot?

-Sometimes, a "b" letter is sent when I move the mouse cursor. Any idea on what's going on? It can be several b's in a row. It's annoying when trying to save a document, for example.

-Where's middle-mouse? the right pi-top labeled key is not the middle mouse, that's for sure.

JonAbbott
Posts: 2107
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: pi-top utilities

Post by JonAbbott » Fri Sep 07, 2018 2:12 pm

Vanfanel wrote:
Fri Sep 07, 2018 1:02 pm
@Jon: Got it to work! I simply added

Code: Select all

hdmi_drive=2
I wouldn't have thought that would work as that switches the output to DVI. The screen in mine is CEA (ie HDMI)
Vanfanel wrote:
Fri Sep 07, 2018 1:02 pm
-With the 50Hz video mode you recommend to use with the PiTop, there's a noticeable hiccup once in a while on games. You can easily see it on smooth-scrollers like PacMania tittle screen, or Poizone waving+scrolling test. You have to wait some seconds for it to happen, but it does happen.
Maybe adjusting the video mode timings can fix it?
I have also tried that video mode with my TV and the same hiccups are present, so the PiTop screen is not to blame, but the video mode.
I have also noticed that native games also have problems with this video mode, there seems to be tearing, look at Manic Miner scrolling text for example. It's not an ADFFS problem, but something with the video mode...
Never had an issue with my screen running 50hz. The fact it occurs on external TV as well implies its a software issue.

Does Manic Miner triple buffer? You'll get tearing if it doesn't as the current screen buffer is always one frame behind.
Vanfanel wrote:
Fri Sep 07, 2018 1:02 pm
-How can I totally disable the screen dimming?
It makes no sense when writing text or playing ADFFS games that don't use mouse.
I tried setting pitopUtils$DimTimeout to 0, but it will then dim every second...
I didn't implement the ability to disable it. It shouldn't dim if you're using the mouse or keyboard. I can add a disable feature if it's required.
Vanfanel wrote:
Fri Sep 07, 2018 1:02 pm
-How can I have the PiTop Utils automatically loaded on boot?
Add it to the apps to run at startup in Configure.
Vanfanel wrote:
Fri Sep 07, 2018 1:02 pm
-Sometimes, a "b" letter is sent when I move the mouse cursor. Any idea on what's going on? It can be several b's in a row. It's annoying when trying to save a document, for example.
Lord only knows how that's happening, I thought the mouse and keyboard were on different USB Endpoints.

I assume you've done the usual thing of upgrading everything to the latest firmware etc.
Vanfanel wrote:
Fri Sep 07, 2018 1:02 pm
-Where's middle-mouse? the right pi-top labeled key is not the middle mouse, that's for sure.
I'm guessing you have a US or European keyboard - for some reason they have a different key code for the pi-top keys.

I'll need to find my endpoint code so we can figure out what the key is, then I can add the option to support it.

I have a vague memory that the pi-top keys are plain broken on non-UK keyboards, but we'll find out once you run the code. I should probably add the ability to select the key you want to use for middle mouse by simply pressing it once - might be more user friendly than trying to figure out internal key codes.

Vanfanel
Posts: 476
Joined: Mon Sep 16, 2013 12:01 am

Re: pi-top utilities

Post by Vanfanel » Fri Sep 07, 2018 2:47 pm

@Jon:

-I can see the hiccups on ADFFS games, too, not only on Manic Miner (which I don't know what's doing regarding video buffers...)
For example, can you look at Fireball 2 scrolling text on the tittle screen? Can't you see the fast tearing / hiccups once in a while?

-My keyboard seems to be UK, it matches the default UK mapping on RISC OS.

Also, do you know if it's possible to disable the tap-to-click feature? I am accidentally clicking all the while :(

JonAbbott
Posts: 2107
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: pi-top utilities

Post by JonAbbott » Fri Sep 07, 2018 8:11 pm

Vanfanel wrote:
Fri Sep 07, 2018 2:47 pm
-I can see the hiccups on ADFFS games, too, not only on Manic Miner (which I don't know what's doing regarding video buffers...)
For example, can you look at Fireball 2 scrolling text on the tittle screen? Can't you see the fast tearing / hiccups once in a while?
It doesn't sound like the screen supports 50hz. Have a look at the EDID data (*ReadEDID I think) and see what it says.
Vanfanel wrote:
Fri Sep 07, 2018 2:47 pm
-My keyboard seems to be UK, it matches the default UK mapping on RISC OS.
See this post and the next two in the thread. Run the BASIC program at the top of the thread and let me know the result, as Raik did. You can see from my reply that on the German keyboard the right and left pi-top keys are incorrectly mapped.
Vanfanel wrote:
Fri Sep 07, 2018 2:47 pm
Also, do you know if it's possible to disable the tap-to-click feature? I am accidentally clicking all the while :(
Not to my knowledge, probably best to ask on the pi-top forum.

JonAbbott
Posts: 2107
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: pi-top utilities

Post by JonAbbott » Sat Sep 08, 2018 10:43 am

JonAbbott wrote:
Fri Sep 07, 2018 2:12 pm
Vanfanel wrote:
Fri Sep 07, 2018 1:02 pm
-How can I totally disable the screen dimming?
It makes no sense when writing text or playing ADFFS games that don't use mouse.
I tried setting pitopUtils$DimTimeout to 0, but it will then dim every second...
I didn't implement the ability to disable it. It shouldn't dim if you're using the mouse or keyboard. I can add a disable feature if it's required.
I've just spotted that it doesn't check for Joystick movement, so I'll add that when I modify it.

JonAbbott
Posts: 2107
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: pi-top utilities

Post by JonAbbott » Sat Sep 08, 2018 6:28 pm

Try the attached Module. Setting the dimmer timeout to zero should now prevent dimming (I've not tested as my pi-top isn't to hand) and I've mapped both the left and right pi-top keys to the middle mouse button. If your keyboard firmware keymappings are wrong in the same way as the German keyboard, the right pi-top key will now work, but I still need you to run that BASIC program to confirm what the pi-top keys are mapping too.

Post Reply