From: Steve K. <st...@st...> - 2004-03-01 20:08:00
|
S wrote: > Hi Steve, > > I become aware you are the iaxclient project admin. That would be me :) > 1) question > > Maybe you are versed with th iaxclient_lib.c code and I like to ask > direct a question about the "int service_audio()" function. > This code is in service_audio : > for(;;) > { > toRead = 160; > if ( audio.input(&audio,buf,&toRead)) > { > iaxc_usermsg(IAXC_ERROR, "ERROR reading audio\n"); > break; > } > if ( ! toRead) > break; /* frame not available */ > /* currently, pa will always give us 0 or what we asked > * for samples */ > else > send_encoded_audio( &calls[selected_call], buf, iEncodeType); > } That's not what should happen :) What are you using to build? Are you using the audio_portaudio stuff, or are you trying to make the old (not maintained) windows stuff work? If you're using portaudio, then audio.input should be pa_input, which is a simple function, which just looks to see if the RingBuffer has data in it. Unless something is causing things to run very slowly for you, then it should only have data occasionally. > My IAX client didn't get out of the "for" loop, because there is every > time data on the input channel. > For this reason my iaxc_processor thread hang in the service_audio > function and is not able to do other work (iaxc_service_network, > iaxc_do_pings....). > If I remove the endless "for" loop out of service_audio my client is > able to work. But that could cause you to get behind and lose audio. If the service_audio function is called more than once every 20ms, it should be OK, though. > I didn't understand why I am the only one who run into this endless > loop ? > Any comment's what I have done wrong ? I don't know what went wrong for you; I guess you'll need to tell us more about what you have done. > 2) question > > A other question I have is about CVS in this project. > Why are no CVS tags in the source files ($Revision: $ ,$Author: $, > $Log: $) this help for a better overview. No particular reason. Obviously, that wouldn't be hard to do. It does make merging in other CVS repositiories a pain, though. (I deal with a bunch of CVS repositories [at least iaxclient sourceforge CVS, libiax2 CVS, portaudio CVS, and, I have another CVS repository of iaxclient for my own client] and when the code has that stuff in it, it makes all the files show diffs). > A big question about the IAX2 protocol will be send later. ;-)) We'll try to answer! -SteveK > PS : The number of Steve's in a project should be a > number between 1 and 42 Actually, if you read back, the proposal is to just call any non-Steve contributors Steve in order to reduce confusion :) -SteveK > > S wrote: > > > Hi All, > > > > in the iaxclient_lib.c the function void iaxc_shutdown() has > a MUTEX > > deadlock. > > In the function iaxc_shutdown() is a call to > iaxc_dump_all_calls() > > which also try to get the MUTEX iaxc_lock. > > > > Dead lock code : > > void iaxc_shutdown(){ > > MUTEXLOCK(&iaxc_lock); > > iaxc_dump_all_calls(); > > > > audio.destroy(&audio); > > > > MUTEXUNLOCK(&iaxc_lock); > > MUTEXDESTROY(&iaxc_lock); > > } > > > > FIX : No Dead lock : > > > > void iaxc_shutdown() > > { > > iaxc_dump_all_calls(); > > > > MUTEXLOCK(&iaxc_lock); > > > > audio.destroy(&audio); > > > > MUTEXUNLOCK(&iaxc_lock); > > MUTEXDESTROY(&iaxc_lock); > > } > > > > Regard's > > > > Stephan > > Thanks, Stephan. > > That's a good change, although I think there may be other bugs in > iaxc_shutdown. (I don't think most clients are using it right now?). > > -SteveK > > P.S. I guess that adds to the number of Steve's in the project again, > eh? > > > |