My ongoing experiences with Ubuntu, and later Mythbuntu, as a media center with MythTV. I'm also using the system for a virtual machine server, a mediawiki server and a general all around home infrastructure base.

Saturday, January 27, 2007

Ubuntu 6.10, Rythmbox and Sound Juicer: Enabling MP3 Ripping

First, a hint about setting up sound. This HowTo is very helpful. The only thing I had to do was double-click on the speaker icon in the upper right and then move the PCM volume up. Until I did that I got no sound output. I found putting the PCM level at about 1/3rd of max worked out about right.

This thread and this help page were useful to figuring this out. Ultimately brian g's post at the end of this thread gave me the right GStreamer encoding stream. What's below is what worked for me taken from all of those postings.
  1. If you haven't already done so, make sure you have gstreamer0.10-plugins-ugly installed:
    sudo apt-get install gstreamer0.10-plugins-ugly

  2. Then do the following install (Thanks to Gordon for confirming it is needed).
    sudo apt-get install gstreamer0.10-plugins-ugly-multiverse

  3. Open Sound Juicer.
  4. Select Edit/Preferences
  5. Click on Edit Profiles
  6. Click on New
  7. Name it "MP3"
  8. Select the new profile, and click on Edit
  9. Set the GStreamer Pipeline to:
    audio/x-raw-int,rate=44100,channels=2 ! lame name=enc vbr=4 vbr-quality=2 ! xingmux ! id3v2mux
  10. Set the File Extension to mp3
  11. Make sure Active? is selected.
  12. Click OK
  13. Close the Audio Profiles window and the Sound Juicer preferences
  14. At this point I couldn't select my newly created profile in Sound Juicer, so I had to...
  15. Close and restart Sound Juicer.
  16. Now select Edit/Preferences again.
  17. For Output Format select your newly created MP3 format.
  18. Close the Preferences pane.
Now if you Extract in Sound Juicer you should end up with MP3 files.

Note: It looks like one should be able to use Rythmbox to rip MP3 directly using its "Copy to library function" but it doesn't work for me. I select Edit/Preferences and then selecting your new MP3 format as the Preferred Format. But then when I try to Copy to library I get the following error:
Error transferring track
no element "xingmux"
Note 2: Apparently these changes will only make MP3 ripping available to the current user. This post has directions for making MP3 ripping available to all users on the system.

Ubuntu 6.10: Getting ITunes to see Rythmbox

My next step was to share music from Rythmbox to ITunes running on the Winsows XP and MacOS laptops. This turned out to be non-obvious.

First, in Rythmbox, click on Edit/Preferences then select the Sharing tab and select Share my music and give it a name of your choosing. I also required a password.

At this point I still couldn't see Rythmbox from ITunes or vice versa.

The next thing to do was to turn on the Avahi daemon. Do this by selecting System/Administration/Networking and then select the General tab and make sure the checkbox for Automatic service discovery is checked.

And then I had to do one more then, which was to enable something called D-Bus. I did this by opening a Terminal and editing /etc/avahi/avahi-daemon.conf

sudo vi /etc/avahi/avahi-daemon.conf

And uncomment the following line:
#enable-dbus=yes
so that it looks like:
enable-dbus=yes
Then restart avahi:

sudo /etc/init.d/avahi-daemon restart

This lets me see Rythmbox from ITunes. I still can't see ITunes from Rythmbox. This post may give the reason why.

Getting Rythmbox to Recognize MP3s

After I copied over my Itunes library to my Ubuntu 6.10 system I was somewhat surprised to find it didn't recognize MP3s. Poking around the net a little turned up this was do to intelletual property issues and there were a number of different fixes posted (for example).

I tried various ones and here's what I think ended up working for me. I say I think because I tried a number and it started working after what I did below. It's possible some of the prior steps I took were important.

First you have to allow your system to download software from universe and mutliverse. Select System/Administration/Software Sources. Make sure "Community maintained Open Source software (universe)" and "Software restricted by copyright or legal issues (multiverse)" are checked. Then click Close.

Then I ran the following command:

sudo apt-get install gstreamer0.10-plugins-ugly

And restarted Rythmbox. After that it recognized MP3 just fine.

Note that it still doesn't seem to be able to rip CDs into MP3s. That's still on the todo list...

For the record, here are some of the other things I found on the net that I tried (after adding universe and multiverse to my software sources), which either didn't work or didn't seem to have any effect:

