Skip to contentSkip to conversation

Timer.c does not compile?

DISCUSSION Agata Ma 2 participants 2 messages Sep 19, 2006

lore
Share & tools
lore

Agata Ma

author
#0 lore raw
Quoted 9 lines · Agata Ma

Hi,

I'm trying to understand what is the right functions to get the time
stamp related to the PCM frames.

Searching in Alsa code I found the file "timer.c"

http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2timer_8c-example.html

Quoted 4 lines

and I suppose it is related to what I need to do.

So I tried to compile it, but I get an error, it

seem

Quoted 5 lines

to me, the
compiler can't find the
"snd_async_add_timer_handler"..
The output:

Quoted 7 lines
dhcp78:~# gcc -Wall -lasound test_timer.c -o
test_timer
test_timer.c: In function `async_callback':
test_timer.c:60: warning: implicit declaration of
function
`snd_async_handler_get_timer'
test_timer.c:60: warning: initialization makes

pointer

Quoted 9 lines

from integer
without a cast
test_timer.c: In function `main':
test_timer.c:171: warning: implicit declaration of function
snd_async_add_timer_handler' /tmp/ccw926SP.o(.text 0x285): In function async_callback':
: undefined reference to

`snd_async_handler_get_timer'

Quoted 2 lines

/tmp/ccw926SP.o(.text 0x9e3): In function `main':
: undefined reference to

`snd_async_add_timer_handler'

Quoted 5 lines

collect2: ld returned 1 exit status
dhcp78:~#

I tried to perform a grep into Alsa source code but

I

Quoted 7 lines

did not found the
function "snd_async_add_timer_handler"...

Can someone help me...it is not trivial try to look into Alsa code for a
newb like me..

Quoted 6 lines

Thanks a lot
Agata

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam

protection around

Quoted 3 lines

http://mail.yahoo.com

-------------------------------------------------------------------------

Quoted 2 lines

Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get

the chance to share your

Quoted 1 line

opinions on IT & business topics through brief

surveys -- and earn cash

Quoted 1 line

http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

Quoted 4 lines

_______________________________________________
Alsa-devel mailing list
[email protected]

https://lists.sourceforge.net/lists/listinfo/alsa-devel

Quoted 2 lines

I have just found the solution.. and was very
trivial....I'm sorry to
have bored you :)

I would like to write this suggestions just for other newbs like me!
If interested read below, otherwise stop read. :)

As you can see in the example
http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2timer_8c-example.html

the include directives are:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include "../include/asoundlib.h"

The solutions was just to specify all the path to the "asoundlib.h"...
in my case:

#include "/usr/include/alsa/asoundlib.h"

and it compile without errors...

Bye
Agata

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#1 lore raw

At Tue, 19 Sep 2006 05:41:48 -0700 (PDT),

Quoted 102 lines · Agata Ma
Quoted 9 lines · Agata Ma

Hi,

I'm trying to understand what is the right functions to get the time
stamp related to the PCM frames.

Searching in Alsa code I found the file "timer.c"

http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2timer_8c-example.html

Quoted 4 lines

and I suppose it is related to what I need to do.

So I tried to compile it, but I get an error, it

seem

Quoted 5 lines

to me, the
compiler can't find the
"snd_async_add_timer_handler"..
The output:

Quoted 7 lines
dhcp78:~# gcc -Wall -lasound test_timer.c -o
test_timer
test_timer.c: In function `async_callback':
test_timer.c:60: warning: implicit declaration of
function
`snd_async_handler_get_timer'
test_timer.c:60: warning: initialization makes

pointer

Quoted 9 lines

from integer
without a cast
test_timer.c: In function `main':
test_timer.c:171: warning: implicit declaration of function
snd_async_add_timer_handler' /tmp/ccw926SP.o(.text 0x285): In function async_callback':
: undefined reference to

`snd_async_handler_get_timer'

Quoted 2 lines

/tmp/ccw926SP.o(.text 0x9e3): In function `main':
: undefined reference to

`snd_async_add_timer_handler'

Quoted 5 lines

collect2: ld returned 1 exit status
dhcp78:~#

I tried to perform a grep into Alsa source code but

I

Quoted 7 lines

did not found the
function "snd_async_add_timer_handler"...

Can someone help me...it is not trivial try to look into Alsa code for a
newb like me..

Quoted 6 lines

Thanks a lot
Agata

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam

protection around

Quoted 3 lines

http://mail.yahoo.com

-------------------------------------------------------------------------

Quoted 2 lines

Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get

the chance to share your

Quoted 1 line

opinions on IT & business topics through brief

surveys -- and earn cash

Quoted 1 line

http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

Quoted 4 lines

_______________________________________________
Alsa-devel mailing list
[email protected]

https://lists.sourceforge.net/lists/listinfo/alsa-devel

Quoted 2 lines

I have just found the solution.. and was very
trivial....I'm sorry to
have bored you :)

I would like to write this suggestions just for other newbs like me!
If interested read below, otherwise stop read. :)

As you can see in the example
http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2timer_8c-example.html

the include directives are:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include "../include/asoundlib.h"

Quoted 5 lines

The solutions was just to specify all the path to the "asoundlib.h"...
in my case:

#include "/usr/include/alsa/asoundlib.h"

Actually better to be

	#include <alsa/asoundlib.h>

Maybe the example was written to be compiled inside alsa-lib tree.

Thanks for information.

Takashi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV