How can I write a driver for an asus trackpad on linux? - linux

I bought a laptop and installed Linux on it and the trackpad is now not working but it was on Windows. There is no linux driver for it and I thought this could be a good project to write one.
I have read and implemented tutorials on device drivers for simple things (turning on an led on a pandaboard) but I have no idea where to start here. Related questions pointed to commands like modprobe -r psmouse and it seems the trackpad is not seen at all.
Any idea ? the laptop is : Asus R409C.

A temporary fix is to boot with "psmouse.proto=bare" on the kernel cmdline.
$ sudoedit /etc/default/grub
Change GRUB_CMDLINE_LINUX_DEFAULT to add psmouse.proto=bare at the end, and save your modifications.
Then:
$ sudo update-grub
And finally reboot.

i think linux input subsystem can be used to write driver for touchpad. Exact details need to be considered. But most of the input devices can be integrated using input subsystem.

Related

Ubuntu 16.04.3 intel skylake i915 external monitor not detected

My external monitor, connected via HDMI was working fine but now is not being detected (it says 'No video input'). I'm pretty sure I didn't make any changes to make it stop - it was working on the same setup yesterday.
I'm a pretty new linux user and also don't know much about graphics hardware and drivers. Appreciate any help, I'd like to understand what's going on!
I'm running Ubuntu 16.04.3 kernel 4.10.0-33
lshw -c video gives:
*-display
description: VGA compatible controller
product: Sky Lake Integrated Graphics
vendor: Intel Corporation
physical id: 2
bus info: pci#0000:00:02.0
version: 07
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:124 memory:f0000000-f0ffffff memory:e0000000-efffffff ioport:e000(size=64) memory:c0000-dffff
I've tried booting from grub into kernel 4.8.0 and the monitor still wasn't detected.
I've also tried to no avail:
sudo apt-get update
sudo apt-get install --reinstall xserver-xorg-video-intel xserver-xorg-core
sudo dpkg-reconfigure xserver-xorg
I've also tried running the Intel graphics update tool and this also hasn't solved anything.
EDIT: It seems like I get the 'No video input' probelm if I plug in the HDMI cord before the computer has finished booting.
Pretty much the only answer one can give here based on the available information is, try checking the display cables, and, if that doesn't help, file a bug. Debugging display problems like this can be fairly involved, with several cycles of requesting and providing more information. That doesn't really work all that well here.
The alternatives for filing the bug are Ubuntu Launchpad and drm/i915 upstream. Upstream has the best knowledge about the driver and the hardware, but, depending on the issue, you might be expected to build and run the userspace components or the kernel from upstream git repositories.
I come across the problem and solve it with exactly the same card (i had same lshw -c video) by searching the NVIDIA X-Server settings (search inside apps) on my Ubuntu 16 LTS and activate the NVIDIA drivers for this card (I have a NVIDIA GEFORCE GTX)
After i log out and i have a bad errors display and i was blocked " this computer is running in low display mode" .
I just switch off the computer and restart it...and taatatatat HDMI was working and was able to display on my external Sansumg 27''
I had the exact same issue as OP. lshw not showing HDMI port, nada. Reinstalling xserver* did not work either.
May the gods of stack overflow smile upon you for that EDIT line, because plugging only after boot was complete, it did work for me as well.
This is quite interesting, as I am running 20.04. This issue came out of nowhere, just turned on the computer and voila, it was not working. There had been no updates, no changes that could affect this during previous session.
Would love to know if someone else has bumped into this problem.

When I start the ADB, system completely freezes

When I start the ADB in command line:
$ sudo adb start-server
I get message like this:
* daemon not running. starting it now in port 5037 *
* daemon started successfuly *
And after this system(Ubuntu 16.04(x86_64)) completely freezes.
How I can fix this problem?
UPD: I run
strace adb start-server
and get, which system freezed on command nanosleep.
on my system i have solved my problem with plugging in laptop power.
when my laptop is connected to power cord. adb works. and when i is on battery its gonna freeze.
i think this is something with Acpi.
another solution:
to start using adb when i am on battery:
sudo tlp ac
and when i want to quite:
adb kill-server
sudo tlp start
Try upgrading to 16.10 and make sure you have the following set in your BIOS:
- From Legacy to UEFI boot
- Disabled USB 3.0 legacy
Ref: https://ubuntuforums.org/showthread.php?t=2313496
I choose poprietary driver and this work, but not all time, sometimes this problem repeated.
I was having the same problem on my archlinux system (with ANY version of the kernel).
The problem for me seems to be the usb auto-suspend function of tlp. I've disabled it completely setting:
USB_AUTOSUSPEND=0
And for the moment it seems to have solved the problem.
EDIT: It wasn't the usb autosuspend i had to uninstall completely tlp to make it work until i can investigate this further.
Fo me, it was tlp
Edit the conf file at /etc/default/tlp
I did
USB_AUTOSUSPEND=0
and
USB_BLACKLIST_PHONE=1
Maybe you don't need to put USB_AUTOSUSPEND=0
EDIT: doesn't seem to work anymore.

Can`t find ttyUSB[id]

I have just started with my Raspberry Pi and I have a project where I want to read data from the USB port. I have installed Java JDK8 and written the program that compiles and run. But I get the message that /dev/ttyUSB1 does not exist.
I just have a cable from the USB port on the Arduino going to the USB port on the RPi and I am using Raspbian Debian Wheezy
When I go to DIR /dev/ and use $ ls, I can only find tty0 up to tty63. I have searched on the internet and some say that you can use ttyAMA0, but this does not work. I have also searched for the same problem, but have not found a answer to my problem.
I have used $ lsusb which gave me 4 devices (001-004) on Bus 001. I can see that, for example, my USB keyboard is listed as Bus 001 Device 004: ID 1532:010b Razer USA, Ltd.
and if I run $ dmesg | grep Manufacturer I get that:
[xxxxxxxxx] usb 1-1.2: Manufacturer: Razer
So my question is why does my usb devices not get listed as ttyUSB[id]? Do I have to manually attach it?
I am a bit noob when it comes to Linux.
Hope someone can help me!
I have some bad news for you. The reason you have no /dev/ttyUSB[n] devices on the RPi (when you connect your Arduino) is because you need the Arduino drivers (FTDI drivers in particular). The unfortunate thing is that these drivers don't yet exist for the Arm platform (which includes the RPi). This is according to the FTDI web page showing support. Note the lack of Linux driver support for Arm.
Apparently on Arm running Linux the only way to program the Arduino is via the serial port interface directly via the GPIO pins. Information on doing this can be found here . You will also have to do something similar on the Arduino side see this information.
Once you have the two devices connected via straight serial then your going to probably run into another SNAFU. By default apparently on the RPi Linux will use the serial port for sending debug/console output. In order to use the serial interface for something that behavior has to be modified. This article discusses that. In particular disabling the kernel from using the serial port for terminal use this would seem to apply:
The following steps (based on a clean 2012-07-15-wheezy-raspbian install
Open a terminal on the Raspberry, or connect to Raspberry Pi through SSH.
Make a backup of the /boot/cmdline.txt file.
sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt
Edit /boot/cmdline.txt file:
sudo vi /boot/cmdline.txt
This file contains:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 $
Remove the parameters that reference the UART serial port (ttyAMA0):
dwc_otg.lpm_enable=0 console=tty1 $
Comment next line in /etc/inittab:
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Reboot Raspberry Pi
sudo reboot
If you use a different Linux distro than Debian it would be different but the basics would still apply (modifying the kernel command line)

Raspberry pi - file blocking startup

I was trying to make some script automatically run on OS start up, but somehow i did it wrong and now i cant even start the OS since the file is blocking it.
Can i recover the OS removing what i did or at least have access to all my files inside my SD card? I've opened it on my laptop and all i have is two repartitions "BOOT" and "RECOVER" but can't find my user folder /home or anything usefull.
What i did:
sudo cp /home/pi/Desktop/test.sh /etc/rc.local
Thanks!
Best get a bootable CD of a linux distro - fedora, ubuntu, any other, it doesn't really matter - boot the CD on your laptop and mount the SD card from there. Windows can't read linux partitions; other linuxes can.

Where is evdev.c on linux?

I want to install a patch to get my touchscreen working, but can't seem to find this one file.
Running ubuntu netbook edition 10.10, with no custom kernel.
There's linux/drivers/input/evdev.c (apt-get install linux-source) and xf86-input-evdev/src/evdev.c (apt-get source xserver-xorg-input-evdev). The former is how the kernel exports input events to userspace through the /dev/input/eventX device nodes; the latter is how the X server translates those into X events. It's not obvious from the question which you mean.

Resources