[alsa-devel] Errors in application building

Paul Kavan pkavan at gmail.com
Wed Jul 11 19:30:34 CEST 2007


Hello All:

Okay, I have progressed past the segfault issue. Definitely was the lack of
-lpthread in the compile. Now I have the code in place to do a simple
read/write operation to ensure I can make the application capture and play
audio. I copied some example code and am trying to get it to work. I can
scope my pcm interface and it appears to be working, but no audio as of yet.
I am not sure how ALSA is dealing with the audio buffer, so it may be a
fundamental problem with that. It may also be the way I am setting the
parameters. Both arecord and aplay work just fine, so I do not believe it is
a hardware or driver issue.

For clarity, I am using ALSA 1.0.14a with an ARM9 processor using the SoC
driver package and a custom machine/codec driver for an at91sam9260ek dev
board and winbond w6811 codec. It is a simple pcm, mono, 8k codec. My params
are:

Access Type: SND_PCM_ACCESS_RW_INTERLEAVED
Sample Format: SND_PCM_FORMAT_S8
Sample Rate: 8000
Channel Count: 1

My code is attached. Through gdb I get the following:

--snip--
~ $ gdb grh_audio


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) break 131
Breakpoint 1 at 0x8f50: file grh_audio0.c, line 131.
(gdb) break 214
Breakpoint 2 at 0x9364: file grh_audio0.c, line 214.
(gdb) display buf
(gdb) start
Breakpoint 3 at 0x8a8c: file grh_audio0.c, line 33.
Starting program: /usr/sbin/grh_audio
main () at grh_audio0.c:33
33      grh_audio0.c: No such file or directory.
        in grh_audio0.c
1: buf = {0 <repeats 512 times>}
(gdb) continue
Continuing.
Press enter to begin recording


Breakpoint 1, grh_capture () at grh_audio0.c:131
131     in grh_audio0.c
1: buf = {-776, -772, -1796, -2056, -1800, -263, -1, -1, -1, -1, -1793, -4,
  -4, -772, -4, -769, -1, -1, -1, -1, -1, -769, -772, -772, -776, -770, -4,
  -770, -1, -1, -1, -1, -1, -1, -1794, -1801, -1801, -1544, -1, -1, -769,
  -257, -1, -1, -1, -4, -1800, -1800, -776, -1, -2, -4, -257, -2, -1, -1,
-1,
  -1, -769, -260, -257, -769, -4, -1, -1, -1, -1, -769, -1, -4, -769, -2,
  -1800, -2057, -1800, -4, -770, -772, -772, -2, -1, -1, -769, -775, -1799,
  -260, -2, -1, -1, -1, -1, -257, -769, -1796, -264, -1, -1, -264, -769,
  -769, -1, -1, -1, -1, -1, -772, -4, -1801, -3080, -1800, -772, -1, -258,
  -769, -4, -776, -769, -1, -1, -770, -772, -1, -1, -1, -769, -1, -1, -1,
-1,
  -1, -1, -260, -2, -1, -1, -258, -2, -260, -1537, -1800, -1544, -772, -769,

  -1, -769, -1540, -769, -2, -1, -1, -769, -260, -260, -1540, -260, -257,
-2,
  -769, -1, -1, -1, -770, -2056, -8, -257, -2, -7, -1, -1, -1, -1, -1, -2,
  -1, -1, -1793, -1796, -1801, -772, -8, -1, -1537, -1799, -775, -1, -1, -1,

  -4, -260, -769, -2, -1, -257, -769, -1, -1, -1, -769, -1793, -775...}
(gdb) continue
Continuing.
Audio Captured. Press enter to playback


Breakpoint 2, grh_playback () at grh_audio0.c:214
214     in grh_audio0.c
1: buf = {-776, -772, -1796, -2056, -1800, -263, -1, -1, -1, -1, -1793, -4,
  -4, -772, -4, -769, -1, -1, -1, -1, -1, -769, -772, -772, -776, -770, -4,
  -770, -1, -1, -1, -1, -1, -1, -1794, -1801, -1801, -1544, -1, -1, -769,
  -257, -1, -1, -1, -4, -1800, -1800, -776, -1, -2, -4, -257, -2, -1, -1,
-1,
  -1, -769, -260, -257, -769, -4, -1, -1, -1, -1, -769, -1, -4, -769, -2,
  -1800, -2057, -1800, -4, -770, -772, -772, -2, -1, -1, -769, -775, -1799,
  -260, -2, -1, -1, -1, -1, -257, -769, -1796, -264, -1, -1, -264, -769,
  -769, -1, -1, -1, -1, -1, -772, -4, -1801, -3080, -1800, -772, -1, -258,
  -769, -4, -776, -769, -1, -1, -770, -772, -1, -1, -1, -769, -1, -1, -1,
-1,
  -1, -1, -260, -2, -1, -1, -258, -2, -260, -1537, -1800, -1544, -772, -769,

  -1, -769, -1540, -769, -2, -1, -1, -769, -260, -260, -1540, -260, -257,
-2,
  -769, -1, -1, -1, -770, -2056, -8, -257, -2, -7, -1, -1, -1, -1, -1, -2,
  -1, -1, -1793, -1796, -1801, -772, -8, -1, -1537, -1799, -775, -1, -1, -1,

  -4, -260, -769, -2, -1, -257, -769, -1, -1, -1, -769, -1793, -775...}
(gdb) quit
The program is running.  Exit anyway? (y or n) y
~ $
--snip--






-- 
***************************************
Paul David Kavan
Project Engineer
GRH Electronics, Inc.
402-734-4900
pkavan at gmail.com
***************************************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grh_audio0.c
Type: text/x-csrc
Size: 6660 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20070711/4fbcd937/attachment.c 


More information about the Alsa-devel mailing list