• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Trouble with AudioDeviceGetCurrentTime....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble with AudioDeviceGetCurrentTime....


  • Subject: Re: Trouble with AudioDeviceGetCurrentTime....
  • From: Rob Frohne <email@hidden>
  • Date: Sun, 28 Nov 2004 17:10:55 -0800

An addendum to my note with the errors of MallocDebug in case anyone has any ideas about that. Here it is.

[Session started at 2004-11-28 17:04:51 -0800.]
dyld: /Users/frohro/Documents/gwc-0.20-07/build/gwc multiple definitions of symbol _xdg_mime_shutdown
/sw/lib/libgnomevfs-2.0.dylib(xdgmime.o) definition of _xdg_mime_shutdown
/sw/lib/libgtk-x11-2.0.0.dylib(xdgmime.o) definition of _xdg_mime_shutdown

Thanks,

Rob

On Nov 28, 2004, at 3:50 PM, Rob Frohne wrote:

Hi All,

I need to get the number of bytes processed, and would like to use the AudioDeviceGetCurrentTime() function to do it. I'm having trouble with it though. If I comment out the call to AudioDeviceGetCurrentTime() below, it works. If I uncomment it, I get following crash log in the console.

Running…
before start_playback
After start_playback
After playback timer
after cursor timer
Start time is: -2125352296
start_sample_time is: 644517148.000000
Reading memory from the sp at: bfffe8f0
Reading memory from the sp at: bfffe8f0
Reading memory from the sp at: bfffe8f0
(gdb) continue
This time is: -2125348327
play_back_position from gettimeofday is: 698720
num_processes is: 1
Program received signal: "EXC_BAD_ACCESS".

Unable to disassemble ??.
(gdb)

I'm rather new at this. I was unable to launch MallocDebug, because it complained about some duplicate symbols in gtk or something like that.

Any ideas?

Thanks,

Rob

long audio_device_processed_bytes(void)
{
struct timeval this;
static long multiplier = 176;
AudioTimeStamp* this_time;
OSStatus err;
UInt32 num_processes;
UInt32 count;


gettimeofday(&this, &tz);


/*if (multiplier == 0)
{
multiplier = audio_data.sfinfo.samplerate*FRAMESIZE;
}*/



printf("This time is: %ld\n", (1000*this.tv_sec + this.tv_usec/1000.));
playback_position =
multiplier*((this.tv_sec - playback_start_time.tv_sec)*1000 + (this.tv_usec -
playback_start_time.
tv_usec) / 1000);
//Have to scale it this way so the longs don't overflow.
printf("play_back_position from gettimeofday is: %ld\n",playback_position);
//usleep(1000);
count = sizeof(UInt32);
if ((err = AudioDeviceGetProperty (audio_data.device, 0, false, kAudioDevicePropertyDeviceIsRunning,
&count, &num_processes)) != noErr)
{ printf ("AudioDeviceGetProperty (AudioDeviceGetProperty) failed. The device probably isn't running.\n") ;
return -1;
}
else
{
printf("num_processes is: %ld\n",num_processes);
if((err = AudioDeviceGetCurrentTime(audio_data.device, this_time)) != noErr)
{
printf("Could not get the current time. The error number is: %ld \n",err);
//return playback_position;
}
else
{
printf("this_time - start_sample_time = %ld\n",(long) (this_time->mSampleTime - start_sample_time));
}
//playback_position = (long) (this_time->mSampleTime - start_sample_time);
}
return playback_position;
}
// This is used to set the cursor. We need to make this return a number controlled by a timer.


--
Rob Frohne, Ph.D., P.E.
E.F. Cross School of Engineering
Walla Walla College
http://www.wwc.edu/~frohro/ _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
--
Rob Frohne, Ph.D., P.E.
E.F. Cross School of Engineering
Walla Walla College
http://www.wwc.edu/~frohro/
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Trouble with AudioDeviceGetCurrentTime....
      • From: Jeff Moore <email@hidden>
References: 
 >Trouble with AudioDeviceGetCurrentTime.... (From: Rob Frohne <email@hidden>)

  • Prev by Date: Re: Trouble with AudioDeviceGetCurrentTime....
  • Next by Date: Callbacks in an AUGraph induced state
  • Previous by thread: Re: Trouble with AudioDeviceGetCurrentTime....
  • Next by thread: Re: Trouble with AudioDeviceGetCurrentTime....
  • Index(es):
    • Date
    • Thread