Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Benno Senoner <sbenno@gardena.net>
To: linux-sound@vger.kernel.org
Subject: Re: File descriptors and Sound
Date: Fri, 13 Aug 1999 12:41:51 +0000	[thread overview]
Message-ID: <marc-linux-sound-93459132807823@msgid-missing> (raw)
In-Reply-To: <marc-linux-sound-93415570309034@msgid-missing>

On Mon, 09 Aug 1999, Alan Cox wrote:
> > If the device is full-duplex how can I have one application
> > reading it and another writing?
> 
> You either do file handle passing (funky) or normally one program runs the
> other: ie
> 
> 	open file
> 	fork()
> 	
> 	child:
> 		exec other app (which inherits file)
> 		exit
> 
> 	parent:
> 		run code

ok,
but what if one wants to implement some sort of MIDI-thru util ?
(not related to /dev/audio but /dev/midi , but the problem is the same:
2 different apps want to access to the same device,
the one in O_RDONLY , the other in O_WRONLY mode)

For example:

/dev/midi00   external midi port
/dev/midi01   AWE64 internal synth

Assume the midi-thru util opens /dev/midi00 in O_RDONLY and /dev/midi01 in
O_WRONLY mode.
The app reads the incoming midi data from the midi00 device and applies certain
event filters and then writes the data to /dev/midi01. (the synth).

It would be nice if a sequencer was still able to to write to /dev/midi00 to
drive an external synth.

Since the sequencer tries to open /dev/midi00 
(assuming that the sequencer opens the device only in O_WRONLY mode),
 I can't use the fork() method to inherit filehandles.
Is there a way to do this ?

What is in your opinion the best way to implement a virtual midi device in
userspace ? Like the midi-thru example
Using a regular named pipe ?
But sequencers would not recognize this virtual device since they look in
/dev/sndstat for available devices.


regards,
Benno.

      parent reply	other threads:[~1999-08-13 12:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-08 23:48 File descriptors and Sound Rui Sousa
1999-08-08 23:53 ` Alan Cox
1999-08-09 14:57 ` Rui Sousa
1999-08-09 16:40 ` Matthew Wilcox
1999-08-13 12:41 ` Benno Senoner [this message]

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-93459132807823@msgid-missing \
    --to=sbenno@gardena.net \
    --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