Hi, I recently switched from OSS/Free to ALSA and everything but one thing was working perfectly. I have an old sb16 card and I'm used to the fact that if /dev/dsp is already used all new attempts to open it should fail instead of just block until it's availiable. Then I found the snd_nonblock_open moduleparameter to snd-pcm-oss but it didn't work when set to 1 (actually tried with 0 too). Here's a small patch to fix that problem by making snd-pcm-oss always obey snd_nonblock_open unless the nonblock parameter is already set to 1. It's just a simple cut-n-paste in pcm_oss.c
Patch is attached, it works fine here. /Martin Never argue with an idiot. They drag you down to their level, then beat you with experience.
--- alsa-kernel/core/oss/pcm_oss.c.orig Mon Mar 18 23:30:15 2002 +++ alsa-kernel/core/oss/pcm_oss.c Mon Mar 18 23:30:32 2002 @@ -1567,16 +1567,14 @@ nonblock = 1; else if (psetup->block) nonblock = 0; - else if (!nonblock) - nonblock = snd_nonblock_open; } else if (csetup && !csetup->disable) { if (csetup->nonblock) nonblock = 1; else if (csetup->block) nonblock = 0; - else if (!nonblock) - nonblock = snd_nonblock_open; } + if (!nonblock) + nonblock = snd_nonblock_open; init_waitqueue_entry(&wait, current); add_wait_queue(&pcm->open_wait, &wait);