* Using GDB for ALSA How to?
@ 2008-09-01 20:19 William Estrada
2008-09-01 20:24 ` Jan-Benedict Glaw
0 siblings, 1 reply; 6+ messages in thread
From: William Estrada @ 2008-09-01 20:19 UTC (permalink / raw)
To: alsa-devel@alsa-project.org
Hi group,
I am trying to use GDB with my ALSA program. I wish to display (print)
a handle for
an snd_pcm_t pointer. I am getting the following error:
> (gdb) p Device
> $9 = (snd_pcm_t *) 0x92be458
> (gdb) p *Device
> $10 = <incomplete type>
How do I display the snd_pcm_t structure?
Thanks for your time.
--
William Estrada
MrUmunhum@popdial.com
Mt-Umunhum-Wireless.net ( http://Mt-Umunhum-Wireless.net )
Ymessenger: MrUmunhum
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Using GDB for ALSA How to?
2008-09-01 20:19 Using GDB for ALSA How to? William Estrada
@ 2008-09-01 20:24 ` Jan-Benedict Glaw
2008-09-01 20:33 ` William Estrada
0 siblings, 1 reply; 6+ messages in thread
From: Jan-Benedict Glaw @ 2008-09-01 20:24 UTC (permalink / raw)
To: William Estrada; +Cc: alsa-devel@alsa-project.org
[-- Attachment #1.1: Type: text/plain, Size: 751 bytes --]
On Mon, 2008-09-01 13:19:54 -0700, William Estrada <MrUmunhum@popdial.com> wrote:
> I am trying to use GDB with my ALSA program. I wish to display (print)
> a handle for
> an snd_pcm_t pointer. I am getting the following error:
> > (gdb) p Device
> > $9 = (snd_pcm_t *) 0x92be458
> > (gdb) p *Device
> > $10 = <incomplete type>
> How do I display the snd_pcm_t structure?
My guess is that this pointer is simply uninitialized. Did you check
that it was properly prepared?
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de +49-172-7608481
Signature of: What we do for ourselves dies with us. What we do for
the second : others and the world remains and is immortal. (Albert Pine)
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Using GDB for ALSA How to?
2008-09-01 20:24 ` Jan-Benedict Glaw
@ 2008-09-01 20:33 ` William Estrada
2008-09-01 21:13 ` Jan-Benedict Glaw
0 siblings, 1 reply; 6+ messages in thread
From: William Estrada @ 2008-09-01 20:33 UTC (permalink / raw)
To: William Estrada, alsa-devel@alsa-project.org
Yes, the device is opened. Is that what you mean??
Jan-Benedict Glaw wrote:
> On Mon, 2008-09-01 13:19:54 -0700, William Estrada <MrUmunhum@popdial.com> wrote:
>
>> I am trying to use GDB with my ALSA program. I wish to display (print)
>> a handle for
>> an snd_pcm_t pointer. I am getting the following error:
>>
>>> (gdb) p Device
>>> $9 = (snd_pcm_t *) 0x92be458
>>> (gdb) p *Device
>>> $10 = <incomplete type>
>>>
>> How do I display the snd_pcm_t structure?
>>
>
> My guess is that this pointer is simply uninitialized. Did you check
> that it was properly prepared?
>
> MfG, JBG
>
>
--
William Estrada
MrUmunhum@popdial.com
Mt-Umunhum-Wireless.net ( http://Mt-Umunhum-Wireless.net )
Ymessenger: MrUmunhum
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Using GDB for ALSA How to?
2008-09-01 20:33 ` William Estrada
@ 2008-09-01 21:13 ` Jan-Benedict Glaw
2008-09-02 7:08 ` Jan-Benedict Glaw
0 siblings, 1 reply; 6+ messages in thread
From: Jan-Benedict Glaw @ 2008-09-01 21:13 UTC (permalink / raw)
To: William Estrada; +Cc: alsa-devel@alsa-project.org
[-- Attachment #1.1: Type: text/plain, Size: 1281 bytes --]
On Mon, 2008-09-01 13:33:28 -0700, William Estrada <MrUmunhum@popdial.com> wrote:
> Jan-Benedict Glaw wrote:
> > On Mon, 2008-09-01 13:19:54 -0700, William Estrada <MrUmunhum@popdial.com> wrote:
> > > I am trying to use GDB with my ALSA program. I wish to display (print)
> > > a handle for
> > > an snd_pcm_t pointer. I am getting the following error:
> > >
> > > > (gdb) p Device
> > > > $9 = (snd_pcm_t *) 0x92be458
> > > > (gdb) p *Device
> > > > $10 = <incomplete type>
> > >
> > > How do I display the snd_pcm_t structure?
> >
> > My guess is that this pointer is simply uninitialized. Did you check
> > that it was properly prepared?
>
> Yes, the device is opened. Is that what you mean??
Partially. But I misread your log, too. Seems that gdb failed to
figure out how snd_pcm_t is actually defined. You'd try casting it to
struct _snd_pcm * if the type information got lost somewhere. (You'd
check the later by examining the `readelf -wi' output for your binary
or library you're hacking on.)
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de +49-172-7608481
Signature of: They that give up essential liberty to obtain temporary safety,
the second : deserve neither liberty nor safety. (Ben Franklin)
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Using GDB for ALSA How to?
2008-09-01 21:13 ` Jan-Benedict Glaw
@ 2008-09-02 7:08 ` Jan-Benedict Glaw
2008-09-04 22:11 ` William Estrada
0 siblings, 1 reply; 6+ messages in thread
From: Jan-Benedict Glaw @ 2008-09-02 7:08 UTC (permalink / raw)
To: William Estrada, alsa-devel@alsa-project.org
[-- Attachment #1.1: Type: text/plain, Size: 1375 bytes --]
On Mon, 2008-09-01 23:13:26 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> On Mon, 2008-09-01 13:33:28 -0700, William Estrada <MrUmunhum@popdial.com> wrote:
> > Jan-Benedict Glaw wrote:
> > > On Mon, 2008-09-01 13:19:54 -0700, William Estrada <MrUmunhum@popdial.com> wrote:
> > > > I am trying to use GDB with my ALSA program. I wish to display (print)
> > > > a handle for
> > > > an snd_pcm_t pointer. I am getting the following error:
> > > >
> > > > > (gdb) p Device
> > > > > $9 = (snd_pcm_t *) 0x92be458
> > > > > (gdb) p *Device
> > > > > $10 = <incomplete type>
> > > >
> > > > How do I display the snd_pcm_t structure?
So... Looking at it, snd_pcm_t is willfully specified as a hidden
struct, the real definition is only used where *really* needed, that
is: inside libasound2. It's in pcm_local.h, to not allow an arbitrary
user to easily fiddle with the lib's internal state.
As you want to peek into it, I guess you're facing a problem
somewhere. It would probably help if you describe your actual problem.
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de +49-172-7608481
Signature of: The real problem with C++ for kernel modules is:
the second : the language just sucks.
-- Linus Torvalds
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Using GDB for ALSA How to?
2008-09-02 7:08 ` Jan-Benedict Glaw
@ 2008-09-04 22:11 ` William Estrada
0 siblings, 0 replies; 6+ messages in thread
From: William Estrada @ 2008-09-04 22:11 UTC (permalink / raw)
To: alsa-devel@alsa-project.org
Jan,
I have several programs that use the ALSA interface, most work the way
they are supposed to.
The one that require real time record and then play back are not working
the way I want them
to, There is a 4.09 second delay in the read interrupt. I think it is
because the period value
of the handle is not being saved correctly? So I wrote a test program to
try and debug my
problem. It would be helpful if these structures where not hidden.
I wrote a test program to try and debug my problem. From the output I
can see that the data
in the handle is getting messed up? I am not sure if this is another
programming problem with
in the display program (status.c)? The program works but the delay makes
it unusable for my application.
'show_1' and 'show_2' are the same code just compiled differently.
The program(s) are
here: http://64.124.13.3/_ALSA_ along with the source. The output
<64.124.13.3/_ALSA_>of show_1 is:
> $ ./show_1
> 14:37:52.266 Display_Audio_From_Function
> Device: 8c477b8
> PCM Device name = 'default' PCM state = PREPARED
> access type = MMAP_NONINTERLEAV format = 'U8' (Unsigned
> 8 bit)
> subformat = 'STD' (Standard) channels = 1
> rate = 8000 bps period time = 10000 us
> period size = 80 frame buffer time = 8192000 us
> buffer size = 65536 frames periods/buffer = 819 frames
> exact rate = 8000/1 bps significant bits = 8000
> is batch = 0 is block transfer = 1
> is double = 0 is half duplex = 0
> is joint duplex = 0 can overrange = 0
> can mmap = 1 can pause = 0
> can resume = 1 can sync start = 1
> --------------------------------------------------------------------------------
> Device: 8c47b00
> PCM Device name = 'default' PCM state = PREPARED
> access type = MMAP_NONINTERLEAV format = 'U8' (Unsigned
> 8 bit)
> subformat = 'STD' (Standard) channels = 1
> rate = 8000 bps period time = 10000 us
> period size = 80 frame buffer time = 8192000 us
> buffer size = 65536 frames periods/buffer = 819 frames
> exact rate = 8000/1 bps significant bits = 8000
> is batch = 0 is block transfer = 1
> is double = 0 is half duplex = 0
> is joint duplex = 0 can overrange = 0
> can mmap = 1 can pause = 0
> can resume = 1 can sync start = 1
> --------------------------------------------------------------------------------
> 14:37:52.267 Voice On
> 14:37:52.267 Display_Audio_After_Function_Return
> Label: In, Device: 8c477b8
> PCM Device name = 'default' PCM state = PREPARED
> access type = (null) format = 'FLOAT_LE'
> (Float 32 bit Little Endian)
> subformat = 'STD' (Standard) channels = 0
> rate = 0 bps period time = -1081229612 us
> period size = 80 frame buffer time = 0 us
> buffer size = 0 frames periods/buffer = -1081229612 frames
> exact rate = 0/-1081229612 bps significant bits = 0
> is batch = 0 is block transfer = 1
> is double = 0 is half duplex = 0
> is joint duplex = 0 can overrange = 0
> can mmap = 0 can pause = 0
> can resume = 1 can sync start = 1
> --------------------------------------------------------------------------------
> Label: Out, Device: 8c47b00
> PCM Device name = 'default' PCM state = PREPARED
> access type = (null) format = 'FLOAT_LE'
> (Float 32 bit Little Endian)
> subformat = 'STD' (Standard) channels = 0
> rate = 0 bps period time = -1081229612 us
> period size = 80 frame buffer time = 0 us
> buffer size = 0 frames periods/buffer = -1081229612 frames
> exact rate = 0/-1081229612 bps significant bits = 0
> is batch = 0 is block transfer = 1
> is double = 0 is half duplex = 0
> is joint duplex = 0 can overrange = 0
> can mmap = 0 can pause = 0
> can resume = 1 can sync start = 1
> --------------------------------------------------------------------------------
> 14:37:52.284 Starting Callback
> 14:37:52.284 Sleep 5
> 14:37:56.380 Enter Callback
> Label: Callback, Device: 8c477b8
> PCM Device name = 'default' PCM state = RUNNING
> access type = (null) format = 'FLOAT_LE'
> (Float 32 bit Little Endian)
> subformat = 'STD' (Standard) channels = 0
> rate = 0 bps period time = -1081230956 us
> period size = 80 frame buffer time = 0 us
> buffer size = 0 frames periods/buffer = -1081230956 frames
> exact rate = 0/-1081230956 bps significant bits = 0
> is batch = 0 is block transfer = 1
> is double = 0 is half duplex = 0
> is joint duplex = 0 can overrange = 0
> can mmap = 0 can pause = 0
> can resume = 1 can sync start = 1
> --------------------------------------------------------------------------------
> 14:37:56.381 Audio Ready: 32768
> 14:37:56.381 Voice 1
> 14:38:00.479 Exit Callback
> 14:38:00.479 Voice off
> 14:38:05.486
> Exiting
If you have any ideas I would like to hear them.
Thanks again for your time.
Jan-Benedict Glaw wrote:
> On Mon, 2008-09-01 23:13:26 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
>> On Mon, 2008-09-01 13:33:28 -0700, William Estrada <MrUmunhum@popdial.com> wrote:
>>> Jan-Benedict Glaw wrote:
>>>> On Mon, 2008-09-01 13:19:54 -0700, William Estrada <MrUmunhum@popdial.com> wrote:
>>>>> I am trying to use GDB with my ALSA program. I wish to display (print)
>>>>> a handle for
>>>>> an snd_pcm_t pointer. I am getting the following error:
>>>>>
>>>>>> (gdb) p Device
>>>>>> $9 = (snd_pcm_t *) 0x92be458
>>>>>> (gdb) p *Device
>>>>>> $10 = <incomplete type>
>>>>> How do I display the snd_pcm_t structure?
>
> So... Looking at it, snd_pcm_t is willfully specified as a hidden
> struct, the real definition is only used where *really* needed, that
> is: inside libasound2. It's in pcm_local.h, to not allow an arbitrary
> user to easily fiddle with the lib's internal state.
>
> As you want to peek into it, I guess you're facing a problem
> somewhere. It would probably help if you describe your actual problem.
>
> MfG, JBG
>
--
William Estrada
MrUmunhum@popdial.com
Mt-Umunhum-Wireless.net ( http://Mt-Umunhum-Wireless.net )
Ymessenger: MrUmunhum
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-09-04 22:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-01 20:19 Using GDB for ALSA How to? William Estrada
2008-09-01 20:24 ` Jan-Benedict Glaw
2008-09-01 20:33 ` William Estrada
2008-09-01 21:13 ` Jan-Benedict Glaw
2008-09-02 7:08 ` Jan-Benedict Glaw
2008-09-04 22:11 ` William Estrada
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.