OSDN Git Service

pcm: dmix: Workaround for binary incompatibility
authorTakashi Iwai <tiwai@suse.de>
Fri, 26 May 2017 12:37:59 +0000 (14:37 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 26 May 2017 12:38:55 +0000 (14:38 +0200)
commiteae572ef5e3acd16a75815cf5e1799882bf9c943
tree516152f4de6cd2735ea05730d99306e1ec0db1e7
parent79f735fbc11fd0143b4cb9f37a801be54b2dcc4f
pcm: dmix: Workaround for binary incompatibility

The commit 1a9bd0f04481 ("pcm: direct: Fix for sync issue on xrun
recover") introduced a new field "recoveries" in
snd_pcm_direct_share_t.  Unfortunately this caused two issues:

- It changed the size of the struct which is used as the magic key
- The struct size differs between 32bit and 64bit due to alignment

The former brought the incompatibility with the older alsa-lib,
e.g. when you run an app with an older alsa-lib via LD_PRELOAD, it
doesn't work any longer.

The latter is more serious, it disallows running 32bit apps dmix with
64bit together.

As a workaround, put recoveries field to the unused field
"s.xfer_align", so that the struct is in an old form.  This makes the
dmix again binary-compatible with 1.1.3 and older versions, and also
fix the incompatibility between 32/64 bits.

This is a one-time workaround, and we may need to reconsider more
about a breakage in future...

Fixes: 1a9bd0f04481 ("pcm: direct: Fix for sync issue on xrun recover")
Reported-and-tested-by: Cheng Sun <chengsun9@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_direct.c
src/pcm/pcm_direct.h