15/08/2009

My USB soundcard did not want to play mp3s

As Tisiphone's line out jack is pretty worn out, I bought a cheap C-Media USB soundcard to finally get stereo sound again. It's quite plug-and-play, the channels showed in KMix without me having to change any settings, but the damn thing refused to play mp3s.
It turned out to be Phonon's fault, and it's actually a pretty cool feature.

You can set output preferences for each type of sound individually in the Personal Settings->Multimedia->Device Preference dialog. The internal sound card, which I had muted, was still on top of the devices list, so I moved the C-Media device up, and voilĂ , stereo music. If the USB card is not present, Phonon will fall back to the internal one.
This is generally true for all KDE multimedia apps, e.g. Kaffeine. It doesn't work with non-KDE apps like VLC (and probably mplayer), as they address the backend (e.g. alsa) directly. For VLC go to Preferences->Advanced Settings->Audio->Output modules. Set the output module to ALSA, then choose the right card in the device names list (subitem ALSA). It's also possible to use the USB card as ALSA default by setting it as the first sound card in YaSt->Hardware->Sound (or see e.g. here). AFAIK, this is the only way to channel sound output from Firefox/Flash to the USB card. To set your KMix master channel permanently, change DefaultCardOnStart in ~/.kde4/share/config/kmixrc to the USB device

No comments: