Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Jaroslav Kysela <perex@suse.cz>
To: linux-sound@vger.kernel.org
Subject: Re: es1371 driver
Date: Thu, 21 Feb 2002 14:55:17 +0000	[thread overview]
Message-ID: <marc-linux-sound-101430360630608@msgid-missing> (raw)
In-Reply-To: <marc-linux-sound-101430199925056@msgid-missing>

On Thu, 21 Feb 2002, Wilmer van der Gaast wrote:

> (I found two addresses for Thomas, which one is the right one?)
>
> Hello,
>
> My computer has a SB PCI128 card and works perfectly with it. But, one
> strange thing with the current Linux driver for it. Here a piece from
> es1381_open:
>
> 	/* wait for device to become free */
> 	down(&s->open_sem);
> 	while (s->open_mode & file->f_mode) {
> 		if (file->f_flags & O_NONBLOCK) {
> 			up(&s->open_sem);
> 			return -EBUSY;
> 		}
> 		add_wait_queue(&s->open_wait, &wait);
> 		__set_current_state(TASK_INTERRUPTIBLE);
> 		up(&s->open_sem);
> 		schedule();
> 		remove_wait_queue(&s->open_wait, &wait);
> 		set_current_state(TASK_RUNNING);
> 		if (signal_pending(current))
> 			return -ERESTARTSYS;
> 		down(&s->open_sem);
> 	}
>
> Why does it wait? When I play an MP3 and meanwhile accidentally visit a
> website which uses Flash, the whole Mozilla process freezes because it can't
> get /dev/dsp. Maybe all programs should be blamed for opening /dev/dsp
> without O_NONBLOCK, but for me altering this piece of kernel code worked a
> lot better. Now any open() is handled as O_NONBLOCK and I don't get those
> crashes anymore.
>
> Anyway, why this crashy behaviour by default? :-/

Applications are ignoring standards. For further defails see:

http://www.unix-systems.org/onlinepubs/7908799/xsh/open.html

Especially this sentence:

If O_NONBLOCK is clear:
	The open() function will block the calling thread until the device
is ready or available before returning.

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project  http://www.alsa-project.org
SuSE Linux    http://www.suse.com


  parent reply	other threads:[~2002-02-21 14:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-21 13:40 es1371 driver Wilmer van der Gaast
2002-02-21 14:30 ` Zwane Mwaikambo
2002-02-21 14:55 ` Jaroslav Kysela [this message]
2002-02-21 18:03 ` Wilmer van der Gaast

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-sound-101430360630608@msgid-missing \
    --to=perex@suse.cz \
    --cc=linux-sound@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox