Feature #751

Add function to find X.org VT

Added by Hammel 5 months ago. Updated about 3 hours ago.

Status:ClosedStart date:10 Mar 2020
Priority:ImmediateDue date:
Assignee:Hammel% Done:

100%

Category:-
Target version:PiBox - 2.0 - Harkonnen
Severity:01 - Critical

Description

This can be done with this command:

ps -l | grep "X :0" | grep -v grep | tr -s " "| cut -f7 -d" "

This doesn't appear to fail under ash (Busybox shell) if the first grep doesn't find anything. We can use this to find the correct "vtsrc" for any app.

Associated revisions

Revision 231b52d6
Added by Hammel about 4 hours ago

RM #751: Add piboxGetVTNum() to find current and next VT's for vt-switching when launching and killing omxplayer.

Revision e429027d
Added by Hammel about 3 hours ago

RM #751: Add a string version and an int version of functions for retrieving a VT number. The former works with any named process but must make a shell call to get the VT. The latter works only for the current process and uses an ioctl.

Revision 088d57a3
Added by Hammel about 3 hours ago

Merge branch 'RM-751' into 'master'

RM #751: Add a string version and an int version of functions for retrieving a...

See merge request pibox/libpibox!1

History

#1 Updated by Hammel 2 months ago

  • Severity changed from 03 - Medium to 01 - Critical

This was a problem during release testing for 1.1 on B/B+ models so I'm moving it up in severity.

#2 Updated by Hammel 20 days ago

  • Priority changed from High to Immediate

#3 Updated by Hammel 19 days ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

Programmatic option (maybe): https://www.helpnetsecurity.com/2002/04/08/console-ioctls-under-linux/
Example code: https://img2.helpnetsecurity.com/dl/articles/txt/console18.txt

Look for VT_GETSTATE.

Also see console_ioctl in man pages.

The library should get the VT the app was started on. Then it can have set_vt() and restore_vt() modes to move away from and back to the original VT.

#4 Updated by Hammel 16 days ago

  • % Done changed from 10 to 20

I Have a branch with functions for supporting getting the VT for the current process (getVTNum) and any named process (getVT) in the RM-751 branch of libpibox.
The merge request for this is here: https://gitlab.com/pibox/libpibox/-/merge_requests/1

These functions need to be tested. There are unit tests already written. There is no app currently using this so I think adding it to videofe would be the best place to start (since it needs it most).

#5 Updated by Hammel 15 days ago

  • % Done changed from 20 to 50

Unit tests are implemented and run successfully.

Now I need to test with videofe.

#6 Updated by Hammel about 6 hours ago

  • % Done changed from 50 to 60

Initial test without full media system shows piboxGetVTNum() works as expected in videofe. It finds the vt that X is on. This was true even when I remotely logged in, set DISPLAY=unix:0.0 and ran videofe.

A more complete test is needed to make sure videofe switches vts correctly given the use of the new piboxGetVTNum() api.

#7 Updated by Hammel about 6 hours ago

  • % Done changed from 60 to 70

Works on touchscreen/rpi3. Need to test on monitor/rpi2.

#8 Updated by Hammel about 4 hours ago

  • % Done changed from 70 to 90

Verified working on monitor/rpi2.
Just need to commit and push now.

#9 Updated by Hammel about 3 hours ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

All changes committed and pushed. All PR's approved and merged.

Closing issue.

Also available in: Atom PDF