Skip to contentSkip to conversation

AT91SAM9G20-EK and aplay

Buildroot Carlo Rajko 5 participants 12 messages May 24, 2013 – Jul 4, 2013

lore
Share & tools
lore
#0 lore raw

Hello,

I have a board AT91SAM9G20-EK Rev C.

With buildroot-2013.02 use kernel 3.1.6 and use toolchain CODESOURCERY_ARM201203

The kernel detects sound card, but when use prg aplay or use mpg123 to play a file, receive a "Segmentation fault"

if I run the command "cat file.wav > /dev/dsp" the sound card works fine.

With buildroot-2011.11 is all ok.

Can you help me ?

Best regards,
carlo

#1 lore raw

Dear Carlo Rajko,

Quoted 11 lines · Carlo Rajko

With buildroot-2013.02 use kernel 3.1.6 and use toolchain CODESOURCERY_ARM201203

The kernel detects sound card, but when use prg aplay or use mpg123 to play a file, receive a "Segmentation fault"

if I run the command "cat file.wav > /dev/dsp" the sound card works fine.

With buildroot-2011.11 is all ok.

Can you help me ?

Do you have a few more messages in the kernel logs that given more details about the segmentation fault?

Otherwise, do "ulimit -c unlimited", run the crashing application, it will generate a 'core' file. Transfer it to your development PC, and run cross-gdb on it:

./output/host/usr/bin/arm-linux-gdb -c core ./output/target/usr/bin/aplay

and then see what's the reason of the segmentation fault.

Also, could you post on http://code.bulix.org your Buildroot .config and give us the link? Just to check there isn't anything obviously wrong in your configuration file.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

Il 24/05/2013 10:05, Thomas Petazzoni ha scritto:

Quoted 10 lines

Dear Carlo Rajko,

Quoted 6 lines · Carlo Rajko

With buildroot-2013.02 use kernel 3.1.6 and use toolchain CODESOURCERY_ARM201203

The kernel detects sound card, but when use prg aplay or use mpg123 to play a file, receive a "Segmentation fault"

Quoted 8 lines
Quoted 5 lines

if I run the command "cat file.wav > /dev/dsp" the sound card works fine.

With buildroot-2011.11 is all ok.

Can you help me ?

Do you have a few more messages in the kernel logs that given more details about the segmentation fault?

no message

Quoted 8 lines

Otherwise, do "ulimit -c unlimited", run the crashing application, it will generate a 'core' file. Transfer it to your development PC, and run cross-gdb on it:

./output/host/usr/bin/arm-linux-gdb -c core ./output/target/usr/bin/aplay

and then see what's the reason of the segmentation fault.

I do not have arm-linux-gdb but have arm-none-linux-gnueabi-gdb. But when use the command ./output/host/opt/ext-toolchain/bin/arm-none-linux-gnueabi-gdb -c core ./output/target/usr/bin/aplay and use command "run" the debugger show:
Don't know how to run. Try "help target".

I think the problem is not in aply because I have the same problem with mpg123.
Could be the library alsa?

Quoted 4 lines

Also, could you post on http://code.bulix.org your Buildroot .config and give us the link? Just to check there isn't anything obviously wrong in your configuration file.

when I press buttom "PASTE" I have error "Antispam verification failed"

Best regards,

Carlo

#3 lore raw

Dear Carlo Rajko,

Quoted 5 lines · Carlo Rajko

I do not have arm-linux-gdb but have arm-none-linux-gnueabi-gdb. But when use the command ./output/host/opt/ext-toolchain/bin/arm-none-linux-gnueabi-gdb -c core ./output/target/usr/bin/aplay and use command "run" the debugger show:
Don't know how to run. Try "help target".

Don't use "run", "run" is to start the program. Here we want to do a post-mortem analysis of the crash using the core file. Google "gdb core file" to have more details about what a core file is.

Can you run the gdb command, and copy/paste what you see? Without entering any command *inside* gdb, it should already tell you which instruction has faulted, and for what reason.

Quoted 3 lines

I think the problem is not in aply because I have the same problem with mpg123.
Could be the library alsa?

It could. But at least gdb will tell us if it's an undefined instruction, an invalid memory access, an unaligned access, or something else.

Quoted 5 lines
Quoted 3 lines

Also, could you post on http://code.bulix.org your Buildroot .config and give us the link? Just to check there isn't anything obviously wrong in your configuration file.

when I press buttom "PASTE" I have error "Antispam verification failed"

Right left to the "Paste" button there is a little box to train your mental calculation. You should pay attention to it :-)

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

Il 24/05/2013 11:23, Thomas Petazzoni ha scritto:

Quoted 11 lines

Dear Carlo Rajko,

Quoted 5 lines · Carlo Rajko

I do not have arm-linux-gdb but have arm-none-linux-gnueabi-gdb. But when use the command ./output/host/opt/ext-toolchain/bin/arm-none-linux-gnueabi-gdb -c core ./output/target/usr/bin/aplay and use command "run" the debugger show:
Don't know how to run. Try "help target".

Quoted 8 lines

Don't use "run", "run" is to start the program. Here we want to do a post-mortem analysis of the crash using the core file. Google "gdb core file" to have more details about what a core file is.

Can you run the gdb command, and copy/paste what you see? Without entering any command *inside* gdb, it should already tell you which instruction has faulted, and for what reason.

OK.

GNU gdb (Sourcery CodeBench Lite 2012.03-57) 7.2.50.20100908-cvs Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi".
For bug reporting instructions, please see:
<https://support.codesourcery.com/GNUToolchain/>...
Reading symbols from /home/carlo/debug/aplay...(no debugging symbols found)...done.

