Jump to content
xisto Community
Ahsaniqbalkmc

Linux Mint 14: Strange Usb Keyboard/mouse Issue When Power Plugged Off

Recommended Posts

I have been using linux mint 14 for about a month now and I am quite satisfied with it. I always wanted to get into the linux ecosystem and for that I have tried a number of different linux distros but always had one issue or another that made me eventually go back to windows 7.With linux mint 14, most of those issues never occurred. Some of them are still there, for instance no gaming, but I have learned to overlook these and now I can say that I am using it quite comfortobly.Despite that, every now and then, a small issue would arise, that I won't be able to fix and hence my linux experience is spoiled. I try hard to stick tightly to linux but sometimes the issues become so annoying that I have to go back to windows 7 for some tasks. I completely understand that it is not linux's fault that I cannot fix these issues. With time, I would gain sufficient skill to overcome these minor issues and then I would be able to enjoy the true power of linux.One such issue that I am currently unable to fix is rather strange one. So let me first explain the issue. When my laptop is plugged into a power source, everything works just fine. By everything I mean the input devices like keyboard and mouse. However, when the power goes off or when the power cable is plugged out of the laptop, strange things start to happen. The mouse pointer will start to hang (not move even when I keep the mouse moving), and the keyboard will stop taking input after every few seconds. That is, the mouse and keyboard will work normally for about 30 seconds but then there comes a period of about 5 seconds when the keyboard buttons won't work and the mouse pointer won't move. After these 5 seconds, everything will start working normally again.The interval between normal working and hiccups is not consistent. And it is more consistent with the mouse than the keyboard. For example, when I start typing a long document, the keyboard will start behaving normally after a few periods of no function (the periods of no function would disappear). But when I stop using the keyboard, the periods of no function occur more frequently and predictably. The thing with mouse is a bit more worse. No matter how consistently I use it, the periods of no function would still appear and they are more frequent and predictable than the periods of no function that occur with the keyboard.To add further to the problem, these issues happen only with usb connected devices. The laptop's own keyboard and trackpad don't have these issues. Only the usb mouse and usb keyboard have this issue. And to make it further clear, none of these issues were there when I had freshly installed the linux mint 14 onto my system. So most likely, I have installed something that is causing the trouble.Now if I were on my windows machine, and such a thing would happen, I would quickly assume that some program is running in the background that is interfering with the normal functioning of the keyboard and mouse. So I would quickly open op the task manager window and try to find out any unusual program that is running in the background. If I find such a program, I would kill it. Another solution would be to uninstall any recently installed program that could have potentially started the issue.The problem here is that I don't know how to open a task manager (or equivalent program) in linux. And further more I don't know how to kill a specific task running in the background. What I mean to say is that I need to know how to get a list of all the programs and task running in the background and then selectively kill some of them.Furthermore, I also don't know how to get a list of all the installed programs. I do know how to delete a specific program using the terminal (sudo apt-get –purge remove program-name) but for this I need to remember what programs I have installed and what names they use. The task would become much easier if there is some way of getting a list of all the installed programs and then selectively uninstalling some of them.Hopefully, this approach can solve my issue. But if anyone else has something else in mind that can help me solving the issue, I will be more than pleased to know...

Share this post


Link to post
Share on other sites

And further more I don't know how to kill a specific task running in the background. What I mean to say is that I need to know how to get a list of all the programs and task running in the background and then selectively kill some of them.

Having a list of all tasks running on a linux system is very easy.On a command-line shell window, just type the following :
ps -aef
This will give you a list of all running programs, yours and other ones. For each running task you will see the proces ID of the task, the process ID of the father task, the name of the task, and when it was fired.

Share this post


Link to post
Share on other sites

