All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Martin Langer <martin-langer@gmx.de>
Cc: alsa-devel@lists.sourceforge.net, pilo.c@wanadoo.fr
Subject: Re: Testers needed: memio-mmap patch (rme32,rme96,nm256)
Date: Fri, 02 Jul 2004 14:50:22 +0200	[thread overview]
Message-ID: <s5hzn6i8tf5.wl@alsa2.suse.de> (raw)
In-Reply-To: <20040701201326.GA567@tuba.home>

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

At Thu, 1 Jul 2004 22:13:26 +0200,
Martin Langer wrote:
> 
> On Thu, Jul 01, 2004 at 03:44:11PM +0200, Takashi Iwai wrote:
> > At Sun, 20 Jun 2004 12:11:35 +0200,
> > Martin Langer wrote:
> > > 
> > > Ok, let's try fullduplex now...
> > 
> > JFYI: it's now on CVS tree.
> > fullduplex module option is disabled as default, though.
> 
> For enabling fullduplex you will need the following patch, too.

Oh yes, thanks ;)

 
> FYI: The situation is that I get only silence in fullduplex_mode after a
> short time. But nevertheless in the beginning it is correct.

How about the attached patch?


Takashi

[-- Attachment #2: Type: text/plain, Size: 4289 bytes --]

Index: alsa-kernel/include/pcm-indirect.h
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/include/pcm-indirect.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- alsa-kernel/include/pcm-indirect.h	1 Jul 2004 09:17:40 -0000	1.1
+++ alsa-kernel/include/pcm-indirect.h	2 Jul 2004 12:48:27 -0000	1.2
@@ -34,7 +34,7 @@
 	unsigned int sw_data;	/* Offset to next dst (or src) in sw ring buffer */
 	unsigned int sw_io;	/* Current software pointer in bytes */
 	int sw_ready;		/* Bytes ready to be transferred to/from hw */
-	size_t appl_ptr;	/* Last seen appl_ptr */
+	snd_pcm_uframes_t appl_ptr;	/* Last seen appl_ptr */
 } snd_pcm_indirect_t;
 
 typedef void (*snd_pcm_indirect_copy_t)(snd_pcm_substream_t *substream,
@@ -51,19 +51,19 @@
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr;
 	snd_pcm_sframes_t diff = appl_ptr - rec->appl_ptr;
-	snd_pcm_uframes_t qsize;
+	int qsize;
 
 	if (diff) {
 		if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2))
 			diff += runtime->boundary;
-		rec->sw_ready += frames_to_bytes(runtime, diff);
+		rec->sw_ready += (int)frames_to_bytes(runtime, diff);
 		rec->appl_ptr = appl_ptr;
 	}
 	qsize = rec->hw_queue_size ? rec->hw_queue_size : rec->hw_buffer_size;
 	while (rec->hw_ready < qsize && rec->sw_ready > 0) {
-		size_t hw_to_end = rec->hw_buffer_size - rec->hw_data;
-		size_t sw_to_end = rec->sw_buffer_size - rec->sw_data;
-		size_t bytes = rec->hw_buffer_size - rec->hw_ready;
+		unsigned int hw_to_end = rec->hw_buffer_size - rec->hw_data;
+		unsigned int sw_to_end = rec->sw_buffer_size - rec->sw_data;
+		unsigned int bytes = qsize - rec->hw_ready;
 		if (rec->sw_ready < (int)bytes)
 			bytes = rec->sw_ready;
 		if (hw_to_end < bytes)
@@ -74,7 +74,7 @@
 			break;
 		copy(substream, rec, bytes);
 		rec->hw_data += bytes;
-		if ((int)rec->hw_data == rec->hw_buffer_size)
+		if (rec->hw_data == rec->hw_buffer_size)
 			rec->hw_data = 0;
 		rec->sw_data += bytes;
 		if (rec->sw_data == rec->sw_buffer_size)
@@ -90,9 +90,9 @@
  */
 static inline snd_pcm_uframes_t
 snd_pcm_indirect_playback_pointer(snd_pcm_substream_t *substream,
-				  snd_pcm_indirect_t *rec, size_t ptr)
+				  snd_pcm_indirect_t *rec, unsigned int ptr)
 {
-	ssize_t bytes = ptr - rec->hw_io;
+	int bytes = ptr - rec->hw_io;
 	if (bytes < 0)
 		bytes += rec->hw_buffer_size;
 	rec->hw_io = ptr;
@@ -155,9 +155,9 @@
  */
 static inline snd_pcm_uframes_t
 snd_pcm_indirect_capture_pointer(snd_pcm_substream_t *substream,
-				 snd_pcm_indirect_t *rec, size_t ptr)
+				 snd_pcm_indirect_t *rec, unsigned int ptr)
 {
-	ssize_t bytes = ptr - rec->hw_io;
+	int bytes = ptr - rec->hw_io;
 	if (bytes < 0)
 		bytes += rec->hw_buffer_size;
 	rec->hw_io = ptr;
Index: alsa-kernel/pci/rme32.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/pci/rme32.c,v
retrieving revision 1.40
diff -u -r1.40 rme32.c
--- alsa-kernel/pci/rme32.c	1 Jul 2004 09:17:52 -0000	1.40
+++ alsa-kernel/pci/rme32.c	2 Jul 2004 11:14:58 -0000
@@ -1210,20 +1210,16 @@
 snd_rme32_playback_fd_pointer(snd_pcm_substream_t * substream)
 {
 	rme32_t *rme32 = snd_pcm_substream_chip(substream);
-	size_t ptr;
-
-	ptr = readl(rme32->iobase + RME32_IO_GET_POS) & RME32_RCR_AUDIO_ADDR_MASK;
-	return snd_pcm_indirect_playback_pointer(substream, &rme32->playback_pcm, ptr);
+	return snd_pcm_indirect_playback_pointer(substream, &rme32->playback_pcm,
+						 snd_rme32_pcm_byteptr(rme32));
 }
 
 static snd_pcm_uframes_t
 snd_rme32_capture_fd_pointer(snd_pcm_substream_t * substream)
 {
 	rme32_t *rme32 = snd_pcm_substream_chip(substream);
-	size_t ptr;
-
-	ptr = readl(rme32->iobase + RME32_IO_GET_POS) & RME32_RCR_AUDIO_ADDR_MASK;
-	return snd_pcm_indirect_capture_pointer(substream, &rme32->capture_pcm, ptr);
+	return snd_pcm_indirect_capture_pointer(substream, &rme32->capture_pcm,
+						snd_rme32_pcm_byteptr(rme32));
 }
 
 /* for halfduplex mode */
@@ -1990,6 +1986,8 @@
 	rme32->card = card;
 	rme32->pci = pci;
 	snd_card_set_dev(card, &pci->dev);
+        if (fullduplex[dev])
+		rme32->fullduplex_mode = 1;
 	if ((err = snd_rme32_create(rme32)) < 0) {
 		snd_card_free(card);
 		return err;


  reply	other threads:[~2004-07-02 12:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-18 14:51 Testers needed: memio-mmap patch (rme32,rme96,nm256) Takashi Iwai
2004-06-20 10:11 ` Martin Langer
2004-07-01 13:44   ` Takashi Iwai
2004-07-01 20:13     ` Martin Langer
2004-07-02 12:50       ` Takashi Iwai [this message]
2004-07-05 18:47         ` Martin Langer
2004-07-13 19:54           ` Martin Langer

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=s5hzn6i8tf5.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=martin-langer@gmx.de \
    --cc=pilo.c@wanadoo.fr \
    /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.