All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Loc Ho <loc@pacificconsultants.com>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: ALSA Memory Allocation Bug
Date: Thu, 13 May 2004 20:18:23 +0200	[thread overview]
Message-ID: <s5h8yfwnqc0.wl@alsa2.suse.de> (raw)
In-Reply-To: <s5had0cnqve.wl@alsa2.suse.de>

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

At Thu, 13 May 2004 20:06:45 +0200,
I wrote:
> 
> [1  <text/plain; US-ASCII (7bit)>]
> At Thu, 13 May 2004 10:53:48 -0700,
> Loc Ho wrote:
> > 
> > Hi,
> > 
> > Also, after looking at the snd memory allocation routines, the
> > unique tag are type, id, and flag. The type is "continous". The id is
> > formated by the device ID, stream number, and substream number. The
> > flag is the kernel memory flag. I already discussed the ID in my
> > previous email (see below). Therefore, it will NOT be unique across
> > multiple card!!!  
> 
> hmm, you're right.
> 
> obviously it's a bug of snd-usb-audio.
> the attached patch should fix the problem.

maybe this one is better.
i'll commit this to cvs.
	

Takashi

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

Index: alsa-kernel/core/pcm_memory.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/core/pcm_memory.c,v
retrieving revision 1.25
diff -u -r1.25 pcm_memory.c
--- alsa-kernel/core/pcm_memory.c	7 Apr 2004 17:49:39 -0000	1.25
+++ alsa-kernel/core/pcm_memory.c	13 May 2004 18:16:27 -0000
@@ -224,9 +224,13 @@
  */
 static inline void setup_pcm_id(snd_pcm_substream_t *subs)
 {
-	if (! subs->dma_device.id)
+	if (! subs->dma_device.id) {
 		subs->dma_device.id = subs->pcm->device << 16 |
 			subs->stream << 8 | (subs->number + 1);
+		if (subs->dma_device.type == SNDRV_DMA_TYPE_CONTINUOUS ||
+		    subs->dma_device.dev == NULL)
+			subs->dma_device.id |= (subs->pcm->card->number + 1) << 24;
+	}
 }
 
 /**

  reply	other threads:[~2004-05-13 18:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <D22B281CC561444AA27F7F6C6C9E3E6102F549@mtvs4.pcllc.net>
2004-05-13 18:06 ` ALSA Memory Allocation Bug Takashi Iwai
2004-05-13 18:18   ` Takashi Iwai [this message]
     [not found] <D22B281CC561444AA27F7F6C6C9E3E6102F548@mtvs4.pcllc.net>
2004-05-13 17:54 ` Takashi Iwai
2004-05-13  1:40 Loc Ho
2004-05-13  9:24 ` Takashi Iwai

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=s5h8yfwnqc0.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=loc@pacificconsultants.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.