December 25, 2007

Linux audio strikes back

Fedora 7’s new Firewire stuff might not be totally together: when I plugged in my DV cam, I couldn’t read the device except (I guess?) as root. (Kino also kept crashing, and I ended up just using dvgrab.)

Apparent side-effect of running sudo kino: some shared memory used by dmix became owned by root and mod 0600. Thus when you run something like, say, aplay (ALSA configured to use dmix by default), you get “unable to create IPC semaphore” (among some other lines).

My fix:

  1. grep ipc_key /etc/alsa/*. In my case, I see something like /etc/alsa/alsa.conf:defaults.pcm.ipc_key 5678293 (that’s 0x56a4d5).
  2. ipcs -a and look for the IPC key in hex. I had both 0x56a4d5 and 0x56a4d6. I… hope 0x56a4d6 belonged to ALSA because…
  3. First I made sure that the nattach column said 0 for any dmix-related segments/semaphores, then
  4. I used ipcrm -M 0x56a4d5 (and then ipcrm -M 0x56a4d6) to delete those shared memory segments, and ipcrm -S 0x56a4d5 to delete the semaphores (“Semaphore Arrays” is the heading; maybe simply saying “semaphores” is poor form on my part).

Then audio worked.

I am more and more looking forward to Fedora 8 and PulseAudio.