Ubuntu 9.04: Skype issues

This article addresses an issue similar to another that I have already adressed for Ubuntu 8.04: How to correctly configure Skype on Ubuntu 9.04.

First, I assume that Skype was installed from midibuntu.org repositories.

Issue 1: Speakers do not work.

The first required configuration change is setting Skype to use Pulse Audio Support instead of default (ALSA) sound drivers. Go to Skype->Options->Audio Devices. Select “pulse” for all audio devices.

I also recommend to disable an option like “Allow Skype to automatically adjust mixer levels” for this first moment. While this option was enabled, I have experienced Skype undoing the correct configuration and turning off my microphone volume before each call . After you manage to have Skype working fine, then you may enable this option again to see if Skype continues working fine :-)

Issue 2: Voice gets delayed or cut.

There is a known issue where Skype overloads CPU while the microphone records from the Pulse Audio Support. Voice gets heavily delayed (eg. more than 60 seconds). You need to switch the microphone device to another but not “pulse” nor “alsa”. Try selecting the entry that describes your microphone hardware. You may need to take several tries until you find out the device that really maps to your microphone. Fortunately, you can play around during a test call, if you always press the “apply” button. On my desktop, the correct option is called “Intel ICH5 (hw:ICH5,0)”.

Ubuntu 9.04: Microphone issues

Continuing the discussion of audio configuration issues on Ubuntu 9.04…

If you are using Skype, please also read my next article that discusses Skype on Ubuntu 9.04.

I suggest testing the microphone with the “Sound Recorder” that is found in the “Applications”->”Sound and Video” menu of the top bar on the Ubuntu desktop. Ensure that “voice, lossless (.wav)” (may vary according to your language) is selected. Click on “Record” and talk to the microphone. The “Level” bar should increase as you talk louder. Click on “Stop” and “Play” to hear if your voice was recorded sucessfully.

Issue 3: Microphone does not work

Solution: Enable the microphone capture. Right-click the volume icon on the left of the top bar on the Ubuntu desktop and select “Mixer” or “Volume Control” (may vary on according to your language). The mixer dialog opens. Click on “Preferences” to open the preferences dialog, enable “Microphone” and “Microphone Capture” and click on “Close” to return back. Move the “Microphone” slide up, ensure button underneath the slide is not “muted”. On the “Switches” tab, enable “”Microphone Capture”.

Issue 4: Microphone is too quiet

Solution: Raise capture volume. Back to the mixer dialog, click on “Preferences” to open the preferences dialog, enable “Capture” and click on “Close” to return back. On the “Recording” tab, move the “Capture” slide up, ensure button underneath the slide is not “muted”.

Issue 5: Is still too quiet

Solution: Enable the microphone boost. Back to the mixer dialog, click on “Preferences” to open the preferences dialog, enable “Mic boost +20dB” and click on “Close” to return back. On the “Switches” tab, enable “Mic boost +20dB”. If microphone becomes too lound or too noisy, just disable this option again.

Ubuntu 9.04: External and internal speaker issues – part 2

If you run Ubuntu 9.04 and your desktop or laptop is featured with both internal speaker and TRS jacks for external speakers, then you might face some issues that sound is played on both. I have written some articles where I propose some very simple solutions and you may try them and choose the one you like most.

Issue 2: Connecting the headset does not turn off internal speaker.

Try to connect/remove a headset from the external jack and observe if your internal speaker becomes automatically muted. If not, then some more configuration is required.

Solution 1: Previously, I explained how to display the “Master mono” and “Headset” slide bars. Slide down the “Master Mono” and click on the “Mute” button underneath this bar. This will completely disable the internal speaker (until you un-mute it again and raise its volume slide bar).

Solution 2: Right-click the volume icon on the left of the top bar on the Ubuntu desktop and select “Mixer” or “Volume Control” (may vary on according to your language). The mixer dialog opens. Click on “Preferences”. Enable “Headphone Jack Sense” (eventually you will need to scroll down the list to see this option). Click on “Close”. The previous mixer dialog should now display a “Switches” tab. Click to open it and you will see the “Headphone Jack Sense” switch. Whenever you want the internal speaker to mute automatically when an external speaker is connected, just enable it.

Actually, I use to enable it once and leave it enabled forever…

Ubuntu 9.04: External and internal speaker issues

If you run Ubuntu 9.04 and your desktop or laptop is featured with both internal speaker and TRS jacks for external speakers, then you might face some issues that sound is played on both. I have written some articles where I propose some very simple solutions and you may try them and choose the one you like most.

Of course, I discarded any inappropriate solutions that were proposed in several forums: editing mysterious configuration files,recompiling the kernel and unplugging the internal speaker from the motherboard.

There are much simpler approaches. First, let play some of your favorite songs to observe if the proposed changes really reflect the audio configuration.

Issue 1: Does master volume really work?

Click on the volume icon that uses to be placed on the right of the top bar on your Ubuntu desktop. Slide the bar and observe if music gets more or less louder. If nothing happens, then there will no common control for both internal and external speakers, unfortunately.

Solution: Right-click the volume icon and select “Preferences”. Ensure that the first line display the option that contains “Alsa Mixer”. Then select “Master mono” or “Headset”. Now the slide bar will control the volume of your internal or external speaker. It will control only one of them, but not both. It is not ideal, but less inconvenient than controlling nothing. If you now a better solution, please leave me a note.

Right-click the volume icon and select “Mixer” or “Volume Control” (may vary on according to your language). The mixer dialog opens. Click on “Preferences”. Disable “Master”. The master volume slide bar will disappear. Ensure that “Headset” and “Master mono” is enabled. Now you might control the volume of both internal and external speaker independently through the mixer dialog. Just note that if your have an external speaker connected to the external jack, then the slide bar for “Headset” is actually changing volume of your speaker.

Regex that matches path, filename and extension

I was looking for a regular expression for Python capable to match a string containing a valid path, file name and extension. Finally, I discovered following solution:
Let me explain how I got this regular expression. Fortunately, Scott Carpenter has written an excellent article about a regular expression to match a file name with extension. Matching the file name extension is not trivial for all possible situations.

Read more of this post

Skype on Ubuntu 8.10: microphone and internal speaker issues

It has been a long time since my last post… Also, it has been some time I managed live without a PC and Internet. Now I have a PC and Internet again and I took the chance to immediately install Linux!

Updated: I also solved the issue of skype consuming 100% cpu during a call.

Although the Ubuntu Guide has a good description how to install Skype on Ubuntu Intrepid, it can be quite challenging to place a call successfully. Shame on Gnome, Pulse Audio and Skype! I had to overcome following issues:

  • No audio on skype, or Skype complaining that sound device does not work.
  • No microphone input during calls.
  • Call also audible from the internal speaker (even when headset is connected to the green audio jack).
  • Skype consuming 100% cpu during the call and Skype delaying audio over 60 seconds!

Here is the solution that worked for me.

Read more of this post

Resume scp/rsync file transfer

This is very basic Linux knowledge, but the question has arisen too often and I decided to document it.


Transfer (or upload/download) a large tree of files and directories from one machine to another using a ssh connection, and being able to resume/continue if the operation is interrupted.


Until now, I believe that the best solution is using rsync over ssh, since rsync has a feature to resume interrupted file transfer, even when an entire tree of directories is involved.

Command line:

rsync -vrlPtz -e ssh host:/remote_path/* /local_path/


-e ssh rsync will use ssh client instead of rsh
-z compress file transfer
-t preserve time (other attributes as owner or permissions are also possible)
-l copy symlinks as symlinks
-P resume incomplete file transfer
-r recursive into subdirectories
-v verbose
Optionally, you may also add following options, that make sense only if both machines have the save user name space:
-p preserve permissions
-o preserve owner
-g preserve group

About Trilead SSH open source project

Some time ago I have written an article about the JSch open source project. However, I soon lost all my motivation when I faced, again, the code complexity required for JSch just to start a execution session, a file copy or a port forwarding with JSch. Nevertheless the completely misunderstood authentication API for JSch let me to a mood even worse. I started looking for alternatives and fortunately I found Trilead SSH, a pure Java implementation of SSH, available with the BSD license.

I have not yet tested Trilead SSH extensively to state that it provides a stable and complete SSH implementation. But results were very promising. Unfortunately, I have not much information about performance of data transfer with Trilead SSH.

I think that the major advantage of Trilead SSH is its very simple and intuitive API, directly targeted to tasks that shall be solved for someone that is using SSH. Everything is made very easy: execute a command, do port forwarding, transfer files. All complexity is done behind the scenes and a single method call uses to be enough. There is no need to care about SSH details as it was required for JSch.

In special, I liked the Trilead SSH API resposible for authentication that is very straightforward and matches very well the steps to log into the remote host. Even better, I was able to implement my own logic to respond to authentication failure exactly to the application needs. In this situation Trilead SSH is simplier and more flexible that JSch.

As a drawback, it is not possible to have low level access to the SSH protocol. However, this seems to be a very improbable requirement.

Depite of the simple API, Trilead SSH claims to implement all major ssh features: sessions (remote command execution and shell access), X11 forwarding, local and remote port forwarding, local stream forwarding, SCP and SFTP. Many options are available for authentication methods and cipher types.

The API is very well documented and includes examples and advices, what is very rare on a typical javadoc.


Replacing JSch by Trilead SSH has been a good choice, although I have not yet evidences for better performance nor stability. But the code become considerable simpler and shorted. And development time was reduces many times.

PCMan: the real and true Gnome file manager

I have modified this post after several people complained that I was misunderstood: Nautilus can, sure, display a tree view of the file system. Sure, but only for “who-knows-how”.

I do not like Gnome desktop environment because of its excessively simplified GUI that leverages all users as if they lack minimal skill to interact with a computer. And what I dislike most on Gnome is even more oversimplified vision of the file system provided by Nautilus on its default configuration.

Please, the converse is not true: I do not love KDE. And even more disappointing was seeing KDE 4 abandoning its advantages over Gnome just to become similar to Gnome (after a while, KDE 4 will not have anymore its nice power-user features, nor the nice simplicity of Gnome).

Specially annoying is the “Spatial Navigation” that opens a new window for each folder that is accessed (although real [wo]men would call it “directories”). As soon you have more than a bunch of directories, navigating from one to other will open more and more windows on your desktop just to drive you crazy.

Sure, Gnome developers will explain that a typical user will not own more than a hand full of files. And, they will store everything on the same folder like “documents” or “images” (or even on the desktop leading to the result of the picture on the right). They

Screenshot from a user that stores all documents on his desktop folder

Screenshot from a user that stores all documents on his desktop folder

will never store their files in a secure separated partition, nor on a file system over the network. Just in the case that the amount of files gets out of control, the user will create one or other subdirectory here or there. Therefore, subdirectory navigation is not necessary and it is reasonable to display the content of all directories at the same time.

By the way, Nautilus also claims to support file system browsing. Just click “browse” instead of “open” is what they say. However, there are some issues to consider. The “browsing” features are not visible by default. And a feature that is not visible, or that is very difficult to find, in practice, is not a feature at all. There is no preference where the user can easily choose which configuration he prefers. Googling around shows very few references about “nautilus tree view”. Asking experienced Gnome users was of nearly no use.

After reading the entire Nautilus documentation and after getting some good advices from people that read this article, I understood how. The user needs to start Nautilus with the –browse parameter on command line, open any folder with the “browse” command, then go back again to original folder. The, the user needs to display the side pane and select to tree visualization on this pane (it took a while how to figure out that I can change the content shown by the side pane).

Finally, one will be able to see the directory hierarchy and be able to jump to sibling directories. It is possible only to go to/from parent and child directories.

Fortunately, I discovered an alternative that allows the real and true file system browsing. It is called PCMan File Manager, and stays a bit hidden on most Linux distros. At the beginning, it provides an appearance familiar to Nautilus, and understands the same pre-defined folders like “documents” or “images”. However, after a short time of use, one will soon discover the power-user features that are available.

PCMan claims to be extremely fast and lightweight. I do not think this matters most, compared to the features it provides. It has a sidebar with useful and organized common locations and mount points. The sidebar may also display a complete tree view of the file system. Tabbed browsing is also supported.

I liked most that each tab has its own tree view. It was really annoying on KDE/Konqueror that the tree view did not always match the focused tab. The tree view is completely absent in Nautilus. Also I like the organized common locations and mount points. Although Konqueror has something similar, it is not as organized and as useful as it is on PCMan.

Also, there are features I still need to get better acquaintance: mounting/unmounting/ejecting media within PCMan. I really dislike having an icon for storage devices on the Gnome/KDE desktop while not being able to see and manage them within Nautilus/Konqueror.

Other nice feature is opening a directory as root, avoiding the need to switch to a terminal or to log-in as a different user.

However, I was not able to open and browse very large directories, like /usr/bin, as promised by PCMan web site.

Fortified compiling prevents building older RPM

Today I had to build and test some older Open MPI RPM packages. However, I was prevented to build them, although the code apparently was correct.

The command:

rpmbuild -ba openmpi-1.2.1.spec

The error message was:

In function 'open',
    inlined from 'orte_abort' at runtime/orte_abort.c:91:
/usr/include/bits/fcntl2.h:51: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments

The line of source code that causes the error is:

fd = open(abort_file, O_CREAT);

After some research, I discovered that the source code is correct. But nowadays, newer versions of gcc do additional security checking that were not available that the time the code was written.

For security reasons, calling open with O_CREAT and only two parameters is not acceptable anymore.

In order to build the RPM, I would either need to change the SPEC file or the src.rpm package, or find out a build options for rpmbuild that turns off further code protection.

First, I changed the the src.rpm package, chaning the problematic line to:

fd = open(abort_file, O_CREAT, 0666);

Then, I confirmed that it is also possible to pass additional parameters to rpmbuild in order to turn off code protection:

rpmbuild -ba openmpi-1.2.1.spec --define 'configure_options CFLAGS=-D_FORTIFY_SOURCE=0'