All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Paul Davis <paul@linuxaudiosystems.com>
Cc: David Lloyd <dmlloyd@tds.net>,
	ALSA Mailing List <alsa-devel@lists.sourceforge.net>
Subject: Re: DMIX and capture stream
Date: Mon, 05 Jan 2004 19:12:26 +0100	[thread overview]
Message-ID: <s5h1xqe2rjp.wl@alsa2.suse.de> (raw)
In-Reply-To: <200401051741.i05HfCXl007120@dhin.linuxaudiosystems.com>

[-- Attachment #1: Type: text/plain, Size: 1047 bytes --]

At Mon, 05 Jan 2004 12:41:12 -0500,
Paul Davis wrote:
> 
> >I have application A that needs to open payback and capture streams 
> >because it's a two-way communications program.  Application B is a game 
> >that uses playback only.  I want to use these both at the same time.
> 
> but i don't think you can do this with OSS. why should ALSA's OSS
> emulation make it possible? the OSS API doesn't support this. if they
> used the ALSA API, it would work without (much) work on your part.

ok, finally i got his question - well, i didn't read carefully it
before, since i still have 5,000 unread mails...

anyway, it's possible if you use aoss wrapper and specify dmix/dsnoop
as the device.  you're right for the kernel emulation.  no way.
but still we need a fix for aoss wrapper.  the only necessary change
is to allow aoss open different pcm per playback and capture stream.

for example, the below is a minute quick hack (untested) for that.
you can specify pcm.dsp0p and pcm.dsp0c for playback and capture
directions, respectively.


Takashi

[-- Attachment #2: alsa-oss-duplex.dif --]
[-- Type: application/octet-stream, Size: 1015 bytes --]

Index: alsa-oss/alsa-oss.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-oss/alsa-oss.c,v
retrieving revision 1.24
diff -u -r1.24 alsa-oss.c
--- alsa-oss/alsa-oss.c	1 Dec 2003 13:25:58 -0000	1.24
+++ alsa-oss/alsa-oss.c	5 Jan 2004 18:08:18 -0000
@@ -394,6 +394,7 @@
 	int fd = -1;
 	int result;
 	char name[64];
+	static char *suffix[2] = { "p", "c" };
 
 	switch (device) {
 	case OSS_DEVICE_DSP:
@@ -447,11 +448,16 @@
 	dsp->oss_format = format;
 	result = -EINVAL;
 	for (k = 0; k < 2; ++k) {
+		char tmpname[64];
 		if (!(streams & (1 << k)))
 			continue;
-		result = snd_pcm_open(&dsp->streams[k].pcm, name, k, pcm_mode);
-		if (result < 0)
-			break;
+		snprintf(tmpname, sizeof(tmpname), "%s%s", name, suffix[k]);
+		result = snd_pcm_open(&dsp->streams[k].pcm, tmpname, k, pcm_mode);
+		if (result < 0) {
+			result = snd_pcm_open(&dsp->streams[k].pcm, name, k, pcm_mode);
+			if (result < 0)
+				break;
+		}
 	}
 	if (result < 0) {
 		result = 0;

  parent reply	other threads:[~2004-01-05 18:12 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-02 20:29 DMIX and capture stream David Lloyd
2004-01-04  5:07 ` Paul Davis
2004-01-04 12:12   ` Joern Nettingsmeier
2004-01-04 13:52   ` Florian Schmidt
2004-01-05  0:02     ` David Lloyd
2004-01-05  0:15       ` Florian Schmidt
2004-01-05  6:00       ` Patrick Shirkey
2004-01-05 10:18         ` HDSP as normal user Patrick Shirkey
2004-01-05 14:02           ` Paul Davis
2004-01-05 14:22           ` Takashi Iwai
2004-01-05 14:48             ` Patrick Shirkey
2004-01-05 16:13         ` DMIX and capture stream David Lloyd
2004-01-05 16:21           ` Jaroslav Kysela
2004-01-05 16:29   ` David Lloyd
2004-01-05 16:28     ` Jaroslav Kysela
2004-01-05 16:43       ` Takashi Iwai
2004-01-05 17:27       ` David Lloyd
2004-01-05 17:28       ` Florian Schmidt
2004-01-05 16:42     ` Takashi Iwai
2004-01-05 17:20       ` David Lloyd
2004-01-05 17:41         ` Paul Davis
2004-01-05 17:45           ` David Lloyd
2004-01-05 18:59             ` Paul Davis
2004-01-05 18:12           ` Takashi Iwai [this message]
2004-01-06 17:05             ` David Lloyd
2004-01-06 21:38               ` Florian Schmidt
2004-01-07 11:01                 ` Takashi Iwai
2004-01-07 12:05                   ` Florian Schmidt
2004-01-07 13:06                     ` Florian Schmidt
2004-01-07 13:49                       ` Takashi Iwai
2004-01-07 12:45                   ` Abramo Bagnara
2004-01-07 13:45                     ` Takashi Iwai
2004-01-07 14:39                       ` Abramo Bagnara
2004-01-07 15:02                         ` Takashi Iwai
2004-01-07 15:15                           ` Abramo Bagnara
2004-01-07 15:30                             ` Takashi Iwai
2004-01-07 15:47                               ` Abramo Bagnara
2004-01-07 16:12                                 ` Takashi Iwai
2004-01-07 16:58                                   ` Abramo Bagnara
2004-01-07 17:22                                     ` Takashi Iwai
2004-01-08  8:33                           ` Jaroslav Kysela

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=s5h1xqe2rjp.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=dmlloyd@tds.net \
    --cc=paul@linuxaudiosystems.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.