WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Mouse hangs on launching X  (Read 9012 times)

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: Mouse hangs on launching X
« Reply #15 on: May 11, 2015, 04:26:05 PM »
Not sure if centralware is still around :( ...just wanted to post an observation. Utilizing the same hardware on TC 6, mouse hung using Xvesa but no longer with Xorg.

Offline Alatun

  • Newbie
  • *
  • Posts: 41
Re: Mouse hangs on launching X
« Reply #16 on: May 18, 2015, 07:49:59 AM »
This problem annoys me and I'm looking for a way to fix it. To get a better understanding I've got a question:

There is an old thread, that seems to refer to the same problem: http://forum.tinycorelinux.net/index.php/topic,11985.0.html.
"dfattcl" seems to have done some investigation, but as far as I understood the final post in his thread, he thinks that lxterminal should cause the mess... - but why? As far as I understand, lxterminal is an X application that emulates a terminal which can be used for console based applications. When xvesa starts, there is no lxterminal running, so how could lxterminal cause this problem?

Unfortunately dfattcl only wrote: "changing the terminal" could fix the problem. Anybody has an idea, what he could have done?

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Mouse hangs on launching X
« Reply #17 on: May 18, 2015, 08:13:43 AM »
Do you have lxterminal installed onboot? The extension creates a symlink to xterm so it can be used by programs that are not aware of what terminal you use. Maybe it runs in the background?
Download a copy and keep it handy: Core book ;)

Offline Alatun

  • Newbie
  • *
  • Posts: 41
Re: Mouse hangs on launching X
« Reply #18 on: May 18, 2015, 08:37:26 AM »
No lxterminal installed. "aterm" is being used as X terminal emulator.

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: Mouse hangs on launching X
« Reply #19 on: May 18, 2015, 01:06:35 PM »
When my mouse hung, lxterminal was not installed. My impression is that this is an Xvesa issue.

Edit: Don't believe aterm is required to boot, so just for testing purposes you could try removing aterm from onboot to see if any difference.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Mouse hangs on launching X
« Reply #20 on: May 18, 2015, 02:18:13 PM »
Hi nitram
I see the same behavior under Xorg.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Mouse hangs on launching X
« Reply #21 on: May 18, 2015, 03:12:17 PM »
For me, under Xvesa I just need to move the mouse a tad, second attempt and things work.
Under Xorg I havn't seen it.

Would something like this be possible? Maybe via  ~/.X.d/ .
Code: [Select]
sudo echo "something" > /dev/input/mice
Download a copy and keep it handy: Core book ;)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Mouse hangs on launching X
« Reply #22 on: May 18, 2015, 04:59:09 PM »
Hi Misalf
I take back my previous statement. The machine I was referring to is running Xvesa, though I do recall someone else mentioning
they saw it under Xorg.
Would something like this be possible? Maybe via  ~/.X.d/ .
Code: [Select]
sudo echo "something" > /dev/input/mice
Don't know if you could get that to work. Here's something which does seem to fix it though:
Code: [Select]
#include <stdio.h>
#include <unistd.h>
#include <linux/input.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <string.h>

// Compile using:
// gcc  -march=i486 -mtune=i686 -Os -s -pipe -Wall mousemove.c -o mousemove
// Run using:
// sudo mousemove `cat /proc/bus/input/devices | grep mouse | grep event | awk '{ print $3 }'`

int main(int argc, char *argv[])
{
struct input_event event, event_end;
char mouse[256]="/dev/input/";
int i;

if(argc < 2)
{
printf("Mouse event required, i.e.  event3\n");
return(-1);
}
strcat(mouse, argv[1]);

int fd=open(mouse, O_RDWR);
if (fd < 0)
{
printf("Error opening mouse:%s\nCould not open %s\n", strerror(errno), mouse);
return(-1);
}
memset(&event, 0, sizeof(event));
memset(&event, 0, sizeof(event_end));
gettimeofday(&event.time, NULL);
event.type=EV_REL;
event.code=REL_X;
event.value=50;
gettimeofday(&event_end.time, NULL);
event_end.type=EV_SYN;
event_end.code=SYN_REPORT;
event_end.value=0;
for (i=0; i < 10; i++)
{
write(fd, &event, sizeof(event));// Move the mouse
write(fd, &event_end, sizeof(event_end));// Show move
usleep(50000);// wait
}
close(fd);
return 0;
}
Compile the program and place the  mousemove  executable in  ~/.local/bin
Create a file called  mousemove  in  ~/.X.d  with the following contents:
Code: [Select]
sudo mousemove `cat /proc/bus/input/devices | grep mouse | grep event | awk '{ print $3 }'`My scripting skills are lacking so there's probably a better way of implementing the above command.
« Last Edit: May 18, 2015, 09:50:29 PM by Rich »

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Mouse hangs on launching X
« Reply #23 on: May 18, 2015, 05:11:35 PM »
Rich, you're awesome!
Download a copy and keep it handy: Core book ;)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Mouse hangs on launching X
« Reply #24 on: May 18, 2015, 09:52:06 PM »
Hi Misalf
There was an error in the code I posted. It's been corrected.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Mouse hangs on launching X
« Reply #25 on: May 19, 2015, 09:30:13 AM »
I'm quite happy seeing Rich progressing with coding skills :)

That's a tad hacky though, given we do have the server source, and it's not half as bad to build compared to the old Xfree86 one.
Anyone having this issue, please test the new tinyX extensions posted at
http://tinycorelinux.net/~curaga
The only barriers that can stop you are the ones you create yourself.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Mouse hangs on launching X
« Reply #26 on: May 19, 2015, 09:43:32 AM »
Hi curaga
Quote
That's a tad hacky though, ...
In what sense? The code itself, the cat/grep/awk command, that it's external to the server code ... ?
I can't learn anything without details. ;D
« Last Edit: May 19, 2015, 09:45:26 AM by Rich »

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Mouse hangs on launching X
« Reply #27 on: May 19, 2015, 10:03:11 AM »
Confirming with  tinyX  there is no "mouse hanging".
Download a copy and keep it handy: Core book ;)

Offline Alatun

  • Newbie
  • *
  • Posts: 41
Re: Mouse hangs on launching X
« Reply #28 on: May 19, 2015, 10:13:04 AM »
Just did a remaster with the new Xvesa.tcz from curaga and no more mouse hanging after X starts.

Thanks a lot.


Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Mouse hangs on launching X
« Reply #29 on: May 19, 2015, 10:40:05 AM »
I'll wait a week for other confirmations before moving these to the main repo. Thanks for testing.

Quote
That's a tad hacky though, ...
In what sense? The code itself, the cat/grep/awk command, that it's external to the server code ... ?
I can't learn anything without details. ;D

In that it's a separate app to wiggle the mouse. The code is not bad (buffer overflow risk with the strcat), and you shouldn't use cat in pipes, as it's inefficient to launch a separate program when grep/awk can read files directly.

The pipe chain can also be done entirely in awk: awk '{ if (/mouse/ && /event/) print $3 }' < /proc/bus/input/devices
The only barriers that can stop you are the ones you create yourself.