martes, 10 de agosto de 2010

pavucontrol: Output sound from different applications to different soundcards with PulseAudio

Windows 7 allows one to set a second sound card for voice applications, which is very nice if you have two cards or an USB headset, since you automatically get voice calls on your headphones from apps that support the feature. In others, like Ventrilo, you've to select the card by yourself, but it's doable.

Not so with PulseAudio, with the standard options: most applications don't bother with input/output options anymore (e.g. Empathy), but even the ones that do will only show the PulseAudio server (like Skype).

Meet PulseAudio Volume Control (aptitude install pavucontrol). It allows us to redirect any application (or stream) to any sound device with a single click (or a dozen; the button doesn't works quite right for me), and the selection lasts until you switch the default device in the standard sound options.  Now I can have my voice apps automatically in my headset, and more.

sábado, 17 de julio de 2010

PowerBook G4 15" with stuck DVD

A PowerBook refused to eject a DVD by any means (on boot, from OpenFirmware...), seemingly a common occurrence.  After disassembling it, I found one of the levers on the optical drive's mechanism had somehow "jumped" out of it's place (perhaps by the owner inserting an object).  After sliding it back under the other lever, the drive resumed working correctly.

viernes, 18 de junio de 2010

"The database was created by a later version of Rhythmbox"

Updated Rhythmbox from Lucid to Maverick's version, to see if it would improve cold startup times.  It didn't, but it did break sync with my iTouch, besides rescanning all my collection.  So I downgraded back to Lucid, only to find Rhythmbox had upgraded its database to a new version:

Could not load the music database:
The database was created by a later version of Rhythmbox. This version of Rhythmbox cannot read the database
.

(No se pudo cargar la base de datos de la música:
Una versión posterior de Rhythmbox creó la base de datos.  Esta versión de Rhythmbox no puede leer la base de datos. en Español.)

So I went to take a look at the database at ~/.gnome2/rhythm
box/rhythmbox.xml, except it was not there. locate was no help, since my home directory is encrypted, but strace did the trick, as usual.

Turns out Rhythmbox has had it's user data in ~/.local/share/rhythmbox for a while now.  ~/.local/share is defined by an actual specification, XDG, which is also used for all the pretty Documents, Music and such directories.  Anything that helps reduce the home polka dot syndrome is more than welcome, and the specification is handy to know.  Take a look at  ~/.local/share and $XDG_CONFIG_DIRS for a quick overview of who uses it (not many, sadly).

Back to Rhythmbox, I could have just deleted it's database at ~/.local/share/rhythmbox, but since I like living on the edge... I changed the version from 1.7 back to <rhythmdb version="1.6">, which got me back to where I had started (but somewhat wiser).

I also noticed that there were quite a bunch of type ignore entries on the "database," about a third of the total number of entries.  And of those, two thirds were comprised by the FreeDB directory tree.  Removed the FreeDB directory and its ignore entries (all 6 MiB of them), which seems to have improved startup time slightly.

Well, the least I can ask for after all that is some placebo effect!

jueves, 20 de mayo de 2010

"Setup failed to install the product catalogs" error during Windows XP Installation

On the GUI installation, the following error appears on starting the "Windows Install" stage:


"Setup failed to install the product catalogs. This is a fatal error. The setup log files should contain more information."

(Español: "El programa de instalación no puede instalar los catálogos del producto. Éste es un error grave. Los archivos de registro de la instalación deben contener más información")

On clicking Accept, the log appears, containing amongst others, an error about:

"Error: The signature for Windows XP Professional Setup is invalid. The error code is 80096001."

(Español: "Error: La signatura del programa de instalación de Windows XP Professional Edition no es válida. El código de error es 80096001.")

If you close this dialog, the system will immediately restart.

While this can have other causes, in my case it was because I was using "ProfilesDir=D:\Usuarios" in my unattended setup to relocate all the user data to another partition, and forgot to format D: in the script.

As a quick fix, I opened a terminal with the handy (and obscure) Shift+F10 shortcut, did a "format /fs:ntfs /q D:", and restarted.  And so did the installation, which finished correctly.

viernes, 7 de mayo de 2010

Problems upgrading Ubuntu Karmic to Lucid

While overall smooth, a couple of details had to be fixed after upgrading Ubuntu Karmic to Lucid:


  • Grub didn't automatically select the previous OS I started, as before:
Had to add "GRUB_SAVEDEFAULT=true" to /etc/default/grub (and run update-grub after).

  •  The message "An error occurred while mounting /media/cdrom0/
    Press S to skip mounting or M for manual recovery" at every boot, and being unable to mount the CDROM as a normal user:

The CDROM settings in /etc/fstab were missing "noauto" to prevent it from being mounted on boot, and "users" for normal users to be able to mount it.  The result was:
     /dev/scd0       /media/cdrom0   udf,iso9660 utf8,users,noauto 0       0

    •  PulseAudio not starting, so audio is not working in most apps
    Running the script used to start PulseAudio (in Startup Applications) by hand provided little information:

    $ bash -x start-pulseaudio-x11
    + set -e
    + '[' -z '' ']'
    + '[' x:0.0 '!=' x ']'
    + /usr/bin/pactl load-module module-x11-publish display=:0.0
    Connection failure: Connection refused
     The problem was finally found in the comments in /etc/default/pulseaudio.  I had disabled PulseAudio's autospawn (as to be able to kill it and start jackd) in my ~/.pulse/client.conf, which is now required for start-pulseaudio-x11.  Enabling it back made it all good (jackd works without having to kill PulseAudio now).

      sábado, 1 de mayo de 2010

      Booting Windows over an hibernated Linux is not a good idea

      Booting Windows over an hibernated Linux is not a good idea. I just lost 20 GiB of data in a shared NTFS partition...

      I hibernated Ubuntu Lucid one day, and the next I fired up my computer.  Some update messed up the saved option in Grub, so instead of booting Ubuntu again as it should, it started Windows 7.  When I came back with my coffee, I just went on using it without recalling Ubuntu was in bear mode.  I probably accessed music, Firefox profile, documents, downloads and games from the shared partition.

      The next time I switched to Ubuntu, I saw the "waking up from hibernation" message.  Dang.  But I expected it to fail at waking, and soft reboot instead, as happened the previous time I "tried" this (in my Karmic times).  But no, it woke up alright.  Cool.  Or not.  I quickly realized a directory in the root of the shared partition was now empty.  I think the only programs accessing the shared partition on resuming were Quod Libet (music player) and Transmission (bittorrent client).

      I went back to Windows, where I couldn't even open the directory.  Trying to "dir" it in shell produced "file not found".  Corrupted.  Still, the partition's free space had not increased, so my 20 GiB where probably still there, safe from being overwritten.  Maybe.
      But how to get to them?

      A little research provided little help, and made my hopes even more bleak.

      I ran Scandisk ("Check for Errors") without auto repair, since I don't wanted to risk it fixing things by further destroying my data.  The result was not very informative: "Errors found.  Run with auto repair."  Unknown to me, seemingly it also marked the partition to be automatically checked on next boot.  I powered off and went away, and came back with EasyRecovery later.

      The computer started with me not paying attention, as usual, and when I looked, chkdsk was already spewing errors in full swing, which it did for some ten minutes.  Oh well, here goes nothing.

      Fortunately I did lit a candle for Santa Tecla recently, and after Windows started, my data was back, all of it as far as I can tell, though some files ended up in found.000.

      So yes, this had a happy ending.  You'll forgive the dramatic suspense, but that's to drive a point across: backup your data!  And (in my case) keep the backup up to date!  And of course, be extra careful with hibernation and shared partitions...