* [Buildroot] abi problem with arm [solves alsa-lib invalid ioctl]
@ 2007-11-22 15:43 ing. Federico Fuga
2007-11-24 13:53 ` Ivan Kuten
2007-11-28 7:01 ` Ulf Samuelsson
0 siblings, 2 replies; 4+ messages in thread
From: ing. Federico Fuga @ 2007-11-22 15:43 UTC (permalink / raw)
To: buildroot
Hi,
I have found and solved the problem that breaks the ioctl of alsa-lib in
arm.
Just a little preamble:
when compiling with arm xscale on an em-x270 board, all the installation
works correctly except that the alsactl cannot set the volume levels of
mixer:
# alsactl restore
unknown ioctl = 0xc2c45513 ioctl ELEM_WRITE=0xc2c85513 struct 712
alsactl: set_control:1159: Cannot write control '2:0:0:Speaker Playback
Volume:0' : Inappropriate ioctl for device
(note that the "unknown ioctl" message is a debug message i put on the
sound/core/control.c source to get rid of the problem).
If you compile a simple program that prints the ioctl and sizeof struct
snd_ctl_elem_value, you'll notice that the structure size is 708 in this
case.
As someone pointed out, there may be an alignment problem problem in the
structure when compiled with the toolchain.
The strange thing is that a kernel compiled with this toolchain
(arm-linux-uclibc) works perfectly with all programs except that alsa,
and that if you run that kernel with a file system and alsa compiled
with glibc (angstrom linux) alsactl works perfectly.
So after 5 days of digging, I found that the alsa drivers in the kernel
are compiled with the -mabi=aapcs-linux option in gcc.
If I add that option to CFLAGS in the alsa-lib configure script and
compile, alsactl works perfectly!
So I suggest to put the option
-mabi=aapcs-linux
to all the compilation of uclibc and buildroot.
I would propose the patch, but I do not know where to put the option in
the scripts/configuration.
Hope that helps,
Federico Fuga
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] abi problem with arm [solves alsa-lib invalid ioctl]
2007-11-22 15:43 [Buildroot] abi problem with arm [solves alsa-lib invalid ioctl] ing. Federico Fuga
@ 2007-11-24 13:53 ` Ivan Kuten
2007-11-24 15:12 ` ing. Federico Fuga
2007-11-28 7:01 ` Ulf Samuelsson
1 sibling, 1 reply; 4+ messages in thread
From: Ivan Kuten @ 2007-11-24 13:53 UTC (permalink / raw)
To: buildroot
ing. Federico Fuga wrote:
> Hi,
>
> I have found and solved the problem that breaks the ioctl of alsa-lib in
> arm.
> Just a little preamble:
>
> when compiling with arm xscale on an em-x270 board, all the installation
> works correctly except that the alsactl cannot set the volume levels of
> mixer:
>
> # alsactl restore
> unknown ioctl = 0xc2c45513 ioctl ELEM_WRITE=0xc2c85513 struct 712
> alsactl: set_control:1159: Cannot write control '2:0:0:Speaker Playback
> Volume:0' : Inappropriate ioctl for device
>
> (note that the "unknown ioctl" message is a debug message i put on the
> sound/core/control.c source to get rid of the problem).
> If you compile a simple program that prints the ioctl and sizeof struct
> snd_ctl_elem_value, you'll notice that the structure size is 708 in this
> case.
> As someone pointed out, there may be an alignment problem problem in the
> structure when compiled with the toolchain.
> The strange thing is that a kernel compiled with this toolchain
> (arm-linux-uclibc) works perfectly with all programs except that alsa,
> and that if you run that kernel with a file system and alsa compiled
> with glibc (angstrom linux) alsactl works perfectly.
> So after 5 days of digging, I found that the alsa drivers in the kernel
> are compiled with the -mabi=aapcs-linux option in gcc.
> If I add that option to CFLAGS in the alsa-lib configure script and
> compile, alsactl works perfectly!
> So I suggest to put the option
>
> -mabi=aapcs-linux
>
> to all the compilation of uclibc and buildroot.
> I would propose the patch, but I do not know where to put the option in
> the scripts/configuration.
> Hope that helps,
>
> Federico Fuga
>
>
Yes, I can confirm that adding
CFLAGS="$(TARGET_CFLAGS) -mabi=aapcs-linux"
to alsa_utils.mk and alsa-utils.mk indeed fixes a problem for ARM (tested on ARM920T Cirrus Logic CPU)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] abi problem with arm [solves alsa-lib invalid ioctl]
2007-11-24 13:53 ` Ivan Kuten
@ 2007-11-24 15:12 ` ing. Federico Fuga
0 siblings, 0 replies; 4+ messages in thread
From: ing. Federico Fuga @ 2007-11-24 15:12 UTC (permalink / raw)
To: buildroot
Ivan Kuten ha scritto:
> Yes, I can confirm that adding
>
> CFLAGS="$(TARGET_CFLAGS) -mabi=aapcs-linux"
>
> to alsa_utils.mk and alsa-utils.mk indeed fixes a problem for ARM (tested on ARM920T Cirrus Logic CPU)
>
> >From my point of view this option should be added to alsa only, not whole uclibc&buildroot.
>
>
I forgot to mention that I already did the test by adding
-mabi=aapcs-linux to the "optimization flags" in the buildroot
configuration, but this broke all the system: for example, a simple ls
reported all the files in the filesystem to be 4096 bytes long.
> Regards,
> Ivan
>
Regards
Federico
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] abi problem with arm [solves alsa-lib invalid ioctl]
2007-11-22 15:43 [Buildroot] abi problem with arm [solves alsa-lib invalid ioctl] ing. Federico Fuga
2007-11-24 13:53 ` Ivan Kuten
@ 2007-11-28 7:01 ` Ulf Samuelsson
1 sibling, 0 replies; 4+ messages in thread
From: Ulf Samuelsson @ 2007-11-28 7:01 UTC (permalink / raw)
To: buildroot
tor 2007-11-22 klockan 16:43 +0100 skrev ing. Federico Fuga:
> Hi,
>
> I have found and solved the problem that breaks the ioctl of alsa-lib in
> arm.
> Just a little preamble:
>
> when compiling with arm xscale on an em-x270 board, all the installation
> works correctly except that the alsactl cannot set the volume levels of
> mixer:
>
> # alsactl restore
> unknown ioctl = 0xc2c45513 ioctl ELEM_WRITE=0xc2c85513 struct 712
> alsactl: set_control:1159: Cannot write control '2:0:0:Speaker Playback
> Volume:0' : Inappropriate ioctl for device
>
> (note that the "unknown ioctl" message is a debug message i put on the
> sound/core/control.c source to get rid of the problem).
> If you compile a simple program that prints the ioctl and sizeof struct
> snd_ctl_elem_value, you'll notice that the structure size is 708 in this
> case.
> As someone pointed out, there may be an alignment problem problem in the
> structure when compiled with the toolchain.
> The strange thing is that a kernel compiled with this toolchain
> (arm-linux-uclibc) works perfectly with all programs except that alsa,
> and that if you run that kernel with a file system and alsa compiled
> with glibc (angstrom linux) alsactl works perfectly.
> So after 5 days of digging, I found that the alsa drivers in the kernel
> are compiled with the -mabi=aapcs-linux option in gcc.
> If I add that option to CFLAGS in the alsa-lib configure script and
> compile, alsactl works perfectly!
> So I suggest to put the option
>
> -mabi=aapcs-linux
>
> to all the compilation of uclibc and buildroot.
> I would propose the patch, but I do not know where to put the option in
> the scripts/configuration.
> Hope that helps,
>
I added this to the 'alsa-lib' build
Available in revision 20557 and later.
> Federico Fuga
>
>
> _______________________________________________
> buildroot mailing list
> buildroot at uclibc.org
> http://busybox.net/mailman/listinfo/buildroot
--
Best Regards
Ulf Samuelsson
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-11-28 7:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-22 15:43 [Buildroot] abi problem with arm [solves alsa-lib invalid ioctl] ing. Federico Fuga
2007-11-24 13:53 ` Ivan Kuten
2007-11-24 15:12 ` ing. Federico Fuga
2007-11-28 7:01 ` Ulf Samuelsson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox