Multimedia on Ubuntu

Who knew playing a DVD would be so hard?

After getting nearly everything working the way I liked in Ubuntu 9.10 I decided to relax and watch a DVD to celebrate. Unfortunately, my celebration was stopped in its tracks because Ubuntu failed to mount the DVD. BTW, “mount” is the linux term for “load”, and they use “unmount” instead of “dismount” which is silly since dismount sounds so much cooler. But anywaste, while Ubuntu could read, write and play CDs from the same drive the DVDs didn’t work in it was frustrating me to no end that my DVDs didn’t work. After trying everything I could think of I finally caved in and posted my own cry for help at the Ubuntu forum.

You can read my pathetic weeping for yourself here.

Long story short, nothing solved this problem and I wound up reporting it as a bug and am now re-installing Ubuntu 9.10 yet again. What I’m going to do here is summarize the steps I take to get my laptop up and running to play multimedia (other than from the DVD drive, of course). In future posts I’ll explain some of the other things I do after the install such as;

  1. Programs I install
  2. Themes or other changes I make to the GUI
  3. Problems, issues, headaches, workarounds and other things I might run into
  4. Any additional functionality I might add
  5. And so on

And now, on to the multimedia setup routine.

First things first, you can already find some really, really good guides on Ubuntu multimedia set-up (here and here for example). And even though a lot of what I’m going to write is similar to what has already been written, I’m not trying to rehash other people’s hard work as my own. I’m just going to write about the things I do because someone out there might like my way better, that’s all. And also, it’s easier for me to remember how to do something if I write it down. Also, keep in mind that this guide is for fresh installs of Ubuntu 9.10, not upgrades from 9.04 or below. This guide may also not be good for newer releases of Ubuntu, whenever they come out. Lastly, I’m no expert, so don’t expect me to be able to help if you follow these directions and something goes horribly wrong. I’m happy to try to help, but if it’s beyond me I’ll simply point you to the Ubuntu forums and stop taking your calls.

I’m talking to you, Mom.

OK, the first thing I’m doing to get multimedia files to work in Ubuntu is add all the files, codecs and other nonsense that are omitted from the install due to legal reasons. First, you need to open up Terminal which can be found under “Applications | Accessories | Terminal”. Then you need to copy and paste the following code into Terminal (remember that to paste in Terminal you need to hit ctrl+shift+V);

sudo wget http://www.medibuntu.org/sources.list.d/`lsb_release -cs`.list --output-document=/etc/apt/sources.list.d/medibuntu.list; sudo apt-get -q update; sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring; sudo apt-get -q update

Next, you should install as many of the packages as you want/need. Again, this is done by copying and pasting the command into Terminal. A lot of the info I’ve found on the web adds Sun Java to the following code, but I feel it’s easier to install that separately if you want it because sometimes, due to the way Java’s end-user license agreement (EULA) interrupts the installation until you agree to its terms, Java will crash or fail to load properly. I usually install Java though the Ubuntu Software Manager or the Synaptic Package Manager. However, if you want to install Java along with everything else in the code below, just add “sun-java6-fonts sun-java6-jre sun-java6-plugin” (no quotes) at the end of the code below.

sudo apt-get remove gnash gnash-common libflashsupport mozilla-plugin-gnash swfdec-mozilla && sudo apt-get install alsa-oss faac faad flashplugin-nonfree gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-pitfdll libmp3lame0 non-free-codecs unrar

Now you should install a few of the necessary (yet, also omitted due to legal reasons) packages in order for Ubuntu to play encrypted DVDs, certain Windows and Apple formats, etc.

sudo apt-get install libdvdcss2 libdvdread4 libdvdnav4 w32codecs

Note: if your computer uses the AMD64 or PowerPC architectures then you’ll need to replace w32codecs in the code above with either w64codecs or ppc-codecs respectively.

That should give you a very strong base, now you need to start the Update Manager which can be found at “System | Administration | Update Manager”, and let it update everything it finds that needs to be updated. And now you’re ready to play nearly any multimedia file you might want. All that’s left is to install your favorite media player via the Ubuntu Software Center which is found at “Applications | Ubuntu Software Center”. My favorite for movies is VLC Media Player because it’s fast, simple (yet powerful) and free. I haven’t yet found a favorite music player yet, but I’ll be sure to post about my search for it soon.

And that’s all I have to say about that.

Penguin Problems

So, I’m trying to learn to use Ubuntu Linux… and failing miserably.

Well, let me be a little more specific. It’s not so much that I’m failing to use Ubuntu, it’s that I’m unable to get it to run at all. It seems that I’ve been unfortunate enough to run into this bug and it’s causing me to go absolutely crazy. Long story short, Ubuntu 9.10 seems to install perfectly fine, but upon rebooting to complete the installation the computer fails and displays a black screen with the text “error: no such device:” followed by a large string of numbers and letters. Since I can’t even get to a command line, there’s absolutely nothing I can do to fix this other than try to install an older version of Ubuntu and then try to upgrade and see if that fixes the problem. If only I could get to the boot menu maybe I could find a workaround… Man, this is reminding me of the time I installed Windows 3.1 back in 1992… [shiver]

A loooooong time later…

Well, thanks to a little bit of code advice found in that bug report I linked to above, I’ve discovered the workaround fix for boot issues in Ubuntu 9.10. The boot problem seems to stem from the (still as of this writing) beta version of grub2 that Ubuntu 9.10 uses. Apparently, it’s attempting to load from a floppy and if there’s no floppy drive connected to the system the loader simply refuses to proceed and gets stuck in an endless loop with no way to exit without shutting down completely. It’s also important to note that this issue seems to only affect clean installs, and not upgrades.

Which is very upsetting.

Luckily, the fix isn’t that horribly technical and can be easily implemented by almost anyone as long as you can find a way to get to the actual grub menu. I’ve found that the easiest way to get to the grub menu is to hit the “Escape” key just as the machine begins to load the OS. YMMV. Of course, the modifications below won’t stick if you upgrade the grub-common package, but you can always do it again after an upgrade, and now you know where to find the instructions.

  1. Get to the grub menu and then press “e” to edit the startup commands.
  2. Delete the line that reads “search –no-floppy –fs-uuid –set ${fs_uuid}” where ${fs_uuid} is a long string of numbers and letters.
  3. Reboot
  4. You should now be able to boot into the Ubuntu desktop. Once there open up a terminal (Applications|Accessories|Terminal).
  5. Enter “sudo gedit /usr/lib/grub/grub-mkconfig_lib” (no quotes). You will need to enter your password.
  6. Scroll down until you find the line that reads “prepare_grub_to_access_device ()”.
  7. Remove the following lines:
    if fs_uuid=”`${grub_probe} –device ${device} –target=fs_uuid 2> /dev/null`” ; then echo “search –no-floppy –fs-uuid –set ${fs_uuid}”
    fi
  8. Save and close the gedit window.
  9. In Terminal enter the code “sudo update-grub” (no quotes).
  10. Reboot

That should take care of the boot problems. Just remember that you might run into the issue again if the grub-common package is updated!