Hi Ahsaniqbal111,Linux Mint is a great distribution for people starting out on Linux. It improves on Ubuntu and also supports proprietary codecs out of the box.It's quite incorrect to say gaming isn't there in Linux, it is, most good games cost. The problem is that when you have popular titles on other platforms, that aren't written to be cross platform, is not a Linux fault, but more a developer issue. ID Software had created most their games for Linux after source code leaked on the internet and someone ported it to Linux which helped them realise that they could write portable code that worked on both systems. The Quake series was my favourite FPS at the time, although I don't really play games anymore. Anyways, Ubuntu seems to be bringing the gaming towards Linux, with having Steam support, so you should check that out when you have the chance.Ahsaniqbal111, fixing problems in Linux should not be your problem to fix. If issues are happening and you are uncertain why, it's always good to file a bug report or to check other bug reports to see if the same issue is reported. A lot of people ignore errors they come across, when really they should submit a report or seek help, it could be an issue that affects others. Without people knowing that you're experiencing errors they can't guide you nor can they fix unknown issues.The issue you describe with the laptop not being connected to the power is indeed a strange one. So what is your laptop specs? Brand/Model, CPU, RAM, Graphics, etc. Also what architecture for Linux Mint 32bit or 64bit?Have you updated your laptop to ensure it's not been fixed? One of the issues I had with Linux Mint is their GUI updater for updates did not work that well and would recommend against using it and suggest you use apt-get for updating (even better apt-fast).How does Linux Mint run when your laptop is started unplugged from the power? Does it still have these issues?So it sounds USB related or power related. You also mention that it never happened when you first installed Linux Mint, possible updates could have resulted in the new problem or software installed may have changed something, but the possibilities are endless. You will need to check logs to see if any issues have been occuring. Which I'll get to soon.The GUI equivalent of Task Manager is System Monitor. Software Manager is also the GUI you can use to check software that you have installed. If you want terminal equivalence I can provide that too.As for killing tasks, it's not really recommended unless you are certain that the program has frozen and you need to force kill it. If it's in a frozen state, or using an excessive amount of CPU, then it should be ok to stop the process.Most of the logs you would be interested in looking at would be found in /var/log, some logs worth looking at might be debug, kern.log and messages.Cheers,MC

Share this post


Link to post
Share on other sites

Having a list of all tasks running on a linux system is very easy.On a command-line shell window, just type the following :

ps -aef
This will give you a list of all running programs, yours and other ones. For each running task you will see the proces ID of the task, the process ID of the father task, the name of the task, and when it was fired.
Well, the process of getting the list was easy, but honestly it was difficult to understand. The most important thing for me to know is the name of the program that is running, but in the list that opens after entering the command you mentioned, there is no such thing as the name of the program. The nearest thing to the name of the process is given under the heading “CMD” which I don't even know what it stands for..
So @yordan, can you help me understand it so that I can manipulate it usefully.
Plus, are there any alternatives. Something more similar to the task manager to the windows operating system. Linux has a large community of developers and there are all sorts of programs available for it. So it is very likely that someone would have developed a task manager similar to that of windows task manager for non-expert linux users.

It's quite incorrect to say gaming isn't there in Linux, it is, most good games cost. The problem is that when you have popular titles on other platforms, that aren't written to be cross platform, is not a Linux fault, but more a developer issue. ID Software had created most their games for Linux after source code leaked on the internet and someone ported it to Linux which helped them realise that they could write portable code that worked on both systems. The Quake series was my favourite FPS at the time, although I don't really play games anymore. Anyways, Ubuntu seems to be bringing the gaming towards Linux, with having Steam support, so you should check that out when you have the chance.



Well, linux does have its own games but most of the famous titles are not available for it. Like for example, I play Fifa 12 and 13 a lot and none of these two games can be played on linux. As you said, it is debatable that why the games are not available on linux. Most likely, it is not linux's fault because I think that it is strong enough and stable enough to run most high quality games. Instead it seems to be caused by combined effect of less interest of hardware manufacturers in the linux OS (most graphics cards drivers can get better if the manufacturers put effort into it) and less interest of game developers in the linux OS (which probably is because most consumers don't use linux).
I think it has become kind of a cycle. Game developers don't put effort and money in making their games compatible with linux because they think that there aren't many customers who would paly the games on linux. On the other hand, gamers don't go towards linux because most of the times the games they like can't be played in linux. So some serious steps need to be taken to stop this cycle.
Steps like bringing steam engine to ubuntu will certainly help.

Ahsaniqbal111, fixing problems in Linux should not be your problem to fix. If issues are happening and you are uncertain why, it's always good to file a bug report or to check other bug reports to see if the same issue is reported. A lot of people ignore errors they come across, when really they should submit a report or seek help, it could be an issue that affects others. Without people knowing that you're experiencing errors they can't guide you nor can they fix unknown issues.

Actually, by “Fixing problems in Linux”, I meant to say “troubleshooting common problems and errors and ability to make necessary adjustments for better experience.”
And yes, fixing linux's problems is not something I can do (I simply don't have the technical skill to even properly understand the problems). I can just notify the community about the problem. However, sometimes, there arise some errors which are not innate to linux but arise because of faulty installation of wrong configuration settings or some other mis-behaviour on user's part. And to get a better experience, I think a user needs to know how to deal with such issues.
And the issue described in the first post of the topic is a good example of this.....


The issue you describe with the laptop not being connected to the power is indeed a strange one. So what is your laptop specs? Brand/Model, CPU, RAM, Graphics, etc. Also what architecture for Linux Mint 32bit or 64bit?

