When I start the ADB, system completely freezes - linux

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.

Related

Stuck At Initializing ADB - Android Studio

My Android Studio Logcat is stuck and does nothing. It displays Initializing ADB and does not show filtering options and does nothing
Invalidated Caches and Restart did the trick. If is solved now. Thanks for your comments and answers.
Few solutions i tried and which worked for me in different times :
Go in devices view, delete the device and create a new one.
Kill the adb through command line
Before you execute the commands in CMD make sure that you added the adb tool to your Environment Variables path.
Killing adb
adb kill-server
Starting adb
adb start-server
other way of killing adb is Go to task manager->processes and kill the adb.exe process.
Even after doing all these if it prevails, the final thing i did is restarted my whole machine so that adb process is removed from RAM.
Hope it helped :)

Ubuntu 18.04 Server Beta 2 - restart / reboot not working

I have a fresh install of 18.04 SERVER installed on an Advantech SBC. 16.04 Server was working find but on 18.04 Server when I do a:
sudo shutdown -r now
The system starts the shutdown but stops with the last status line:
[ OK ] Stopped LVM2 metadata daemon.
I've tried some different bios configurations with power management but I can't seem to get it to restart. Only option at that point is to physically kill power and power up.
Anyone seen this? Any ideas on what to try?
On my SBC setting the South Bridge USB Configuration for Windows 8.x compatibility resolved this issue. Seems that the V4.15 kernel interactions with hardware are different enough to have caused this problem.

android studio doesn't detect my device on my ubuntu laptop

I am trying to run an app from Android Studio on my Ubuntu laptop.
I have enabled USB debugging, but it is still not working.
When I press run in Android Studio, it does not detect my device (LG G3 Lollipop).
I could not find any help :(
First of all,
Open terminal and do following:
Do lsusb command to check your device is indeed connected.
Do adb devices to check if your device is connected then it is detected as in adb mode.
2.a. if the above command is not found, do sudo apt-get install android-tools-adb and then check if it is listed.
Secondly, post results of step 1 and 2 with your question to help us in finding a correct solution.
Troubleshooting:
Make sure adb mode in enabled.
Make sure you have opted for Allow option when prompted for in your device upon connecting to your ubuntu system.
This one is from some past LG users, Try connecting your device in PTP mode rather than MTP mode, it surprisingly works.
If it atill doesn't work, (most likely your case), try googling. I landed upon this page by pressing I'M FEELING LUCKY, you should try to feel lucky once in a while.
Source for step number 3 and 4
follow the steps as mentioned upon page:
Create a file: /etc/udev/rules.d/70-android.rules.
Write: SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666" to the file.
Assign proper permission via sudo chmod a+rx /etc/udev/rules.d/70-android.rules
Reboot the system and restart udev.
As a second step of troubleshooting (make sure you again repeated troubleshooting from step1 in case you failed at this step)
Again, the process:
Create a file: /etc/udev/rules.d/51-android.rules.
Write: SUBSYSTEM=="usb", ATTR{idProduct}=="1004", MODE="0666" to the file.
Assign proper permission via sudo chmod a+rx /etc/udev/rules.d/70-android.rules
Reboot the system and restart udev.
Make sure you have adb installed in your ubuntu system.
If not then type -
sudo apt-get install adb
Provide your system password and press 'Y' asked during installation process.
Then disconnect your device through USB and then reconnect it.
You will have to grant permission for debugging which prompts on your device just after reconnecting.
I faced the same issue but it was my mistake. I didn't turn on the " USB DEBUGGING MODE ".
Settings > Developer Option > Enable USB Debugging Mode.
Try to revoke USB debugging authorizations and then connect your device, it should show permission prompt for authorization.
go to
settings -> developer options -> revoke USB debugging authorizations.
I tried restarting adb using root priviledges and it worked for me. Use these commands in the terminal:
sudo adb kill-server
sudo adb start-server
Hope it works for you too...
For my situation with Ubuntu 16.04, with my device properly connected via USB, confirmed by lsusb
The solution is let the Studio aware of the Android/Sdk folder by defining
export ANDROID_HOME=<the Android/Sdk folder>
in ~/.bashrc
(I have installed the SDK at a custom location)
Then start a new shell, from there re-start the studio, then it works.
I solved with this: https://stackoverflow.com/a/37109216/5081063
If the problem is only on Android Studio and not in your OS you can solve with that.
So first check if adb recognize any devices with:
$ adb devices
If yes, open Android Studio and follow these steps:
Go to Run > Edit Configurations...
Under Deployment Target Options select Show Device Chooser Dialog from the drop-down-list
if you are doing it first time in Ubuntu Linux, then Use sudo apt-get install to install the adb package. This gives you a community-maintained default set of udev rules for all Android devices.
or, use
sudo adb kill-server
sudo adb start-server
and check using
sudo adb devices
you can also check uncheck the usb debugging option, in your developer option in the phone.
follow this link for more info.
Run apps on a hardware device
Enable USB Debugging from Settings->Developer Options
Enable Developer Mode by clicking on build number several times
My device appeared as unrecognized and when I ran adb devices fom android-tools directory it said: adb not a command. Strange. So what I did is installed adb tools additionally and then run adb devices:
sudo apt-get install android-tools-adb
89LY0810Y unauthorized
Then I saw the dialog on my device and selected: Always authorize.
Please make sure your device is in debug mode.
If you have tried many terminal commands to connect your physical device to android studio in ubuntu and you failed to connect try this :- Connect your device and change your USB preference(device notification) to PTP,android studio will detect your device.see this image
I had the same problem, as I had enabled the USB Debugger but it was my first try so I didn't know what to expect. If you answer "yes" to "use as storage device," you will set it to mtp, if you answer no, after that you will have the option to connect on debug mode and it will appear.
I was using a Samsung A31 and Debian
After trying a lot of different solutions, I notice that the problem was my cable, so I changed it and now it works.
Thanks to RazorHail Answer.

How can I write a driver for an asus trackpad on 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.

Ubuntu is running in low graphics mode after installing ATI driver

I have Ubuntu, version 12. I installed ATI driver and I'm getting an error running in low graphics mode.
I needed to install the driver because every time I update or upgrade Ubuntu, right after installing the packages the system runs in low graphics mode.
The answer here also couldn't help me.
Graphics card model: ATI Radeon HD 3600
Installing fglrx also didn't help. The ATI driver is still installed and it still runs in low graphics mode. What should I do?
First, you should understand that your graphics manager is messed up and that is what you want to fix. Now; here is a solution to your problem:
Here is a simple guide showing you how to do it step by step:
A step by step guide to fixing "your system is running on low graphics"
When you turn off your computer, reboot and hold these three keys:
CTRL + ALT + F1
This will open the terminal where you can enter commands that I am going to show you below:
sudo apt-get update
Next enter the following command:
sudo apt-get -d install --reinstall gdm
Next enter the following command:
sudo apt-get remove --purge gdm
Next enter the following:
sudo apt-get install gdm
Almost done; When asked to choose, please select GDM and then finally:
sudo reboot
That is all you need to solve this problem!
Ok. Let me try to help you :D
-Go to Recovery mode
-Enable network (so you have internet connection)
-Go to Root option (Recovery mode)
-When you are in terminal delete lightdm type without brackets {sudo apt-get remove --purge lightdm}
-Then type without brackets {sudo apt-get install lightdm} (wait to install it)
-Then type without brackets {sudo service lighdm start}
-When it's finished type exit (you will get back to Recovery console)
-Then go on third option dpkg (Repair broken packages)(confirm with Y)
-When it's finished with installing packages type without brackets {sudo reboot}
-After reboot you will have back your Ubuntu! :D
I solve this problem after 1 day... Im a new user :D
Almost forgot i have Ati Radeon HD6770 graphic card, if you have Nvidia try it... Hope this was helpful!
Another possible issue could be installing new programs in bin. I am not sure if that what is causing you the problem but I faced this issue because of the same issue. If I understand correctly, bin is supposed to contain only executables. By mistake I moved a whole big program to bin and when I restarted the system, I saw this error. A simple solution that I found is the following. Say you have moved the big folder ABC to bin.
Start terminal by typing Ctrl+Alt+F1 and login with your username and password.
Login to root by typing
sudo su
and providing password.
go to bin by typing
/usr/bin
type
ls -lrt
This last command will show all the files chronologically. See last few of them. One of those, say ABC, must be the one that moved by mistake to bin.
Remove that by typing
rm -r ABC
and then restart by
sudo reboot
And you get your graphics back!
You can try and turn off the switchable graphics in the BIOS:
after that, it will be possible to use the Intel video card only with proper drivers on Ubuntu.
Here is the source: http://thegeekyland.blogspot.com/2014/07/ubuntu-1404-lenovo-g510.html
In any ubuntu OS version 12.04,14.04 configured with the old graphic card ATI/RS690
change the setting as below
etc/default/grub/
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset "
sudo update-grub
Restart

Resources