Tag Archives: ubuntu

Fixing adb “no permissions” usb error in Ubuntu

I am running a minimal Ubuntu 11.10 install–as you can see from other posts–inside a virtual box, strictly for development purposes.

I am trying to use my old Droid 1 for dev because my virtual pc has almost no ram. I got adb to detect my Droid 1 but now I’m getting this error:

dev@DevVbox:~/android-sdk-linux/platform-tools$ ./adb devices
List of devices attached
????????????   no permissions

Ok it looks like the problem is solved by creating a file in the /etc/udev/rules.d/ folder.  developer.android.com recommends 51-android.rules thus I will use that name.

In a terminal type:

sudo gedit /etc/udev/rules.d/51-android.rules

Now you need to add your device definition to this file.  My file is looking like:

SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"

For your own device change the ATTR{idVendor}==”Your Device Number” to the device you want to use.  Find your vendor id here.

Now I make my file readable:

sudo chmod a+r /etc/udev/rules.d/51-android.rules

Next I restarted udev:

sudo service udev restart

Then I restarted adb:

dev@DevVBox:~/android-sdk-linux/platform-tools$ ./adb kill-server
dev@DevVBox:~/android-sdk-linux/platform-tools$ ./adb start-server

Then I unplugged my phone and plugged it back in. (On virtual box I had to tell it that I wanted my virtual pc to attach that device)

presto now I get:

dev@DevVBox:~/android-sdk-linux/platform-tools$ ./adb devices
List of devices attached 
0403683B0A023017	device

Other links:

http://developer.android.com/guide/developing/device.html#VendorIds  (start here)

http://www.reactivated.net/writing_udev_rules.html

http://ubuntuforums.org/showthread.php?t=168221

http://ptspts.blogspot.com/2011/10/how-to-fix-adb-no-permissions-error-on.html

 

 

 

Leave a Comment

Filed under Android Development, Ubuntu

Ubuntu – Setting up a SSH Server on a Minimal Install

On a minimal install there is no SSH server setup automatically so I’m having to add that.  Here is what I did:

SSH client is installed in the minimal (Ubuntu 11.04), but the SSH Server is not.

From the Terminal type:

sudo apt-get install openssh-server

 

That seems like all you need to do.  If you have connected to the computer previously and it is a fresh install you may run into an error regarding the Key not matching.  To fix this in Ubuntu delete the ~/.ssh/known_hosts file on the client PC.

 

https://help.ubuntu.com/10.04/serverguide/C/openssh-server.html

 

 

Leave a Comment

Filed under Ubuntu

Ubunut Minimal Install – Fixing Locale Error After Removing language-pack-en-base

I read on a low memory install site that I could save some space by removing language-pack-en-base. Great!  I did it but now I’m getting all kinds of errors on locale not configured.

To fix this problem it was rather simple from the terminal I ran:
sudo dpkg-reconfigure locales

It creates errors while reconfiguring but afterwards it seems to fix the problem.

Other links:
https://help.ubuntu.com/community/Installation/LowMemorySystems
http://www.myscienceisbetter.info/repair-perl-locale-errors-on-ubuntu-server.html

Leave a Comment

Filed under Uncategorized

Ubuntu Sound Saga

This post is to document my saga with a usb sound card and getting it to work. I know that I can get sound out of this card because I already had it working. I changed a setting and now no sound.

What I have tried so far:
Reinstall of Ubuntu, this time I’m going for minimal install.

installed packages for sound:
sudo apt-get install linux-sound-base alsa-base alsa-utils

aplay -vv /usr/share/sounds/alsa/Front_Center.wav  (Verbose tells me no card)

No sound.  Displays:

ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4663:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM default
aplay: main:660: audio open error: No such file or directory

Now I search to see why my usb card is not detected.

sudo aplay -l
Displays (just aplay -l says no sound card... maybe this is my problem):
**** List of PLAYBACK Hardware Devices ****
card 1: default [Generic USB Audio Device ], device 0: USB Audio [USB Audio]
 Subdevices: 1/1
 Subdevice #0: subdevice #0

Now I’m trying:

lspci -v | grep -A7 -i "audio"

Shows nothing, this could be a problem (turns out this is because I’m using a usb sound card and my pci card is disabled).  I am going to try reseating the usb card.  Looks like I had the cable plugged into the mic input.  Still no sound and same error when aplay is used.  On to the next thing.  Reading the SoundTroubleShooting guide leads me to think it might be bios, checking settings in bios.

alsamixer does not run.  But if I specify the card alsamixer –card=1 it will work.

I changed USB bootable in my bios and now I can use aplay -l with no sudo but still same error when trying to play some file.  Still nothing shows up with lspci. Next I will look to see if my driver is loading correctly.

Step 1: what is my sound driver supposed to be called?  snd-usb?

lsusb

Gives more info, my card is:

Bus 004 Device 002: ID 0d8c:000e C-Media Electronics, Inc. Audio Adapter (Planet UP-100, Genius G-Talk)

This sounds familiar from the last time, at least the Planet UP-100. Ok what driver do I need?

Perhaps the driver is snd-usb-audio?  Taking a look at the file: /etc/modprobe.d/alsa-base.conf this file prevents the loading of the snd-usb-audio driver as the 0 device.  Since I disabled my primary card (it doesn’t work with Ubuntu) the usb has to be the primary card.  I will comment out the lines that prevent it from loading (there happen to be two of them exactly the same):

options snd-usb-audio index=-2 (just add a # in front of the line)

Restarting alsa:

sudo alsa force-reload

It also gave me a nice list of the drivers being loaded by alsa.  Retesting.

SUCCESS!!

Recap:

1. Check cables.

2. Play sound: aplay -vv /usr/share/sounds/alsa/Front_Center.wav

3. Check if there is a card: sudo aplay -l

4. Use either lsusb or lspci -v | grep -A7 -i “audio” to find out if there is a sound card detected.

5. Check that the drivers are loading correctly.  If usb and it has to be the primary card edit /etc/modprobe.d/alsa-base.conf to allow usb as card 0.

Reloading alsa: sudo alsa force-reload

 

**Update**

I got a new computer and there were some audio problems with it as well after a minimal install.  Here is what I did:

After running the requisite aplay I got an error message saying:

ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4663:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM default
aplay: main:660: audio open error: No such file or directory

Next I tried to run aplay sound with sudo, it worked fine.  My hunch is that there is some sort of permission problem and my user is not setup for access to sound where the root user is.  Now I will check to see if there is a group problem.

First I tried adding my user to the audio group:

sudo adduser username audio

I get the same error running aplay.  Restarting alsa does not fix the problem.  Reboot the computer.

Success!
Links:

https://help.ubuntu.com/community/SoundTroubleshooting

http://mauroandres.wordpress.com/2007/04/18/minimal-ubuntu-install/#Sound

http://www.alsa-project.org/main/index.php/SoundcardTesting

http://www.maenad.net/geek/di8k-debian/node23.html

 

https://help.ubuntu.com/8.04/serverguide/C/user-management.html

 

 

 

2 Comments

Filed under Ubuntu

Grub 2 – Adding a Boot Option

I always forget how to add an option so here is the quick and dirty.

Add to grub 2 by adding a file to the /etc/grub.d/ folder. There are several in there already (those are the current options) Grub organizes them by name so 00_header comes before 10_linux. Add a new file ie: (12_newfile) and edit it in your favorite editor.

I am going to use this file for an install drive from the mini.iso
so you may have to determine what the correct settings are here is my file:

#!/bin/sh -e
echo “#HD Ubuntu Install”
cat << EOF
menuentry “HD Install” {
set root=(hd0,1)
linux /linux
initrd /initrd.gz vga=normal ramdisk_size=14972 root=/dev/rd/0 rw —
}
EOF

The important part is the root=(hd0,1) and the linux/initrd

root is the drive you want to use, for instance if you want to use /dev/sda1 it is (hd0,1) sda2 would be (hd0,2) sdb1 would be (hd1,1) etc.

linux is the linux image names are often: linux vmlinuz

initrd is often initrd.gz  these things can change so best to do a search to get the right options.

Once your write this file you have to make it executable and have grub reconfigure the grub.cfg file, from the command line type:

sudo chmod +x 12_filename

sudo update-grub

Reboot and your new option will be there.

Links:

http://ubuntuforums.org/showthread.php?t=28948

Leave a Comment

Filed under Ubuntu

Ubuntu – Turning off swap for resizing

I am trying to re-partition my harddrive and my new install has a swap at the end of the drive but I want to merge it with another partition at the end.

Warning: Partitioning, resizing, and formatting can and most likely will destroy all data.  I’m not responsible if you lose everything.  Proceed at your own risk!  (Unmounting your swap may make your computer run slow too.)

Open terminal
type:
sudo swapoff -a

This will turn off all swaps.

Now open gparted and resize to your hearts content.

Leave a Comment

Filed under Ubuntu

Ubuntu 11.04 Minimal Install Using Openbox as Window Manager

I have been playing with minimal installs and found this to be a pretty good combination. I wanted to write down the packages to download after minimal installation, so here they are.

Make a minimal install, there are many guides on the internet.  Here is one that I found useful:

http://www.psychocats.net/ubuntu/minimal

 

Here is the quick one line command to put in the terminal:

sudo apt-get install xorg openbox obconf openbox-themes lxpanel xfe linux-sound-base alsa-base alsa-utils leafpad gksu synaptic chromium-browser nfs-kernel-server nfs-common portmap flashplugin-installer xdm readahead terminator openssh-server

Packages explained:

xorg – x.org package will install all that you need for xwindows.

openbox, obconf, openbox-themes – These three are for openbox.

lxpanel – a nice panel, task bar for those Windows users out there.  I had to add a lxpanel line to my ~/.config/openbox/autostart.sh file for it to start.  I also noticed it will add programs automatically to the menu, which the default openbox menu system does not.

xfe – a simple file explorer.  I may want to change this but for now I like it.

linux-sound-base alsa-base alsa-utils – sound drivers and utilities

leafpad – simple text editor

gksu – Graphical sudo (for usage with things like synaptic in xwindows)

synaptic – Package installer for xwindows

chromium-browser – Chrome, my browser of choice.  Mainly because I can avoid gnome files this way.

nfs-kernel-server nfs-common portmap – nfs file sharing for Ubuntu.  I’m creating a file server so I want this.  You don’t have to install unless you want it.

flashplugin-install – this is the flash plugin.  For some reason they have three of these packages, this one will download from adobe the current one.

xdm – a simple login manager, it is nice.  I like it better than slim.

readahead – supposed to make booting faster.

terminator – had to find a better terminal this one has copy and paste with right click, game on!

openssh-server – If you want to connect to your computer remotely this is the only way to go.  Creates an ssh server so you can log in, most installs include this but minimal does not.

Since you are using Openbox it is convieniet to copy the menu.xml to you ~/.config/openbox/ directory:

from the terminal:

cp /etc/xdg/openbox/menu.xml ~/.config/openbox/

You also may want to copy the autostart.sh and add anything (like lxpanel) you want to have started upon bootup.

cp /etc/xdg/openbox/autostart.sh ~/.config/openbox/

Good luck!

Other Links:

https://help.ubuntu.com/community/Installation/LowMemorySystems

 

Leave a Comment

Filed under Ubuntu

Ubuntu – mounting an iso file

To mount an iso file to copy files.

open your terminal
First you must have a folder to mount the iso file to, type:
sudo mkdir /media/isofile

now you mount it with some special options.
sudo mount myiso.iso /media/isofile/ -t iso9660 -o loop

Now your files will be mounted in /media/isofile/ folder.  They will be read only so you will not be able to add to them.

Links:

Mount and Unmout ISO images without burning them

Leave a Comment

Filed under Ubuntu