My laptop is HP DV6 3040us. The processor is AMD Triple core (AMD Phenom II N830 clocked at 2.1 GHz). It has 4 Gigs of Ram and 500 gigs of 5400 rpm hard drive. The graphics are ATI Radeon HD 4250 with 320 MB or dedicated memore and upto 1.5 gigs of shared memory. The cpu architecture is 64bit so the linux mint 14 version I am using is also 64 bit.

Have you updated your laptop to ensure it's not been fixed? One of the issues I had with Linux Mint is their GUI updater for updates did not work that well and would recommend against using it and suggest you use apt-get for updating (even better apt-fast).

I have updated the OS using both the GUI updater and apt-get (using command “sudo apt-get update”). My understanding of the command “sudo apt-get update” is that all it does is loads the latest repositories for the apt-get command so that the latest packages can be installed using this command. I don't think that this command updates the OS, simply because the time taken for update using this command is not large enough.
So maybe you can tell me how to update the entire system using the apt-get or apt-fast command.

How does Linux Mint run when your laptop is started unplugged from the power? Does it still have these issues?

Yes the issue is still there even if I start the OS with power cable plugged off.

So it sounds USB related or power related. You also mention that it never happened when you first installed Linux Mint, possible updates could have resulted in the new problem or software installed may have changed something

Well, I think this is the real culprit. I remember installing laptop-mode-tools. I have seen improvement in the battery timing after installing this package. And I think it is reducing the power provided to the usb ports. Can you talk more about the laptop mode tools.
I will remove this when I get time to see if the issue persists and report back later.
I also remember installing some keylogger utility, which never really worked but it is still installed. I will try to remove this as well and then see what happens.

The GUI equivalent of Task Manager is System Monitor. Software Manager is also the GUI you can use to check software that you have installed. If you want terminal equivalence I can provide that too.

Thats what I was looking for (thank @MC). It is more like the windows task manager and is certainly more understandabale than the terminal command “ps -aef”.

Share this post


Link to post
Share on other sites

I have used laptop-mode-tools in ubuntu before, but this was mainly because it use to be installed by default but not enabled. I'm not sure if they install it now. I also recall another power management tool called Jupiter that was quite popular at the time, again not sure if it's needed anymore because some of the fixes/improvements that went into pm-utils, was to cover some of the top power saving features of these tool. I think the only difference laptop-mode-tools does now is hard drive power down/idling, whether it's still required I am not sure. Ubuntu has a page on power saving techniques, I think these tools are just convenience to perform those specified tasks.

 

Linux only titles can only get fame in the Linux community.

 

Everything you install should have documentation hopefully. Usually this is where you would start with troubleshooting and fixing configuration files.

 

Because you have laptop-mode-tools running, it could be the fact that from changing from on power to off power, the laptop_mode setting is causing the problem. Not sure why it use to be included with Ubuntu even if you didn't use a laptop but it use to always default to not being enabled too. I didn't really like having things included that served no purpose rather than convenience so most of the time I would spend clearing things I don't use. Turning off services I didn't use.

 

A command line equivalent for task manager would be top but you should either look at the man pages on it, man top so you can learn some of the basic commands. Also when running top, you can press h to get help as well, but it's not that easy to understand.

 

If you just want to kill a program, you can use xkill which lets you pick with the mouse what window you need to kill. It turns the cursor into a cross and clicking on the window will kill that program. Some usually set this up as a shortcut so that you can click on it then click on the window to kill easier.

 

Cheers,

 

MC

Share this post


Link to post
Share on other sites

Ok.. so I have removed the “laptop-mode-tools” (by using the command “sudo apt-get –purge remove laptop-mode-tools”) and then I rebooted the system and now everything is working fine. The hiccups and periods of no response have disappeared completely. So it confirms that the real culprit was laptop-mode-tools.

However, now I need to know why was it causing the issue. And because there is some much needed improvement in the battery life, I would really like if I can get the laptop-mode-tools (or some alternative) to work with the mouse/keyboard issue fixed.

So some input on this would be appreciated..

I have used laptop-mode-tools in ubuntu before, but this was mainly because it use to be installed by default but not enabled. I'm not sure if they install it now. I also recall another power management tool called Jupiter that was quite popular at the time, again not sure if it's needed anymore because some of the fixes/improvements that went into pm-utils, was to cover some of the top power saving features of these tool. I think the only difference laptop-mode-tools does now is hard drive power down/idling, whether it's still required I am not sure. Ubuntu has a page on power saving techniques, I think these tools are just convenience to perform those specified tasks.

 

