Wednesday, June 25, 2008

Command line way to install a package

Use the following command to install a package:
sudo dpkg -i /path/to/filename.deb

PulseAudio, Flash, and Firefox

After installing Hardy, I was having a variety of problems with sound as well as Flash. Apparently there is some conflict between Flash and PulseAudio. For example, I was only getting sound from the first application I launched. So if I had firefox open, it would have sound. But then if I then opened a second application like rhythmbox, exaile, etc, no sound from that. This also worked the opposite way. In addition, I was having a problem with Firefox crashing everytime flash was running on sites like youtube.

The following has worked for me:
1. Uninstall the following packages using synaptic: libflashsupport and flashplugin-nonfree
2. Install the following packages using synaptic: pulseaudio-module-hal pulseaudio-module-x11 libasound2 libasound2-plugins padevchooser swh-plugins libao-pulse ladspa-sdk libsdl1.2debian libsdl1.2debian-pulseaudio
3. Run the following command to edit the /etc/libao.conf file:
sudo gedit /etc/libao.conf
Edit the file so that it looks like this:
default_driver=pulse
Then save and close the file
4. Run the following command to edit (or create if has not been) the asound.conf file:
sudo gedit /etc/asound.conf
Then add the following to the file:
pcm.pulse {
type pulse
}
ctl.pulse {
type pulse
}
pcm.!default {
type pulse
}
ctl.!default {
type pulse
}

Then save and close the file. This addition makes it so that all sound runs through pulse.
5. Go to System-->Preferences-->Sound and change the first four lines to "PulseAudio Sound Server"
6. To get flash working properly, we need to download the beta version of Flash 10. Download the deb package here. Then double click to install. To see other versions, check the site here.
7. Finally, reboot.

Sources: The (almost) Perfect Pulse Audio Setup and PulseAudio Fixes & System-Wide Equalizer Support (Hardy Heron)

Friday, June 06, 2008

The command to use to search for installed packages in terminal

The following command will let you check to see if a package is installed:
aptitude search package-name

If you see an "i" next to the package name, it is installed.

Bluetooth Headsets with Hardy

I used the Bluez Wiki page to help get my bluetooth headset working with ubuntu. It basically uses the new default pulseaudio to divert the sound to your headset. I don't know if it matters, but it's a Samsung headset. Also, I know some people have had problems with skype which this post does not address.

To get it working, do the following:
1. Install the following package using synaptic: padevchooser
2. Type the following into a terminal to get your headset's mac address and then write it down:
sudo hcitool scan
3. Install Blueman using the instructions at the Blueman website. This is the only way I could bond / pair / connect my headset to my computer without getting an obex error. As long as Blueman shows a lock next to your headset, it should be good. I believe the problem occurs because the default ubuntu/gnome bluetooth app is trying to browse the headset for files.
4. Next use the following command to edit (or create if it doesn't already exist) the asound.conf file (note that "nano" can be replaced for "gedit" if you like):
sudo nano /etc/asound.conf
Add the following to the file as stated on the Bluez wiki page:
pcm.bluetooth {
type bluetooth
device 00:11:22:33:44:55
}
and save the new file
*Note that "xx.xx.xx.xx.xx.xx" should be replaced by the mac address you found in step 2.
6. Run the PulseAudio Device Chooser found in Sound & Video and will then show up in the tray.
7. Under preferences, choose to start on login. Also, check what you like under "configure local sound server."
8. Restart your computer.
9. In a terminal type:
pactl load-module module-alsa-sink device=bluetooth
This command has to be run each time you start your computer. I have not found a way to automate it without getting an error message somewhere. Therefore, I just made a launcher using the above command to speed things up.
Also, although I have not tested it, the following command should work to get a bluetooth microphone working:
pactl load-module module-alsa-source device=bluetooth

You should now be able to choose your bluetooth headset in the pulse device chooser under "default sink." If this doesn't work, try using the volume control option in the pulse device chooser, right click on the stream that is playing, and choose the bluetooth headset.

The Bluez wiki page also gives ways to send audo to the headset for only specific programs. (I found exaile can be set up using the rhythmbox instructions). Also, if this doesn't work for you, please check this thread at ubuntu forums for a slightly different approach.

Changing preferred actions or programs for media in Hardy

Hardy seems to have moved the preferred actions around for media. Some of it can still be configured in Systems-->Preferences-->Preferred Applications. However, to set the defaults for what happens when something like a CD is inserted, you must change it in nautilus. Therefore, pull up your home folder or any other folder and go to Edit-->Preferences-->Media Tab and make the changes you want.