Okay, I have the libthread_db issue somewhat resolved. The error in dlopen still pops up, but it is working. I trimmed my code down to see if I could determine the problem and I think I know where it is at, but not why or how to resolve it.
My code looks like this:
/*************************************************************************/ #include <stdio.h> #include <alsa/asoundlib.h>
/************************************* * Variable and Function Declarations *************************************/ int audio_type; //0 = sleep; 1 = capture; 2 = playback int nchannels = 1; int buffer_size = 512; unsigned int sample_rate = 8000; int bits = 8; char *snd_device_in = "hw:0,0"; char *snd_device_out = "hw:0,0";
/************************************* * Main Program Section *************************************/ int main(void) { //Testing routine printf("Press enter to begin recording\n"); getchar(); //grh_capture(); printf("Audio Captured. Press enter to playback\n"); getchar();
return 0; } /*************************************************************************/
When I attempt to run I get a segmentation fault. With GDB, I am getting:
/*************************************************************************/ /usr/sbin $ gdb grh_audio0
dlopen failed on 'libthread_db.so.1' - File not found GDB will not be able to debug pthreads.
GNU gdb 6.4 Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "arm-linux-uclibc"... (gdb) start Breakpoint 1 at 0x8604: file grh_audio0.c, line 27. Starting program: /usr/sbin/grh_audio0
Program received signal SIGSEGV, Segmentation fault. 0x40124ab8 in _pthread_cleanup_push_defer () from /lib/libc.so.0 (gdb) continue Continuing.
Program terminated with signal SIGSEGV, Segmentation fault. The program no longer exists. (gdb) /*************************************************************************/
Do the alsa libraries link to pthread? If so, I should probably be compiling with -lpthread. Does anyone else see something I am missing that could be causing the segfault?
Thanks.
Paul
*************************************** Paul David Kavan Project Engineer GRH Electronics, Inc. 402-734-4900 pkavan@gmail.com ***************************************