All of lore.kernel.org
 help / color / mirror / Atom feed
* alsa-lib failing at runtime
@ 2009-01-28 13:43 Will Wagner
  2009-01-28 14:03 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Will Wagner @ 2009-01-28 13:43 UTC (permalink / raw)
  To: alsa-devel

Hi All,

I have found a problem with alsa-lib 1.0.19 running on an embedded arm board. It all
compiles ok but aplay fails to play a .wav file and the kernel reports this error:

ALSA sound/core/pcm_native.c:2587: unknown ioctl = 0x80184132

Decoding this ioctl it is SNDRV_PCM_IOCTL_CHANNEL_INFO defined in asound.h.

The reason it is not working is that the kernel and alsa-lib think that the
sndrv_pcm_channel_info struct is different sizes.

The definition in asound.h is:

struct sndrv_pcm_channel_info {
	unsigned int channel;
	off_t offset;			/* mmap offset */
	unsigned int first;		/* offset to first sample in bits */
	unsigned int step;		/* samples distance in bits */
};

The problem is that when compiling linux it thinks off_t is 4 bytes but when compiling
alsa-lib it thought it was 8 bytes.

After discussion on the buildroot mailing list (see
http://lists.busybox.net/pipermail/buildroot/2009-January/025458.html) it seems like for
the kernel off_t is always 4 bytes but for user space it can be either 4 or 8 bytes
depending on whether large file support is enabled.

It appears that the fix is that the type of offset should be changed to long.

Hope this all makes sense.

Thanks,

Will.
-- 
------------------------------------------------------------------------
Will Wagner                                     will_wagner@carallon.com
Development Manager                      Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: alsa-lib failing at runtime
  2009-01-28 13:43 alsa-lib failing at runtime Will Wagner
@ 2009-01-28 14:03 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2009-01-28 14:03 UTC (permalink / raw)
  To: Will Wagner; +Cc: alsa-devel

At Wed, 28 Jan 2009 13:43:51 +0000,
Will Wagner wrote:
> 
> Hi All,
> 
> I have found a problem with alsa-lib 1.0.19 running on an embedded arm board. It all
> compiles ok but aplay fails to play a .wav file and the kernel reports this error:
> 
> ALSA sound/core/pcm_native.c:2587: unknown ioctl = 0x80184132
> 
> Decoding this ioctl it is SNDRV_PCM_IOCTL_CHANNEL_INFO defined in asound.h.
> 
> The reason it is not working is that the kernel and alsa-lib think that the
> sndrv_pcm_channel_info struct is different sizes.
> 
> The definition in asound.h is:
> 
> struct sndrv_pcm_channel_info {
> 	unsigned int channel;
> 	off_t offset;			/* mmap offset */
> 	unsigned int first;		/* offset to first sample in bits */
> 	unsigned int step;		/* samples distance in bits */
> };
> 
> The problem is that when compiling linux it thinks off_t is 4 bytes but when compiling
> alsa-lib it thought it was 8 bytes.
> 
> After discussion on the buildroot mailing list (see
> http://lists.busybox.net/pipermail/buildroot/2009-January/025458.html) it seems like for
> the kernel off_t is always 4 bytes but for user space it can be either 4 or 8 bytes
> depending on whether large file support is enabled.
> 
> It appears that the fix is that the type of offset should be changed to long.
> 
> Hope this all makes sense.

Yes, you're right.  I thought I've already fixed this, but it seems it
didn't go out from my local tree and forgot since then.

Now fixed on GIT tree.

Thanks!

Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-28 14:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-28 13:43 alsa-lib failing at runtime Will Wagner
2009-01-28 14:03 ` Takashi Iwai

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.