I would give a try to Jupiter and see how it performs for me. I don't know if there are any power saving tools built into the linux mint 14. If there are any, I don't see them and I don't know how to use them.

I haven't given a try to the Fedor 18 but before I downloaded it, I went to the official website to get some quick knowledge about it. And the power saving tools were presented there as the one of the main feature of fedora 18.

Because the laptop-mode-tools does improve the battery timing, so I have to say that if there are any built in power saving tools in the linux mint 14, they are not very effective (they may be effective but they certainly aren't doing everything that can be done).

 

Everything you install should have documentation hopefully. Usually this is where you would start with troubleshooting and fixing configuration files.

 

I will try to look into the documentation of the laptop-mode-tools and see what I can find there. However, it is easier for me if an Xisto member (who has previous experience with similar issues) posts a reply. This would save a huge effort on my part.

Because you have laptop-mode-tools running, it could be the fact that from changing from on power to off power, the laptop_mode setting is causing the problem. Not sure why it use to be included with Ubuntu even if you didn't use a laptop but it use to always default to not being enabled too. I didn't really like having things included that served no purpose rather than convenience so most of the time I would spend clearing things I don't use. Turning off services I didn't use.

 

I am not very good at modifying the configuration files. Maybe there is some setting to turn of the power saving modification for the usb ports. This way all the other power saving features of the laptop-mode-tools would remain active and the issue with usb keyboard/mouse would also be resolved. But as I said, I am not good with editing configuration files, so it would take me considerable amount of time to learn how to correctly modify the configuration file of laptop-mode-tools. And I just don't have time these days.................

A command line equivalent for task manager would be top but you should either look at the man pages on it, man top so you can learn some of the basic commands. Also when running top, you can press h to get help as well, but it's not that easy to understand.

 

I tried top, but I would again say that simialr to “ps -aef” I wasn't able to understand a significant part of the information presented. So again, I would have to invest considerable amount of time in learning to understand the output of this command and then usefully manipulating it.

However, since the culprit has been found, so killing programs is not the main goal now. But still, it would be very useful to learn how to use these useful commands properly....

If you just want to kill a program, you can use xkill which lets you pick with the mouse what window you need to kill. It turns the cursor into a cross and clicking on the window will kill that program. Some usually set this up as a shortcut so that you can click on it then click on the window to kill easier.

 

xkill was really great. It would definitely help me kill the windows which have become unresponsive (which by the way happens very seldom in linux in comparison to windows)... However, what about programs and processes that don't have a window. How can xkill be used to kill them....

Share this post


Link to post
Share on other sites

I tried top, but I would again say that simialr to “ps -aef” I wasn't able to understand a significant part of the information presented

in a command line window, type
sleep 60 &
then type
ps -aef
in the ps display you will your "sleep 60" command running. This command does nothing more than sleeping during 60 seconds. You will see the process ID of this sleep command, and the ID of thre process which started this sleep command (most probably your bash window).

Share this post


Link to post
Share on other sites

xkill really is only for windows, well I haven't looked into it more than this becaue it required mouse action. Another command is kill, but you need to know pid of the program running and also background processes really are meant to run in the background and not be known to users that they are running behind the scense. Usually if I know what I want to kill, I would do kill `pidof name_of_program` or I would use top or ps with grep to grab specifically only what I need. ps is like a snapshot of the running processes, while top is real time (well close enough to real time)

 

System Monitor is probably your best tool because it's similar to Task Manager and that's what you're use to. top could be the same as well but really requires you to set it up so it's not too confusing. It has a lot of statistical information at the top, like how long your computer has been up (uptime), number of users on the system, memory and stuff. All these stats can be turned off by pressing l (lowercase L), t, m. If you're looking for a program that is using a lot of CPU power or memory, then these stats are not worth looking at.

 

What you would be more concerned about is the PID, USER, %CPU, %MEM and COMMAND, you can press f and customise what fields you want to see as well as understand what each column means I usually only show these fields and sort by CPU which you press s while on the CPU field. You can press page up and page down to see what else is running, but usually CPU usuage can be quite little. So I rarely need to kill a program.

 

As I mentioned, top has a lot of keys to achieve the filters you would want. Like if you only want to see tasks by your user press u then type the user you want to see. Press L to search for something like a program or PID, maybe you can search for top then take the PID number top has and press k type that PID number in and kill it with signal 15 and you've killed top. It's quite a powerful tool but I don't actually now anyone who really uses these tools as you don't usually have problems unless you're a developer who can create memory leaks or hog the CPU.

 

For more commands press h inside top and it'll hopefully suggest other things you can do, but I gave the basics.

 

Cheers,

 

MC

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.