apt-get install gstreamer0.10-ffmpeg gstreamer0.10-gl gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse libxine-extracodecs w32codecs

apt-get install gstreamer0.8-mad

apt-get install gstreamer0.8-plugins

apt-get install gstreamer0.10-plugins

Ubuntu 6.10 Print Server with HP PSC 1610

The next step in my process of setting up my Ubuntu server was to connect my HP PSC 1610 printer/scanner to the server and then share it out via Samba to my laptops.

First step, connect the printer to the server via USB.

Second step, make sure the USB cable is actually plugged into the printer. This would have saved me some time later :-)

Add the printer. At this point the printer should work locally. I was also able to scan using XSane (Applications/Graphics/XSane).

The rest of this assumes you have Samba and Cupsd installed. I did by default.

First, I had to edit the cupsd configuration as follows (I use vi as my editor, gedit seems to be what most Ubuntu documentation suggests, but I've learned enough editors already. Replace "vi" with "gedit" if you want).

sudo -s
cd /etc/cups
cp cupsd.conf cupsd.conf.backup
vi cupsd.conf

And change the following lines:
# Only listen for connections from the local machine.
Listen 631
to the following:
# Allow network connections to port 631
Port 631
Then find the following block:

<location>
Order allow, deny
....
</location>
And add the following line into it. If your local subnet address is not 192.168.1.x then replace that appropriately (sorry, you're on your own here, I assume you know your local network configuration):
Allow From 192.168.1.*
Then I restarted cupsd (not sure if this was necessary):

/etc/init.d/cupsys restart

At that point remote printing worked as well. The only real problem is finding a printer driver that works with my PSC1610. Since it's a all-in-one printer/scanner/copier HP doesn't seem to provide a simple print driver. On my windows box I use the driver for the HP DeskJet 1600C which works ok, but not perfectly. If someone knows the right solution to this, please leave a comment.

Ubuntu 6.10 Samba File Sharing

I'm setting up Ubuntu 6.10 (Edgy) on a new PC for use as a general file and MP3 server for a couple Windows XP and MacOS laptops we have. I'm doing this on a Dell n series Optiplex 740, which I mention beause you can order one without windows pre-installed.

As I do this process, I thought I'd share my experiences (and record them so I can remember them) since although Ubuntu is nice, I'm still having to work through a number of non-trivial steps. Hence I created this blog as an experiment to do so. We'll see how it goes...

I'm fairly well versed in Unix and Windows. I'm assuming the reader has some experise, so I'm not going into every little detail, just the stuff I though was non obvious. I strongly recommend the Ubuntu Guide for more information if you're just getting going with Ubuntu.

The first thing I wanted to get going was Samba file sharing so that the various laptops could access server's disk. Starting up Samba turned out to be easy, I selected System/Preferences/Shared Folders and the system informed me I didn't have Samba installed and asked me if I wanted it installed. I replied affirmatively and the install went smooth as silk. I clicked on my home directory (eventually I plan on exporting a number of things, but this works to start with) and Properties. I selected "Windows networks (SMB)" and gave it a share name of my choosing. I unchecked Read only, because I wanted to be able to both read and write from the various laptops.

Back in Shared Folders/General Properties I have MSHOME for a Domain/Workgroup (this seems to be some Windows default name). WINS server was unchecked and the WINS server text field was blank.

Click Close and all seemed well. I was able to see the share from my various laptops, but not able to authenticate to actually mount it. Turns out the way Samba is configured by default, you have to add users to the Samba user database, e.g. launch Applications/Terminal and type:

sudo smbpasswd -L -a username
sudo smbpasswd -L -e username

Replace username with a username of your choosing. It needs to be the same for both commands. In my case the chosen username matched my Unix/Ubuntu username - I think it's ok for the default Samba configure if it doesn't but I haven't tested it yet (see my subsequent notes about smb.conf).

After being asked for the system password, you'll be asked to create a password for the Samba username (this is in response to the first command, the second command just activates the account and doesn't prompt for anything). BTW, I usually don't type sudo for each command, I launch a root shell with "sudo -s", I suspect as I go along I may forget this and leave off sudo.

Then using that username and password I was able to mount the filesystem on my various laptops.

BTW, looking at the /etc/samba/smb.conf file it looks like there are various options to try and keep the Samba and Unix/Ubuntu passwords in sync, including options to force Sambe usernames to have a corresponding Unix username (which seems to be off by default). I haven't played with any at this time and am using the default smb.conf file.