Sunday, December 14, 2008

Bluetooth Audio (A2DP) on Ubunto

Just a week ago, I make a revolution to my home computers, begin to use Ubuntu on my home notebook and say goodbye to Windows. I have used Linux system for a long time but this is just limit to the server environment. I didn't have any good impression with Linux desktop enivronment. One of the major reason was the user interface's friendliness and the look. Linux desktop is always ugly and difficult to use. However Ubuntu totally turned over my mind, it is robust stable, competent features, clean interface and easy to configure. One of the biggest concerns in this migration is to make sure all my regular tasks can still be done in the new platform. Bluetooth audio (A2DP) is supported by Ubuntu but unfortunately the configuration is not straight forward and friendly. Here by I will introduce a procedure called "pulse" copy from bluetooth linux website. I only tested this on Ubuntu 8.10 but it supposes to work on any Linux distribution.

1. Pairing your bluetooth headphone as usual uses the bluetooth utility in the notification area.

2. Create a text file ".asoundrc" in your home directory and put the following:

pcm.bluetooth {
type bluetooth
device "00:00:00:00:00:00"
}


"00:00:00:00:00:00" is your bluetooth headphone MAC address. If you don't know the address, changing your headphone to pairing mode and execute "hcitool scan" to get the address.

3. Install package "pavucontrol"

sudo apt-get install pavucontrol


4. Create a script file in the following and put the file in any convenient place. You will use this file to connect or disconnect the bluetooth connection.

#!/bin/sh

index=`pactl list | grep -B 2 'Argument: device=bluetooth' | egrep 'Module #[0-9]+' | sed 's/[^0-9]//g'`

if [ -z "$index" ]; then
echo "load bluetooth module"
pactl load-module module-alsa-sink device="bluetooth"
else
echo "unload bluetooth module: $index"
pactl unload-module $index
fi


5. Turning on your headphone and run the script to make the connection. If successful, some number should be displayed.

6. Open "PulseAudio Device Chooser", clicks the icon in the notification area to open "Volume Control". In "Output Devices" tab, you should see some bluetooth device in the list. Click the down arrow icon and checks the "Default" checkbox.

7. Open "Sound" in system menu. In "Devices" tab, changes all the playback devices to "PulseAudio Sound Server".

Congratulation, you have finished the configuration and your bluetooth headphone becomes the default output source when it is connected. You can use the script file to turn on or off the headphone connection. The current implementation has some problem if the headphone connection is closed and your application is still playing the sound, most likely your application will be frozen as well. Actually the same thing is happened with my old day's Windows system. :P

Friday, November 14, 2008

How to train up your distance running strength - part one

I'm not a sport genius or expert. However if talking about running, especially the distance running, I'm proud for my current training result.

My distance running life is started by year 2002. I'm a VERY FAT guy at that time, the weight is close to 180 pounds. Do you find that I'm very fit in the facebook gadget and doubt about it?? This is normal and I think even the past of me was also difficult to believe my current achievement. For some reason (I will tell you health officially :P), I needed to pick an exercise as my long term hobby. I had considered other exercise such as badminton which is my another favor sport. But I found that running is the most efficient and simplest exercise, and it was quite suitable to me since my first priority at that time was burning the fat. What needed to equip for the running is just only a pair of shoes and my determination. Afterward, I begun my running life.

To continue in part two

Marathon becomes popular

I still remembered when I asked my friend to come with me to participate marathon, they would say I was mad and considered marathon was a mission impossible task. I played Standard Chartered Marathon for 3 years now. This year is something different to the past 3 years. This time the number of friends joined the marathon is a new record. There are about 10 persons, it is a new record.

I always tell my friend that 10km marathon is nothing special. It is just a simple exercise and supposed everyone who is health can also finish the race even they are lack of exercise. Might be my talking was successfully to influence my friends, or after they attended the running practice, they also felt the marathon challenge is feasible to them. This year is the most exciting time, since I can race with many friends. Past year my record is 2 hours to finish the half marathon. Wished I can break my personal record too this year.

Monday, October 6, 2008

Peugeot RC hybrid concept car

Usually hybrid car is designed for the fuel performance instead of the speed, so there is still no sport car in the market is equipped hybrid. But now Peugeot is showing a new hybrid RC concept car in Paris exhibition. RC series in Peugeot is always stand for sporty and performance. This concept car hybrid system is quite different to most of the current production cars. General hybrid system is that both the electric and combustion parts are working together. However this Peugeot's hybrid is separated transmission system. Both transmission systems are solely connected to either the front and the rear wheels. By default, when burning the gas, the car is rear wheels transmission. When turn into electric mode, the car is front wheels transmission. And this car also provides the blended mode to turning the car into all-wheels mode. Is that funny? Your car supports three transmission modes plus hybrid support.

Saturday, September 20, 2008

A video of a guy photos for 17 years

An awesome video, a guy spent 17 years to take two photos daily and created this video. You can see the changes of his head in 17 years. I wonder does this guy stay in the prison as his hair style was kept changing from very short to very long.

Tuesday, August 19, 2008

Subaru Time Lapse Rally Car Assembly

Sunday, August 10, 2008

Funny iPhone Application, "I Am Rich"

If you want your iPhone to be more personalized, there is an ultimate solution which costs only US$999.9.

"Its function is exactly what the name implies: to alert people that you have money in the bank. I Am Rich was available for purchase from the phone's App Store for, get this, $999.99 -- the highest amount a developer can charge through the digital retailer"

Double the price of iPhone for just only a mark. GREAT!!

http://www.macdailynews.com/index.php/weblog/comments/18119/