warning: exec file is newer than core file.
[New LWP 524]
Reading symbols from /home/carlo/debug/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /home/carlo/debug/librt.so.1
Reading symbols from /home/carlo/debug/libasound.so.2...(no debugging symbols found)...done.
Loaded symbols for /home/carlo/debug/libasound.so.2
Reading symbols from /home/carlo/debug/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /home/carlo/debug/libm.so.6
Reading symbols from /home/carlo/debug/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /home/carlo/debug/libdl.so.2
Reading symbols from /home/carlo/debug/libpthread.so.0...(no debugging symbols found)...done.
Loaded symbols for /home/carlo/debug/libpthread.so.0
Reading symbols from /home/carlo/debug/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /home/carlo/debug/libgcc_s.so.1
Reading symbols from /home/carlo/debug/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /home/carlo/debug/libc.so.6
Reading symbols from /home/carlo/debug/ld-linux.so.3...(no debugging symbols found)...done.
Loaded symbols for /home/carlo/debug/ld-linux.so.3
Core was generated by `/mnt/2/sox/aplay'.
Program terminated with signal 11, Segmentation fault.
#0 0x400f31cc in ?? () from /home/carlo/debug/ld-linux.so.3 (gdb)

Quoted 8 lines
Quoted 3 lines

I think the problem is not in aply because I have the same problem with mpg123.
Could be the library alsa?

It could. But at least gdb will tell us if it's an undefined instruction, an invalid memory access, an unaligned access, or something else.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Also, could you post on http://code.bulix.org your Buildroot .config and give us the link? Just to check there isn't anything obviously wrong in your configuration file.

when I press buttom "PASTE" I have error "Antispam verification failed"

Right left to the "Paste" button there is a little box to train your mental calculation. You should pay attention to it :-)

OK, sorry.

http://code.bulix.org/bazvmv-83592?raw

Best regards,

Carlo

#5 lore raw
Quoted 7 lines · Carlo Rajko
Quoted 7 lines
Quoted 3 lines

I think the problem is not in aply because I have the same problem with mpg123.
Could be the library alsa?

It could. But at least gdb will tell us if it's an undefined instruction, an invalid memory access, an unaligned access, or something else.

Actually it's the toolchain, seems CS 2012.03 isn't emitting proper arm926ej-s code.
I've managed to reproduce it with the qemu_arm_versatile sample configuration and adding a bunch of packages (mpg123, vorbis-tools, ...) It did strike me as odd that i've got the same failures as yours (aplay, mpg123) but ogg123 worked fine with alsa output.
So switching to an internal toolchain or CS 2011.09 magically fixed the issues.
Regards.

#6 lore raw

Il 24/05/2013 14:50, Gustavo Zacarias ha scritto:

Quoted 9 lines · Carlo Rajko
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

I think the problem is not in aply because I have the same problem with mpg123.
Could be the library alsa?

It could. But at least gdb will tell us if it's an undefined instruction, an invalid memory access, an unaligned access, or something else.

Quoted 10 lines

Actually it's the toolchain, seems CS 2012.03 isn't emitting proper arm926ej-s code.
I've managed to reproduce it with the qemu_arm_versatile sample configuration and adding a bunch of packages (mpg123, vorbis-tools, ...) It did strike me as odd that i've got the same failures as yours (aplay, mpg123) but ogg123 worked fine with alsa output.
So switching to an internal toolchain or CS 2011.09 magically fixed the issues.
Regards.

I switch to CS 2011.09 and now is ok, thanks.

Regards
Carlo

#7 lore raw

Dear Carlo Rajko,

Quoted 10 lines · Carlo Rajko
Quoted 8 lines

Actually it's the toolchain, seems CS 2012.03 isn't emitting proper arm926ej-s code.
I've managed to reproduce it with the qemu_arm_versatile sample configuration and adding a bunch of packages (mpg123, vorbis-tools, ...) It did strike me as odd that i've got the same failures as yours (aplay, mpg123) but ogg123 worked fine with alsa output.
So switching to an internal toolchain or CS 2011.09 magically fixed the issues.

I switch to CS 2011.09 and now is ok, thanks.

It's a problem worth reporting to Mentor Graphics, IMO.

Even though I doubt anything will happen, last time I reported a bug, nothing really happened, unfortunately.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#8 lore raw

Il 27/05/2013 11:16, Thomas Petazzoni ha scritto:

Quoted 13 lines

Dear Carlo Rajko,

Quoted 9 lines · Carlo Rajko
Quoted 8 lines

Actually it's the toolchain, seems CS 2012.03 isn't emitting proper arm926ej-s code.
I've managed to reproduce it with the qemu_arm_versatile sample configuration and adding a bunch of packages (mpg123, vorbis-tools, ...) It did strike me as odd that i've got the same failures as yours (aplay, mpg123) but ogg123 worked fine with alsa output.
So switching to an internal toolchain or CS 2011.09 magically fixed the issues.

Quoted 6 lines
Quoted 1 line

I switch to CS 2011.09 and now is ok, thanks.

It's a problem worth reporting to Mentor Graphics, IMO.

Even though I doubt anything will happen, last time I reported a bug, nothing really happened, unfortunately.

I'll try with the new version 2013.05, just available in the package buildroot, maybe the problem is already solved.

Regards,
Carlo

#9 lore raw
Quoted 16 lines · Carlo Rajko

Il 27/05/2013 11:16, Thomas Petazzoni ha scritto:

Quoted 15 lines

Dear Carlo Rajko,

Quoted 10 lines · Carlo Rajko
Quoted 8 lines

Actually it's the toolchain, seems CS 2012.03 isn't emitting proper arm926ej-s code.
I've managed to reproduce it with the qemu_arm_versatile sample configuration and adding a bunch of packages (mpg123, vorbis-tools, ...) It did strike me as odd that i've got the same failures as yours (aplay, mpg123) but ogg123 worked fine with alsa output.
So switching to an internal toolchain or CS 2011.09 magically fixed the issues.

I switch to CS 2011.09 and now is ok, thanks.

Quoted 7 lines
Quoted 4 lines

It's a problem worth reporting to Mentor Graphics, IMO.

Even though I doubt anything will happen, last time I reported a bug, nothing really happened, unfortunately.

I'll try with the new version 2013.05, just available in the package buildroot, maybe the problem is already solved.

We should probably blacklist the failing CS toolchains for the
arm926ej-s, then.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#10 lore raw

Il 28/05/2013 19:02, Arnout Vandecappelle ha scritto:

Quoted 22 lines · Carlo Rajko
Quoted 21 lines

Il 27/05/2013 11:16, Thomas Petazzoni ha scritto:

Quoted 20 lines

Dear Carlo Rajko,

Quoted 12 lines · Carlo Rajko
Quoted 11 lines

Actually it's the toolchain, seems CS 2012.03 isn't emitting proper arm926ej-s code.
I've managed to reproduce it with the qemu_arm_versatile sample configuration and adding a bunch of packages (mpg123, vorbis-tools, ...)
It did strike me as odd that i've got the same failures as yours (aplay,
mpg123) but ogg123 worked fine with alsa output.
So switching to an internal toolchain or CS 2011.09 magically fixed the
issues.

Quoted 1 line

I switch to CS 2011.09 and now is ok, thanks.

It's a problem worth reporting to Mentor Graphics, IMO.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Even though I doubt anything will happen, last time I reported a bug, nothing really happened, unfortunately.

I'll try with the new version 2013.05, just available in the package buildroot, maybe the problem is already solved.

We should probably blacklist the failing CS toolchains for the
arm926ej-s, then.

I tried version CS 2013.05 successfully for my problem. But there could be other hidden problems

Regards,
Carlo

#11 lore raw
In reply to Gustavo Zacarias
Quoted 9 lines · Gustavo Zacarias
Quoted 7 lines · Carlo Rajko
Quoted 7 lines
Quoted 3 lines

I think the problem is not in aply because I have the same problem with mpg123.
Could be the library alsa?

It could. But at least gdb will tell us if it's an undefined instruction, an invalid memory access, an unaligned access, or something else.

Quoted 10 lines

Actually it's the toolchain, seems CS 2012.03 isn't emitting proper arm926ej-s code.
I've managed to reproduce it with the qemu_arm_versatile sample configuration and adding a bunch of packages (mpg123, vorbis-tools, ...) It did strike me as odd that i've got the same failures as yours (aplay, mpg123) but ogg123 worked fine with alsa output.
So switching to an internal toolchain or CS 2011.09 magically fixed the issues.
Regards.

Hi,

I have segfault issue with aplay on Buildroot generated image x86 with Linux kernel 2.6.35.
I found some post where modification of Linux kernel source helps
http://permalink.gmane.org/gmane.linux.alsa.devel/86868. Could it be related to my problem?

Here are my logs, please ask for more details you need:

*******************************************************************************
GDB backtrace:
*******************************************************************************
prs at none:~$ gdb aplay
GNU gdb (GDB) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details.
This GDB was configured as "i686-buildroot-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/aplay...done.
(gdb) r
Starting program: /usr/bin/aplay
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault. 0xb774f39d in ?? () from /lib/ld-linux.so.2 (gdb) bt

#0  0xb774f39d in ?? () from /lib/ld-linux.so.2
#1  0xb774fb09 in ?? () from /lib/ld-linux.so.2
#2  0xb758e5a0 in ?? () from /lib/libc.so.6
#3  0xb758ea27 in _dl_sym () from /lib/libc.so.6
#4  0xb761cd36 in ?? () from /lib/libdl.so.2
#5  0xb775479f in ?? () from /lib/ld-linux.so.2
#6  0xb761d30a in ?? () from /lib/libdl.so.2
#7  0xb761cdb4 in dlsym () from /lib/libdl.so.2
#8  0xb767595a in snd_dlsym_verify () from /usr/lib/libasound.so.2
#9  0xb7675a3f in snd_dlsym () from /usr/lib/libasound.so.2

#10 0xb7671ce2 in _snd_config_evaluate () from /usr/lib/libasound.so.2 #11 0xb767019d in snd_config_walk () from /usr/lib/libasound.so.2 #12 0xb76701ff in snd_config_walk () from /usr/lib/libasound.so.2 #13 0xb76710c7 in snd_config_expand () from /usr/lib/libasound.so.2 #14 0xb767129e in snd_config_hook_load () from /usr/lib/libasound.so.2 #15 0xb76718fd in snd_config_hook_load_for_all_cards () from /usr/lib/libasound.so.2
#16 0xb76722c5 in snd_config_hooks.constprop.24 () from /usr/lib/libasound.so.2
#17 0xb76724d6 in snd_config_searcha_hooks () from /usr/lib/libasound.so.2 #18 0xb7672652 in snd1_config_search_alias_hooks () from /usr/lib/libasound.so.2
#19 0xb76719cb in snd_config_search_definition () from /usr/lib/libasound.so.2
#20 0xb768946f in snd_pcm_open_noupdate () from /usr/lib/libasound.so.2 #21 0x08050a09 in main ()
(gdb)

*******************************************************************************
soundcard details:
*******************************************************************************
$cat /proc/asound/cards
0 [Intel ]: HDA-Intel - HDA Intel

                       HDA Intel at 0xfdff4000 irq 44
  1 [USB            ]: USB-Audio - Aureon 7.1 USB
                       Aureon 7.1 USB at usb-0000:00:1d.2-2, full speed

Regards,
Aleksandar