Pulseaudio/Flash issues in Ubuntu Hardy… solved at last?

18/08/2008

There have been some right problems with Pulseaudio and Flash in Hardy.  Youtube videos playing with no sound… Firefox freezing and crashing… it’s been a right pain in the ass.

But it seems these issues may have been resolved.  Psyke83, an Ubuntuforums.org member, posted what appears to be a definitive fix here.  This howto enables you to use Pulseaudio and Flash 10.  Something I’d begun to fear might never happen…

Now, I only just enacted this fix on my machine, and I have yet to give it a proper testing on a variety of video streaming sites and music formats and so on.  But it does look promising – right away I’ve noticed how less buggy Firefox seems…

Anyone who’s been suffering Pulseaudio/Flash problems in Hardy: follow the instructions in psyke83’s guide, then please post here your experiences.


Some Common Linux Commands

16/07/2008

Linux has a well-developed graphical user interface – in fact it has several GUIs, the most popular of which are Gnome (on which Ubuntu is based) and KDE (Kubuntu‘s desktop).  But Linux also has a powerful command-line interface – also known as the console or terminal – and a great many commands to use in the CLI.

Here’s a little “cheat sheet” of common, basic Linux commands – just to get you started – you’d be wise to study this subject further if you’re serious about administering a Linux box.

Moving around in the file system
Command Action
pwd “Print working directory” – show what dir you’re in.
ls List the contents of a dir.
ls -l List the contents of a dir and show additional info of the files.
ls -a List all files, including hidden files.
cd Change directory.
cd .. Go to the parent directory.
Examining files
Command Action
file Determine the type of a file.
cat Concatenate a file.
less View text files and paginate them if needed.
Manipulating files and directories
Command Action
cp Copy a file.
cp -i Copy a file and ask before overwriting.
cp -r Copy a directory with its contents.
mv Move or rename a file.
mv -i Move or rename a file and ask before overwriting.
rm Remove a file.
rm -r Remove a directory with its contents.
rm -i Ask before removing a file. Good to use with the -r option.
mkdir Make a directory.
rmdir Remove an empty directory.

Linux Tutorial: How to use a cellphone as a modem

15/02/2008

avatar666.pngavatar666.pngavatar666.pngavatar666.png

Note: There is more up-to-date info on this subject, especially concerning mobile broadband HSDPA modems and 3G cellphones, to be found here. But the info on this page is still relevant. In particular, this page covers the program wvdial, which can be used if your network manager doesn’t detect your HSDPA modem.

I learnt how to connect to the internet through my cellphone because it was the only way I could get online from my home – at the time I was living in a flat where I wasn’t permitted to have a regular phoneline installed. And I still sometimes find it useful: if I’m out and about with my laptop, and I can’t find a wifi “hotspot” to use, I can generally get a GSM signal – in the UK it’s possible to get a signal in just about every urban area, and in a lot of rural areas too – and a GSM signal means you can connect to the internet via GPRS.

Some mobile service plans charge for internet access on a per MB of transferred data basis. This can turn out very expensive, as there is a lot of data transferred during an internet session. Especially if you download a 3 GB movie DVD!! However, many mobile plans charge a set fee for unlimited net access. My mobile provider, Orange, charge me £1 for one day’s unlimited access or £5 for a week’s access. And I believe in the USA it’s much cheaper.

So how do you use a mobile phone as a modem? With Windows, I haven’t got a clue. But with Linux, you establish a PPP connection with the mobile service provider’s servers, by using a dialler like wvdial. Wvdial comes included with a default installation of Ubuntu (my particular distro) and probably other Linux flavours too.

Connect your phone to the computer. I do this with a USB datacable that came with the phone, but some people use Bluetooth. The phone should be ON. My phone is a Sony Ericsson – when it’s linked to the computer, I have to choose between File Transfer and Phone Mode. To use the phone as a modem, I have to select Phone Mode. However, I sometimes use a Nokia phone, and there’s no mode-choosing necessary with that model.

Open a terminal and get yourself root status. Then type in the command

wvdialconf

This will cause wvdial to scan the computer for modems. You’ll get output something like this:

root@x-box:~# wvdialconf

Scanning your serial ports for a modem.

ttyS0<*1>: ATQ0 V1 E1 — failed with 2400 baud, next try: 9600 baud
ttyS0<*1>: ATQ0 V1 E1 — failed with 9600 baud, next try: 115200 baud
ttyS0<*1>: ATQ0 V1 E1 — and failed too at 115200, giving up.
Modem Port Scan<*1>: S1 S2 S3
WvModem<*1>: Cannot get information for serial port.
ttyACM0<*1>: ATQ0 V1 E1 — OK
ttyACM0<*1>: ATQ0 V1 E1 Z — OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 — OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 — OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 — OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK
ttyACM0<*1>: Modem Identifier: ATI — Sony Ericsson W300
ttyACM0<*1>: Speed 4800: AT — OK
ttyACM0<*1>: Speed 9600: AT — OK
ttyACM0<*1>: Speed 19200: AT — OK
ttyACM0<*1>: Speed 38400: AT — OK
ttyACM0<*1>: Speed 57600: AT — OK
ttyACM0<*1>: Speed 115200: AT — OK
ttyACM0<*1>: Speed 230400: AT — OK
ttyACM0<*1>: Speed 460800: AT — OK
ttyACM0<*1>: Max speed is 460800; that should be safe.
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK

Found an USB modem on /dev/ttyACM0.
/etc/wvdial.conf<Warn>: Can’t open ‘/etc/wvdial.conf’ for reading: No such file or directory
/etc/wvdial.conf<Warn>: …starting with blank configuration.
Modem configuration written to /etc/wvdial.conf.
ttyACM0<Info>: Speed 460800; init “ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0”
ttyACM1<Info>: Speed 460800; init “ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0”
root@x-box:~#

[Note: I’ve edited the output, to cut down on its length.]

Wvdial found my cellphone (“Modem Identifier: ATI — Sony Ericsson W300”), and reports that the phone is on port ttyACM0.

Then wvdial created a configuration file (/etc/wvdial.conf) and put some config info about the phone in it.

Edit /etc/wvdial.conf with your mobile service provider’s information. When I ran wvdialconf, the program created a wvdial.conf file as below:

root@x-box:~# cat /etc/wvdial.conf

[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
; Phone = <Target Phone Number>
ISDN = 0
; Username = <Your Login Name>
Init1 = ATZ
; Password = <Your Password>
Modem = /dev/ttyACM0
Baud = 460800

The program filled in some fields, but some have been left for you to do: specifically, the info needed to log in to your mobile service provider’s web servers. I edited the file to look like this:

[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
Phone = *99#
ISDN = 0
Username = A
Init1 = ATZ
Password = B
Modem = /dev/ttyACM0
Baud = 460800
Stupid Mode = Yes

The number in the Phone field is the number that the phone needs to call to access my mobile provider’s GPRS service. Your mobile network may use a different number – you’ll have to ask them.

My mobile network does not require usernames and passwords to access the web servers. But wvdial doesn’t like empty fields. So I put “A” and “B” in them.

I added the last line: Stupid Mode = Yes, otherwise wvdial will simply cycle when run without ever connecting.

*IMPORTANT* All the output recreated above is from a system that did not have any other modems connected. Most laptops have a modem or network card built-in, which wvdialconf will detect. But you’ll be able to see what information relates to your phone, and edit your wvdial.conf file accordingly.

So, now you can connect to the internet. To do this, open that terminal and, as root, type in the command

wvdial

You’ll get output like this:

root@x-box:~# wvdial
WvDial<*1>: WvDial: Internet dialer version 1.56
WvModem<*1>: Cannot get information for serial port.
WvDial<*1>: Initializing modem.
WvDial<*1>: Sending: ATZ
WvDial Modem<*1>: ATZ
WvDial Modem<*1>: OK
WvDial<*1>: Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
WvDial Modem<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
WvDial Modem<*1>: OK
WvDial<*1>: Modem initialized.
WvDial<*1>: Sending: ATDT*99#
WvDial<*1>: Waiting for carrier.
WvDial Modem<*1>: ATDT*99#
WvDial Modem<*1>: CONNECT
WvDial Modem<*1>: ~[7f]}#@!}!}!} }8}#}$@#}(}”}’}”}”}&} } } } }%}&}$AUSgn~
WvDial<*1>: Carrier detected. Starting PPP immediately.
WvDial<Notice>: Starting pppd at Wed Jan 16 15:45:03 2008
WvDial<Notice>: Pid of pppd: 10689
WvDial<*1>: Using interface ppp0
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: local IP address 172.23.108.122
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: remote IP address 194.33.25.101
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: primary DNS address 193.36.81.37
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: secondary DNS address 193.36.81.38
WvDial<*1>: pppd: ��[06][08]��[06][08]

The program will appear to “hang” – the above text will just freeze on the monitor. But wvdial is actually holding the connection open until you terminate the link by hitting Ctrl-C.

Now you can use the connection by, for example, starting up your web browser; or open another terminal and run telnet or ssh, or do whois or ping commands. All these activities will run a lot slower than you’re used to – but they will run.

When you’re finished, hit Ctrl-C and wvdial will end with a closing message like this:

Caught signal 2: Attempting to exit gracefully…
WvDial<*1>: Terminating on signal 15
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: Connect time 0.8 minutes.
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: Disconnecting at Wed Jan 16 15:45:50 2008
root@x-box:~#

Data connections via GPRS over GSM are very slow – mine often average about 5 K/sec. But 3G/UMTS is much faster. Nowhere near the performance over a landline, of course, but 3G will probably be the best bet. However, be warned: some mobile providers don’t like their customers to link to the internet this way, and I’ve been told that 3, a UK company, actively prevent it. Their customers can pay extra to get a GPRS modem, but linking a normal cellphone on a standard plan is not permitted. Tmobile also don’t like their customers to use their phones as modems. So beware! Or, better yet, use a network that doesn’t have such stupid rules!!

_gos=’c4.gostats.com’;_goa=354450;
_got=2;_goi=2;_goz=0;_gol=’Free hit counter’;_GoStatsRun();
Free hit counter
Free hit counter


%d bloggers like this: