Steven Gordon's Home

Welcome to my home page! I am currently living in Pathumthani, Thailand, working as an Assistant Professor in Sirindhorn International Institute of Technology, Thammasat University. Here you can find information about:

  • My research and teaching activities in the area of Telecommunications, the Internet and Computer Science at Thammasat Uni.
  • Some personal information about me including photos and articles on living in Pathumthani (part of greater Bangkok), diaries from past holidays in Africa, South East Asia and Canada, recipes and some computing stuff

Feel free to contact me if you have any questions.

Interview on China Radio International

I was interviewed earlier this week for the People in the Know news and affairs program for China Radio International. CRI is one of the three state-run media organisations in China (the other 2 being China Central TV and China National Radio). Its main purpose is to broadcast China related content to rest of the world. Hence it is similar to Radio Australia, BBC World Service and Voice of America.

The topic was the new project in China for integrating their TV, telephone and Internet into one network. The interview was aired on radio today (Wednesday 7 July) and also can be listened to online.

The Effect of Delay/Jitter on Streaming Video

Here is a quick guide for demonstrating the impact of delay and jitter on streaming video across a network. I used this as a demo in ITS323 and ITS413.

Requirements

You need to two computers, with at least one running Ubuntu (or other Linux-based operating system). VLC must be installed on both computers - it is is as the video streaming server and video player at the client. To introduce extra delay/jitter into the path from server to client, tc is used. This is available in Linux - it can be installed from repositories using apt-get. I'm not sure of an equivalent free application in Windows operating systems, hence the reason that one computer must run Ubuntu. The two computers must be connected together via some network. To avoid problems with firewalls and NAT, and achieve reasonable speed, I suggest using a direct connection (Ethernet cross over cable or adhoc wireless LAN) or LAN (Ethernet or wireless LAN). Finally, I assume you have a video file to stream, e.g. an AVI encoded using XViD.

VLC as the Video Player on the Client

VLC is a great media player supporting many different codecs and available for a variety of operating systems. On the client computer (you could use Windows OS, but I'll give instructions for Ubuntu) VLC will be used to play the received video. You have two options to open the network stream:

  1. Via the command line, run:
    vlc udp://@CLIENTIP:1234
    

    where CLIENTIP is the IP address of this client computer. You can find it using the ifconfig command.

  2. Open VLC and from the Media menu select Open Network Stream then specify the protocol as UDP and the IP address as your computers address. Port 1234 is chosen by default. Then press play.

As the server hasn't started, nothing will be displayed yet.

Streaming Server

In addition to being a media player, VLC can act as a streaming server. A command line interface (with no GUI) is available using cvlc. Your server computer should be running Ubuntu. Assuming the video file you want to stream is video.avi start streaming it:

cvlc -vvv video.avi --sout '#std{access=udp,mux=ts,dst=CLIENTIP:1234}'

Again, CLIENTIP is the IP address of the client computer that is going to receive the stream. The '-vvv' option gives verbose output on the terminal. The 'access' option specifies UDP is to be used as the streaming protocol. The 'mux' option specifies the format to encode the data. 'dst' specifies the destination host and port number. Note that as an alternative to the command line, you can start a streaming server via the Media->Streaming... menu in the VLC GUI.

Now on the client you should see the video playing.

Adding Delay/Jitter using tc

In Linux, tc is a traffic control application. It allows you to control packets being sent by your computer. We will use it on the server computer to introduce additional delay/jitter/loss into the path from server to client. You need to be an administrator to make changes with tc, i.e. use sudo in Ubuntu. Without explaining how tc works, here are some example commands you can use.

To add a random delay of between 90 and 110ms (average 100ms) to every packet your computer sends do this (assumes you are using your Ethernet interface eth0):

tc qdisc add dev eth0 root netem delay 100ms 10ms

To remove this delay, use the del option, i.e.:

tc qdisc del dev eth0 root netem delay 100ms 10ms

To change the jitter, simple change the 2nd time interval (10ms above). You can also drop, for example 1% of the packets (randomly):

tc qdisc add dev eth0 root netem loss 1%

And again you can remove it by replacing add with del. Also you can change existing commands by using change instead of add and del.

With tc you can now vary the additional delay/jitter/loss in the network path and investigate how that effects the quality of the streaming video.

Getting Mobile Broadband Working on Ubuntu 9.10

A couple of weeks ago I was on holidays, tried to access the Internet on the laptop using my mobile phone as a modem and nothing worked. It had previously worked fine, but turned out my "upgrade" to Ubuntu 9.10 actually downgraded the capabilitys of the Ubuntu Network Manager to connect. Finally, I have found a work around. This is what I did.

Install wvdial and the corresponding Gnome GUI for it, gnome-ppp. You can install via the Synaptic Package Manager or the command line:

sudo apt-get install wvdial gnome-ppp

These will be used to create the point-to-point (PPP) connection via the modem (i.e. the mobile phone) instead of the default Ubuntu NetworkManager. So delete your existing Mobile Broadband connection that you may have already created (right click on the network icon in the top desktop menu, select Edit Connections..., go to the Mobile Broadband tab and then delete your connection).

Now configure wvdial and gnome-ppp:

gnome-ppp

Select the Setup button and then Detect you modem (make sure your mobile phone is plugged in to the laptop). It may take some time or multiple attempts to detect - mine eventually found the modem at device: /dev/ttyACM0. Yours may be slightly different.

Close the Setup window and you are returned to the main Gnome PPP window. For my service provided (AIS - see the details) I require the information:

  • Username: internet
  • Password: internet (in fact, I think the password doesn't matter)
  • Phone number: *99#

Then Connect and after some time the connection is established. Open your web browser and you should have Internet connectivity!

Becoming a Monk during Songkran

After our trek up Khao Sam Yot in the morning, on Monday afternoon a party was held for a neighbour that was about to become a monk. It is common for young guys to enter the monkhood, at least for a couple of weeks. Before he enters everyone in the village gives him some sort of farewell party. He sat on the back of a pick-up with a few elder people and they slowly drove from his home around the village. There were probably close to 100 people following on foot as they left his home and passed Wan's home (about 50m away). At the tail of the procession was another pick-up truck loaded with a 2 metre wall of speakers blaring popular music. Everyone was dancing, drinking and soaked with water. As they passed each house the inhabitants would throw buckets of water on the procession and then join in.

I think a combination of extra long public holidays (many young people returned home to their village), Songkran (throwing water on everyone) and the guy becoming a monk made this one big, fun party. Sort of like a mini festival. However, like the Big Day Out or the hill at the cricket, take a a group of young men drinking in a summer festival atmosphere and eventually there will be a fight. The crowd of young children through to grandparents quickly dispersed to the nearby houses as the pushing and shoving started. There were some punches thrown but nothing too wild. For most people that ended the party - we walked about 75m home - although I guess the monk to-be continued on to the wat.

It turned out there were similar street parties in the following days, but in these cases it was a group of people making an offering to the local Wat. They were much smaller (50-100 people), but still good fun. I joined one and managed to make it to the Wat this time (despite a fight breaking out on the way). Unfortunately there are no pictures as I didn't want my camera to get soaked.

Khao Sam Yot

Khao Sam Yot, Phu Pa Man
This morning was the first real day of exercise. We trekked up Khao Sam Yot ('Three Peak Mountain' in Amphoe Phu Pa Man) at about 10:30am. Over New Years I went up to the first lookout, which took about 45 minutes from the bottom temple/car park. This time we drove up to the top temple, saving about 20 minutes walking/climbing, and walked all the way to the Buddhist lookout near the top of the mountain. It took about 90 minutes. The trek is not too hard, however the temperature of 35+ degrees meant I was drenched with sweat within the first 5 minutes. As we got close to the lookout the track become a set of ladders and platforms, partly made of bamboo. The lookout is set on the face of the mountain and looked slightly dangerous, but we ventured forward. In fact there is a large cave where the lookout is built, with several statues of Buddha inside, as well as more ladders up inside the cave to a room for the monks. It was a peaceful location, with an excellent view of the nearby villages.

After some snacks and photos we made our way down. I thought it was easy until I slipped. Some grazed arms, sprained fingers, bruised bum and nervous legs for the rest of the way down was the outcome. Although that dampened my spirit a bit, it was worth it. It is nice to explore the various mountains that create the valley containing 5 or 6 villages in the area.

Photo gallery

Mobile Broadband on Ubuntu 9.10 Not Working

Going away for a couple of weeks I had planned to use the mobile phone tethered to the laptop for occasional Internet access. I had used it once or twice before, and although only EDGE (not 3G), it is good enough to check email, browse some news and check some tourist. As an aside, 3G mobile Internet is a contentious issue in Thailand, with very little UMTS coverage, including in Bangkok, provided by the popular operators AIS and DTAC. There has been a prolonged decision about awarding spectrum licenses I guess mainly because of the business and political conflicts between the two government telcos, CAT and TOT, and the commercial operators, AIS, DTAC, and True.

Anyway, I was foolish enough to assume the mobile broadband access would work when I got to Chumphae, without testing before I left home. Of course, it didn't, and I'm guessing that it is something due to my upgrade of Ubuntu from 9.04 (when it worked) to 9.10 (now it doesn't). When I plug my phone in to the laptop (via USB), it is recognised and the nice wizard for creating a new Mobile Broadband connection allows me to select my network operator (AIS). However when I connect, the Network Manager almost immediately reports GSM Disconnected - You are now offline. I do have Internet access on the mobile where I can browse some sites, so I checked some Ubuntu forums, but haven't found a solution yet. I will diagnose the problem when I get home, and post more, including my thoughts on Ubuntu "upgrades".

Update: I worked out how to fix this - see my solution.

Wan's Grandfathers Funeral

Wan's Grandfathers funeral
With the long Songkran holidays coming up (public holidays from Tuesday 13th to Friday 16th April and 1 days annual leave to make a 9 day holiday), we decided to head back to Wan's home near Chumphae for the week. However Wan's grandfather passed away on Thursday so she went home early (she had only been in Bangkok for a few days after returning home for her grandmothers funeral in March), and I drove up today to catch the last days of the funeral.

The funeral involved about a week of Buddhist rituals at his home, although he was buried on Saturday. A few photos of the funeral.

Thai Drivers License in Pathumthani

Today I finally got my Thai drivers license. For the past two years I've been driving with my Australian license with an International Driving Permit. The permit only lasts one year (I was lucky enough to be back in Oz to renew it last year). Driving with the permit is legal and hasn't caused me any problems. The 4 or 5 times I've been stopped at check points, the police have not had any queries about it. However both my Australian license and permit are due to expire soon, which motivated me to go through the steps to get the Thai drivers license. Here's what I had to do.

Documents Required

As I have a valid International Driving Permit, there is no need for a (written or practical) driving test. The procedure for getting the Thai license is taking the correct documents to the Department of Land Transportation (DLT), completing a colour-blindness, reaction and depth perception test, and thats it. The Driving in Thailand website gives an excellent run-down of what is needed. This is what I took:

  • Australian license and International Drivers Permit. They both must be valid. You need the orignal plus 1 signed photocopy of each.
  • Work permit, as a verification of my address. Photocopies of the pages with printed information about you (address, employer etc.)
  • Passport and photocopies of: personal details, the white arrival card, latest entry stamp, and current non-immigrant visa stamp.
  • Health certificate. I got mine at Krung Siam St Carlos Medical Centre on the weekend. It cost 160 Baht and the checkup involved: a sight test (the typical read a row of numbers with one eye shut); colour-blindness test (read a number, printed in dots of one colour, surrounded by dots of another colour); measure of blood pressure, weight and height; and a question from a doctor if I suffer from epilepsy. In total, they took about 15 minutes, plus a good hour and a half waiting.
  • A translator (Wan was nice enough to come with me)

The signed photocopies of all the documents (except health certificate) are necessary. The people at the DLT mainly looked at the copies, not the originals.

Photos are no longer needed - they take a digital photo of you there and immediately print it and attach to your license.

Getting to the DLT in Pathumthani

There are in fact two DLT's in Pathumthani. The main office in Lat Lum Kaeo, and another office in Klong Luang. Some friends had been to the office at Lat Lum Kaeo, and so I decided to go there. (Out of interest, the office in Klong Luang is, according to these two posts, at the Inland Container Depot in Klong 4. It can be reached by going east on Klong Luang Road until the Eastern Ring Road, but going left along a local road. Although I haven't been yet, I think this is it on Google Earth).

To get to the DLT in Lat Lum Kaeo, travel west on Pathumthani-Rangsit Road (number 346), crossing the Chao Praya river. About 3km from the Chao Praya river is a set of traffic lights at a T-junction. Go right (left takes you into the main business district of Pathumthani town), and then turn right at the next set of a traffic lights (this 2nd set of lights are 5km from the Chao Praya river). The DLT is on this small soi: there is a government building about 200m on the right which is NOT then DLT; another 200m is the DLT on the right (there are some small food and copy shops on the left). See the map below or the find it on Google Earth.

Map to Department of Land Transportation, Pathumthani

Getting the License

Inside the building is where the translator first becomes useful. We arrived a bit after 9am, and the car park was already almost full and there were quite a few people inside. All signs are in Thai. The license centre is upstairs on floor 2. There are about 6 numbered windows/booths, a couple saying One Stop Service in English, all other signs in Thai. We were directed to window 5 and proceeded as follows:

Received the application form from Window 5. The form is in Thai - the 2nd reason for a translator. It asks for name (in English and Thai), age, nationality, passport number and a set of tick boxes which I still don't know what they mean. Fill it in and return to Window 5.

Behind the booths are some people getting there photo taken and doing sight tests, as well as a small room labeled E-Exam. We were directed there. There were a few people in line and being processed quite quickly. As I approached the woman, who turned out spoke ok English, showed me a single colour-blind test sheet. This was the same as at my health checkup, except only one number (health checkup had about 10) and the same number as the previous guy - I could have just repeated his answer. She then directed me to the other test area (next to all the computer terminals for the written test).

Supposedly a reaction/reflex and depth perception test is required. Four applicants sat waiting for about 20 minutes for a tester to come. There was a seat with accelerator and brake pedal in front of it, and then 6 or 7 metres away a box with green light and a 30cm vertical ruler with a thick line marked on it. You put your foot on the accelerator and after a few seconds some green LEDs start lighting up along the ruler. Once they turn red you must push the brake pedal (before the red lights hit the thick line - less than 1 second). The first guy pushed the brake before the red lights came on - a couple more tries and he got it right. The next older guy, didn't hit the brake before the red LEDs hit the marked line or the top. But he got it close after another try. The third guy was successful, then on my turn I was too slow, slightly going passed the marked line. But before I got a chance at the 2nd attempt, the tester had already ticked all my tests (including, I guess, the depth perception that no-one else did either) and sent me back to window 5.

The lady at window 5 looked at my documents quickly again, return them and a number to me and told us to wait 'over there'. This is the part I hate about such places (in any country). There are people, queues, tests every where. Which line do I wait in? Even the translator didn't help this time: Wan asked another lady where and she sent us into a waiting room, which ran an instructional driving video, as about 30 people wait. It took as 25 minutes before we realised that the people waiting didn't have the number I did - they were outside.

Once I got in the correct queue (of 2 people), the next woman looked closer at my documents, entered in my details and I paid 205 Baht. Then a photo. 3 minutes later my Thai license was produced and we were finished.

It took less than 90 minutes in total. It would've been about 1 hour if I got in the correct queue. That is very good service, and I'm not too concerned about going back in a 1 years time to get my real license. This one is just temporary.

Printing on Canon LBP3370 using a HP Driver in Ubuntu

At work we have a new Canon LBP3370 laser printer. Most of our other printers have been HP, and printing from Ubuntu Linux has been relatively straightforward. HP have very good support for printing in Linux through the HPLIP software. My HP multi function printer (including scanning) at home works fine with Ubuntu. However I had some problems with the Canon printer, especially printing PDF. Below is the original configuration in Ubuntu of using the Canon driver, and then the way I fixed the problems by using a HP driver.

Using the Canon Driver

When adding a printer in Ubuntu 9.10, I followed the steps of selecting 'Canon' and then 'LBP-3360' (the LBP-3370 is not listed) which gives the option of four drivers:

Canon LBP-3360 Foomatic/pxlmono [en] (recommended)
Canon LBP-3360 Foomatic/lj4dith [en]
Canon LBP-3360 Foomatic/ljet4 [en]
Canon LBP-3360 Foomatic/ljet4d [en]

As was suggested, I choose the pxlmono driver. Note that the LBP-3370 uses direct sockets printing (the device URI is 'socket://IP'). Unfortunately I had several problems when printing (mostly PDF - not sure if it also applied to other formats). Firstly, sometimes the first page of the PDF would print and then an error message would be printed (on the paper):

PCL XL Error
  SubSystem: IMAGE
  Error: MissingData
  Operator: ReadImage
  Position: 8644

And then some documents were taking a loooong time to print (5-10 minutes per page).

Fixing with the HP Driver

A quick search at OpenPrinting indicated that the driver I selected may not be reliable. It suggested using the hpijis-pcl5e driver instead (surprise, surprise - a HPLIP driver). So I downloaded the driver directly, saved it in /etc/cups/ppd/ and selected it from the printer Properties (under "Make and Model" select "Change" and then "Provide PPD file"). The result is shown below (note the "Make and Model").



For the past few weeks printing to the Canon printer using the HP driver has been trouble free. Nice job HP!

Syndicate content