[alsa-devel] 1.1.4 bug report: dmix fails when using both 32-bit and 64-bit clients

Takashi Iwai tiwai at suse.de
Thu May 25 18:31:36 CEST 2017


On Thu, 25 May 2017 17:43:44 +0200,
Cheng Sun wrote:
> 
> On 25 May 2017 14:49, "Takashi Iwai" <tiwai at suse.de> wrote:
> >
> > On Wed, 24 May 2017 21:13:46 +0200,
> > Cheng Sun wrote:
> > >
> > > Hi all,
> > >
> > > The following commit (released in v1.1.4) introduced an issue where a
> > > client compiled against a 32-bit (x86) compile of alsa-lib cannot use
> > > the same dmix as a client compiled against a 64-bit alsa-lib.
> > >
> > >     1a9bd0f0448106b917ae7f7bedccfcbf6ce84802
> > >
> > > The error message is:
> > >
> > >     ALSA lib pcm_dmix.c:1077:(snd_pcm_dmix_open) unable to create IPC
> > > shm instance
> > >
> > > The following forum post (not mine) describes the symptoms of the
> > > issue in more detail (although the git commit the poster specified is
> > > not correct):
> > >
> > >
> https://forums.gentoo.org/viewtopic-p-8072290.html?sid=c2fbca45102933ddf9ca7cf8b6713e56
> >
> > There is a known problem when you mix up two alsa-lib versions because
> > of the changes in dmix shmem struct.  The solution should upgrade all
> > users.
> 
> (Apologies for duplicate email --accidentally sent the first reply to the
> wrong address.)
> 
> Arch Linux has upgraded both its 32 and 64 bit packages to v1.1.4, and I'm
> still experiencing this problem.
> 
> While bisecting the bug I linked against two compiles of the same alsa-lib
> versions each time.
> 
> Let me know if I can provide any other information.

OK, at first to see whether it's the issue of the struct size
mismatch, check the following patch.  If it is, you'll see the error
message.  To be sure, check both cases: 64bit -> 32bit, and 32bit ->
64bit.


Takashi

---
diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -136,6 +136,7 @@ retryget:
 		return 1;
 	} else {
 		if (dmix->shmptr->magic != SND_PCM_DIRECT_MAGIC) {
+			fprintf(stderr, "magic mismatch: shmptr=%x, expected=%x\n", (int)dmix->shmptr->magic, (int)SND_PCM_DIRECT_MAGIC);
 			snd_pcm_direct_shm_discard(dmix);
 			return -EINVAL;
 		}


More information about the Alsa-devel mailing list