Skip to content

Commit

Permalink
openroberta: don't switch consoles
Browse files Browse the repository at this point in the history
Disable console switching for openrobertalab to prevent lock up of brickman. This was partially done already, but it looks like we missed an instance.

Thre is a race condition where openrobertalab has probably already switched to graphics mode and so the system call to chvt hangs forever because it cannot switch consoles.

This is a temporary workaround to fix the lockup until a proper solution can be found. Currently, brickman will still be on the dispaly when openroberta programs are running. Ideally, the openroberta service should be updated to handle console switching to avoid the race condition.

Issue: OpenRoberta/robertalab-ev3dev#64
  • Loading branch information
dlech committed Jul 14, 2020
1 parent 1c7e722 commit 98e165d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/controller/OpenRobertaController.vala
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ namespace BrickManager {
if (message == "executing") {
debug ("program starts, switching to tty%d", OPEN_ROBERTA_TTY_NUM);
executing_user_code = true;
chvt (OPEN_ROBERTA_TTY_NUM);
// FIXME: need to figure out how console switching is going to work with GRX3
// chvt (OPEN_ROBERTA_TTY_NUM);
}
} else {
status_bar_item.connected = false;
Expand Down Expand Up @@ -203,9 +204,9 @@ namespace BrickManager {
}
}

void chvt (int num) {
// TODO: might be better to do this with ioctl
Posix.system ("/bin/chvt %d".printf (num));
}
// void chvt (int num) {
// // TODO: might be better to do this with ioctl
// Posix.system ("/bin/chvt %d".printf (num));
// }
}
}

0 comments on commit 98e165d

Please sign in to comment.