Getting JuK to output sound via ALSA

Linux: Linux sound is still a mess. Due to the ever-changing ’sound server of the week’ system used to decide how an app should output sound, it’s perfectly possible to have 3 apps on your desktop happily making noise at the same time, while another app complains about requiring exclusive access to /dev/dsp — or worse, hangs silently while it attempts to grab an exclusive lock on the device.

This page gives a reasonably good guide to getting software mixing working across (virtually) all apps, using ALSA software mixing and esd.

However, some cases are still very kludgy — in particular, JuK, the excellent KDE mp3 jukebox app, has a tendency to play poorly with others, requiring playback via no less than two sound servers — artsd and esd — to work correctly in the above setup. In addition, the support for mp3 files in artsd is buggy — it’s frequently unable to open certain mp3s, depending on how they were encoded.

Well, good news — the current release of JuK now supports direct playback from GStreamer via ALSA. Here’s how. By adding these lines:

[GStreamerPlayer]
SinkName=alsasink

to ~/.kde/share/config/jukrc, you can skip sending JuK mp3 playback via 2 sound servers, and just play directly to the hardware from the mp3 player. An improvement! Not quite optimal, and certainly not user-friendly — but getting there…

Tags: , , , , , , , , ,

Comments

An Open Letter to Sound System Developers

Linux: after about 3 months of tweaking and twisting, performed by someone who’s been using UNIX for over a decade, I’ve finally got sound working the way I want it on my Linux desktop. In other words, I can hear sounds made by Flash applets, and I don’t have to shut down the best music player on the platform every time another app wants to make a sound.

This is pretty clearly absurd.

So here’s my open letter to the developers of the various systems (GStreamer, aRts, ALSA, EsounD polypaudio, et al):

  • Please DO do some testing with crappy sound hardware. I don’t care if your sound system works great with a SoundBlasterLive 2006 with the kryptonite connectors, I have a laptop, for god’s sake. That means software mixing is essential, because cheapo hardware doesn’t do hardware mixing.
  • As an extension: please DO include software mixing by default. ALSA’s pretty good in general, but having to hack out 55 lines of hand-tweaked config file before software mixing works, is insane. (Especially when the Wiki documenting that is full of notes that some of the magic numbers may not work on your hardware.)
  • Please DO use existing APIs if possible. That means esd. I’m looking at you, aRts. At least the latest sound project, polypaudio, looks like it’s getting this right.
  • I DON’T care about network transparency, realtime response, or having a wah-wah pedal effect built into my sound server. That’s just silly. Use a modular architecture to allow that in future, but concentrate on getting the basic stuff working first!
  • Please DON’T hardcode output device or output ’sink’ names into the source. Looking at the kgst component of KDE here.

Meh.

Anyway, here’s the scoop on what I had to do to get software mixing working in both GNOME, KDE, and Firefox, on my Thinkpad T40 running Debian unstable. Once I figured out the magic incantations, it now seems to be working without stutters or hangs.

Sometime in the next few months, of course, I plan to upgrade to Ubuntu Linux, and all bets will once again be off ;)

Tags: , , , , , , , , ,

Comments