Monday, September 17, 2007

Encode MP3s in Ubuntu

The default Ubuntu install includes an application called Sound Juicer for use in encoding cd audio. However by default Sound Juicer cannot encode in MP3 format; this post explains how (at least for Feisty).

First, install this package:


If this package is not found, be sure you have enabled the Multiverse and Restricted software repositories and try again.

Next, after installing the above package, launch Sound Juicer. Click Edit -> Preferences. Next, click on the Edit Profiles button.

Click New. A new window will appear. (Note that on my system none of the fields in this new window can be edited until the Edit Profiles window is closed. So if this is the case for you go back to the Edit Profiles window and click Close.)

Add this text to the following fields:

Profile name: MP3
Profile desc: Encode to mp3 format.
GStreamer pipeline: audio/x-raw-int,rate=44100,channels=2 ! lame name=enc mode=0 vbr=0 bitrate=256 ! id3v2mux
File extension: mp3

This will encode audio files to mp3 format at a constant bitrate of 256; change this number to what suits your needs.

Next, check the Active button, then click Close.

Now back in the Preferences window you should see the MP3 profile in the Output Format dropdown.

Happy encoding.

Sunday, September 16, 2007

Video Resolutions under Ubuntu Remote Desktop

This post explains how to increase/expand the desktop size to match the working resolution of the remote client even if this resolution is higher than that of the server's video hardware.

The setup is Ubuntu Feisty 7.04 with Gnome Remote Desktop enabled, running on a Panasonic Toughbook (max LCD resolution of 1024x768), accessed by a desktop system operating at a resolution of 1280x1024. (UPDATE: this worked for me with xserver-xorg-core-1.2; this no longer works for me after upgrading to xserver-xorg-core-1.3.)

(FYI: The default Remote Desktop software in Ubuntu 7.04 is Vino, which is running with the xrandr extension. Remote Desktop is enabled via System -> Preferences -> Remote Desktop.)

X Windows has provisions for allowing desktop resolutions beyond which the server's hardware can support. These resolutions are called Virtual Resolutions, as rather than they being true hardware resolutions are instead represented in a simulated sense within the software.

On the Remote Desktop server, edit the xorg.conf file and locate the Display subsection matching that which the Defaultdepth is set to. Add the following line after Modes:

Virtual 1280 1024

Where the numbers represent the resolution which you want to use when connecting via Remote Desktop. (Note the absence of an 'x' between the numbers, this is intentional; adding an 'x' will result in the failure of X-Windows to launch.)

This section should now read something similar to the following:

SubSection "Display"
Depth 24
Modes "1024x768" "800x600" "640x480"
Virtual 1280 1024

Restart X Windows. Check for the new virtual resolution in the list at System -> Preferences -> Screen Resolution. Select the new virtual resolution; the desktop will now be larger than the monitor can display, though the entire desktop can be panned by moving the mouse in the appropriate direction.

Next connect to the Remote Desktop server. The resulting display on the client should be the entire desktop shown at the full virtual resolution. (Note that the screen resolution of the server can also be updated from within the Remote Desktop session.)

My main development system is the laptop described above. I mainly use it in a docked configuration, though I also take advantage of the portability and work offsite. Lacking a dock at home, I instead use Remote Desktop to connect to the laptop. The above solution allows me to run the Remote Desktop session to take advantage of the full resolution of my desktop computer and not be limited to that of the laptop's video hardware.