Re: SoundRecorder app breaks in MediaRecorder.prepare()

2009-03-16 Thread waterblood

I also get the same failed error code in prepare. I trace the cause is
in PVMFOMXEncNode::NegotiateAudioComponentParameters(), that output
channels number is be set to 10 in a former calling. But i cannot find
any place where PVMFOMXEncNode::SetOutputNumChannel(10) be called.

Have you fixed the same issue?

Best Regards
Guoyin Chen

On Mar 13, 12:21 pm, waterblood guoyin.c...@gmail.com wrote:
 The call path should be as below:

 MediaRecorder::prepare()PVMediaRecorder::prepare()---

 AuthorDriver::handlePrepare()---PVAuthorEngine::Init()

 On Mar 13, 6:53 am, Misael Lopez mesa...@gmail.com wrote:



  Hi,

  I used to record audio using SoundRecorder application, but in latest
  pull it seems to be broken. The application starts but when the record
  is actually going to happen, it fails. The error message (from logcat)
  is:

  E/MediaRecorder(  869): prepare failed: -2147483648

  I'd like to give more information about the error, but I don't see
  more related messages in the log. I grep-ed the error message and
  found that the prepare function is returning with an error. But I
  couldn't find the actual implementation of the prepare function.

  Any idea or suggestion?

  Thanks,
  -Misa- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Threading priority in Open MAX components.

2009-03-16 Thread Varma

In Android,
who will decide the threading priority for the OpenMax components
which are not there in the Android frame work and where is this
threading priority set.

Regards,
Varma IVS
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: is there any way to print log in webkit native code ?

2009-03-16 Thread rktb

printing to the console will probably not work unless your code is
running as root. Android provides an easy way of obtaining logs
through logcat. The following are the changes that would be required
to get logs on native code:
(1) Include the header file utils/Log.h
 #include utils/Log.h
(2) Define the logger tag LOG_TAG
 #undef LOG_TAG
 #define LOG_TAG MyWebKitLog
(3) Write the log statement
 LOGE(This is my log statement on line %d,__LINE__);
(4) If not already done, add libutils and libcutils to the list of
LOCAL_SHARED_LIBRARIES in the webkit Android.mk.

Note: Similar to LOGE, there are other logger definitions as well,
like, LOGV, LOGI, LOGW, LOGF, LOGS, etc. For details about the
implementation and usage, please refer the logcat module at
http://android.git.kernel.org/?p=platform/system/core.git;a=blob;f=logcat/logcat.cpp;h=d9ca131b64fcc3d1774068dcf6a5e34d05782a3f;hb=master

-Ravi

On Mar 16, 12:35 am, vincent Kor kor.vinc...@gmail.com wrote:
 Could you please help to explain in more detail ?  Have you ever tried that?

 Thanks

 Vincent

 On Mon, Mar 16, 2009 at 12:12 PM, rktb yend...@pv.com wrote:

  Hi,

  Did you try logcat?

  -Ravi

  On Mar 15, 10:35 pm, vincent Kor kor.vinc...@gmail.com wrote:
   Hi All:

       is there any way to print log in webkit native code??  I used printf
  but
   it can't be displayed in the console and there is nothing in DDMS also.

   Thanks a lot 

   Vincent
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: SoundRecorder app breaks in MediaRecorder.prepare()

2009-03-16 Thread rktb

Which codebase are you looking at?

-Ravi

On Mar 16, 3:59 am, waterblood guoyin.c...@gmail.com wrote:
 I also get the same failed error code in prepare. I trace the cause is
 in PVMFOMXEncNode::NegotiateAudioComponentParameters(), that output
 channels number is be set to 10 in a former calling. But i cannot find
 any place where PVMFOMXEncNode::SetOutputNumChannel(10) be called.

 Have you fixed the same issue?

 Best Regards
 Guoyin Chen

 On Mar 13, 12:21 pm, waterblood guoyin.c...@gmail.com wrote:

  The call path should be as below:

  MediaRecorder::prepare()PVMediaRecorder::prepare()---

  AuthorDriver::handlePrepare()---PVAuthorEngine::Init()

  On Mar 13, 6:53 am, Misael Lopez mesa...@gmail.com wrote:

   Hi,

   I used to record audio using SoundRecorder application, but in latest
   pull it seems to be broken. The application starts but when the record
   is actually going to happen, it fails. The error message (from logcat)
   is:

   E/MediaRecorder(  869): prepare failed: -2147483648

   I'd like to give more information about the error, but I don't see
   more related messages in the log. I grep-ed the error message and
   found that the prepare function is returning with an error. But I
   couldn't find the actual implementation of the prepare function.

   Any idea or suggestion?

   Thanks,
   -Misa- Hide quoted text -

  - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: Threading priority in Open MAX components.

2009-03-16 Thread rktb

The OMX components are tied to the OMX core. It is the core
responsibility to either launch a separate thread (and also assign the
thread priority) or run them in the same thread.

For the OpenCORE framework, i.e., the PV OMX core, currently, there is
no way to explicitly mention the thread priority for individual omx
components.

-Ravi

On Mar 16, 6:52 am, Varma varma@gmail.com wrote:
 In Android,
 who will decide the threading priority for the OpenMax components
 which are not there in the Android frame work and where is this
 threading priority set.

 Regards,
 Varma IVS
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: is there any way to print log in webkit native code ?

2009-03-16 Thread rktb

Missed the most important part ...

To get the logs, you would need to issue and adb command ... adb
logcat

On Mar 16, 8:37 am, rktb yend...@pv.com wrote:
 printing to the console will probably not work unless your code is
 running as root. Android provides an easy way of obtaining logs
 through logcat. The following are the changes that would be required
 to get logs on native code:
 (1) Include the header file utils/Log.h
      #include utils/Log.h
 (2) Define the logger tag LOG_TAG
      #undef LOG_TAG
      #define LOG_TAG MyWebKitLog
 (3) Write the log statement
      LOGE(This is my log statement on line %d,__LINE__);
 (4) If not already done, add libutils and libcutils to the list of
 LOCAL_SHARED_LIBRARIES in the webkit Android.mk.

 Note: Similar to LOGE, there are other logger definitions as well,
 like, LOGV, LOGI, LOGW, LOGF, LOGS, etc. For details about the
 implementation and usage, please refer the logcat module 
 athttp://android.git.kernel.org/?p=platform/system/core.git;a=blob;f=lo...

 -Ravi

 On Mar 16, 12:35 am, vincent Kor kor.vinc...@gmail.com wrote:

  Could you please help to explain in more detail ?  Have you ever tried that?

  Thanks

  Vincent

  On Mon, Mar 16, 2009 at 12:12 PM, rktb yend...@pv.com wrote:

   Hi,

   Did you try logcat?

   -Ravi

   On Mar 15, 10:35 pm, vincent Kor kor.vinc...@gmail.com wrote:
Hi All:

    is there any way to print log in webkit native code??  I used printf
   but
it can't be displayed in the console and there is nothing in DDMS also.

Thanks a lot 

Vincent
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



error: EmojiFactory.h: No such file or directory

2009-03-16 Thread /dev/null

Trying to build cupcake. Synchronized all repositories today. When
building frameworks/base/core/jni/android_emoji_EmojiFactory.cpp it
references a file named EmojiFactory.h which is nowhere to be found.

Looking at the makefile I assume it should have been placed in
frameworks/opt but this directory does not exist. I assume someone
forgot to tell git to include this new directory. What gives?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: error: EmojiFactory.h: No such file or directory

2009-03-16 Thread rktb

http://android.git.kernel.org/?p=platform/frameworks/opt/emoji.git;a=tree;h=refs/heads/cupcake;hb=cupcake

On Mar 16, 9:20 am, /dev/null mmm...@gmail.com wrote:
 Trying to build cupcake. Synchronized all repositories today. When
 building frameworks/base/core/jni/android_emoji_EmojiFactory.cpp it
 references a file named EmojiFactory.h which is nowhere to be found.

 Looking at the makefile I assume it should have been placed in
 frameworks/opt but this directory does not exist. I assume someone
 forgot to tell git to include this new directory. What gives?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: error: EmojiFactory.h: No such file or directory

2009-03-16 Thread Jean-Baptiste Queru

Try to re-sync. There's been a point in time where the emoji code was
missing from the manifest, and you might have done your sync at that
point.

JBQ

On Mon, Mar 16, 2009 at 7:20 AM, /dev/null mmm...@gmail.com wrote:

 Trying to build cupcake. Synchronized all repositories today. When
 building frameworks/base/core/jni/android_emoji_EmojiFactory.cpp it
 references a file named EmojiFactory.h which is nowhere to be found.

 Looking at the makefile I assume it should have been placed in
 frameworks/opt but this directory does not exist. I assume someone
 forgot to tell git to include this new directory. What gives?
 




-- 
Jean-Baptiste M. JBQ Queru
Android Engineer, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: is there any way to print log in webkit native code ?

2009-03-16 Thread vincent Kor
Really appreciate your help, Ravi. !!

Thanks a lot

Vincent

On Mon, Mar 16, 2009 at 10:09 PM, rktb yend...@pv.com wrote:


 Missed the most important part ...

 To get the logs, you would need to issue and adb command ... adb
 logcat

 On Mar 16, 8:37 am, rktb yend...@pv.com wrote:
  printing to the console will probably not work unless your code is
  running as root. Android provides an easy way of obtaining logs
  through logcat. The following are the changes that would be required
  to get logs on native code:
  (1) Include the header file utils/Log.h
   #include utils/Log.h
  (2) Define the logger tag LOG_TAG
   #undef LOG_TAG
   #define LOG_TAG MyWebKitLog
  (3) Write the log statement
   LOGE(This is my log statement on line %d,__LINE__);
  (4) If not already done, add libutils and libcutils to the list of
  LOCAL_SHARED_LIBRARIES in the webkit Android.mk.
 
  Note: Similar to LOGE, there are other logger definitions as well,
  like, LOGV, LOGI, LOGW, LOGF, LOGS, etc. For details about the
  implementation and usage, please refer the logcat module athttp://
 android.git.kernel.org/?p=platform/system/core.git;a=blob;f=lo...
  
  -Ravi
 
  On Mar 16, 12:35 am, vincent Kor kor.vinc...@gmail.com wrote:
 
   Could you please help to explain in more detail ?  Have you ever tried
 that?
 
   Thanks
 
   Vincent
 
   On Mon, Mar 16, 2009 at 12:12 PM, rktb yend...@pv.com wrote:
 
Hi,
 
Did you try logcat?
 
-Ravi
 
On Mar 15, 10:35 pm, vincent Kor kor.vinc...@gmail.com wrote:
 Hi All:
 
 is there any way to print log in webkit native code??  I used
 printf
but
 it can't be displayed in the console and there is nothing in DDMS
 also.
 
 Thanks a lot 
 
 Vincent
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: About threads in a service process

2009-03-16 Thread Dave Sparks

Unless otherwise specified, all binder calls are synchronous to the
calling process (usually referred to as the client process). They are
completely asynchronous to the callee (usually referred to as the
server process).

What this means is that the caller will block in the binder call until
the server thread has completed the requested action. On the server
side, the binder request is picked up by on the worker threads, it
proceeds serially until the work is complete, and then returns the
result to the caller across the binder. It is possible for multiple
worker threads to be concurrent within the server process acting on
behalf of different clients, and perhaps even different threads of the
same client.

On Mar 14, 8:09 pm, rktb yend...@pv.com wrote:
 Thanks Dianne.

 I think I am missing something very basic here. Please help me out.
 The way I understand it, atleast through the logs, all IPC calls
 across the binder are synchronous, i.e., Transact and corresponding
 OnTransact calls are serialized. Then, how could the threads run
 concurrently? Is this the case when two applications are accessing the
 same service?

 -Ravi

 On Mar 14, 9:17 pm, Dianne Hackborn hack...@android.com wrote:

  Yes they run concurrently, that is why they are separate threads. :)

  Currently the maximum number of threads in a process's thread pool is 16.

  On Sat, Mar 14, 2009 at 6:34 AM, rktb yend...@pv.com wrote:

   But, these threads don't run concurrently...right? I am trying to
   understand what kind of precautions the native library needs to take
   in the case of multiple threads.

   -Ravi

   On Mar 14, 3:49 am, Freepine freep...@gmail.com wrote:
startThreadPool() will spawn a new thread into the thread pool which
   talks
with binder driver, while joinThreadPool() will put the calling thread
itself into thread pool.

It seems there is no API to control the maximum number of binder threads
   in
the pool, and sometimes driver will tell the process to spawn new thread
automatically via BR_SPAWN_LOOPER command.

On Sat, Mar 14, 2009 at 1:01 PM, rktb yend...@pv.com wrote:

 Hi,

 - What do the methods startThreadPool() and joinThreadPool() do during
 the process of launching a service, e.g., mediaplayer service in the
 file main_mediaserver.cpp?
 int main(int argc, char** argv)
 {
spProcessState proc(ProcessState::self());
spIServiceManager sm = defaultServiceManager();
LOGI(ServiceManager: %p, sm.get());
AudioFlinger::instantiate();
MediaPlayerService::instantiate();
CameraService::instantiate();
ProcessState::self()-startThreadPool();
IPCThreadState::self()-joinThreadPool();
 }

 - I have a service that I am using and see multiple threads on the
 server side. Below is a snippet of the log.
 03-13 19:52:58.1432645 V IMyTest: BnMyTest::onTrasact ...
 tid=45
 03-13 19:52:58.1432644 V IMyTest: BnMyTest::onTrasact ...
 tid=44
 03-13 19:52:58.1832626 V IMyTest: BnMyTest::onTrasact ...
 tid=26
 03-13 19:52:58.2132645 V IMyTest: BnMyTest::onTrasact ...
 tid=45
 03-13 19:52:58.2132644 V IMyTest: BnMyTest::onTrasact ...
 tid=44
 03-13 19:52:58.2332645 V IMyTest: BnMyTest::onTrasact ...
 tid=45
 03-13 19:52:58.2332626 V IMyTest: BnMyTest::onTrasact ...
 tid=26
 03-13 19:52:58.23326   184 V IMyTest: BnMyTest::onTrasact ...
 tid=184

 If I read this correctly, the service is running on a process with
 pid=26. But, the onTransact calls happen on multiple threads. I did
 verify that the Transact calls occur in all one thread (on the
 application process). Though there appear to be multiple threads (ids)
 running, it looks like the calls are serialized. How come there are
 multiple threads? Is there a way to control the number of threads
 running on the server process?

 Thanks,
 Ravi

 On Feb 12, 3:13 pm, rktb yend...@pv.com wrote:
  Thanks Dianne. We will try to put together the pieces and get back
  with more concrete questions.

  -Ravi

  On Feb 11, 6:24 pm, Dianne Hackborn hack...@android.com wrote:

   On Wed, Feb 11, 2009 at 1:43 PM, rktb yend...@pv.com wrote:
addService from Java:
Next, I tried to read how services are added from Java.
- I looked at frameworks/base/services/java/com/android/server/
SystemServer.java.
- This translates to a call in
   frameworks/base/core/java/andrid/os/
ServiceManager.java and then to
   frameworks/base/core/java/andrid/os/
ServiceManagerNative.java.
- Here, there is a remote call to call native addService in
frameworks/base/cmds/runtime/ServiceManager.cpp.
- The requested service is added to a KeyedVector mServices.

Service as an application component:
   

Re: InputMethodService (SoftKeyboard)

2009-03-16 Thread Dianne Hackborn
Sorry I really don't understand what you are doing.
InputMethodService.onKeyDown() and InputMethodService.onKeyUp() are called
for every single key event being sent to the application, before it does its
normal event dispatching.  You don't need to do anything special to see
them.

On Mon, Mar 16, 2009 at 8:02 AM, Daniel daniel.himmel...@googlemail.comwrote:


 Hi,
 I now hooked my key processing into onKeyDown of class SoftKeyboard
 instead of class InputMethodService.
 SoftKeyboard filtered KeyEvent.KEYCODE_ENTER events before ;-)
 The only problem now is that I always absorb DPAD_LEFT, DPAD_RIGHT,
 DPAD_UP, DPAD_DOWN, DPAD_CENTER and KEYCODE_ENTER after the soft
 keyboard was visible once. A quick fix to this issue is to declare
 mShowInputRequested as protected and also check this variable in class
 SoftKeyboard before doing the processing. Here a public method is
 needed to decide if these key events should be processed by
 SoftKeyboard. Method isInputViewShown() of class InputMethodService
 didn't do the job. Or even better, SoftKeyboard's onKeyDown and
 onKeyUp methods are only called when the SoftKeyboard is visible.

 On 13 Mrz., 19:22, Dianne Hackborn hack...@android.com wrote:
  All key events -are- dispatched first to the IME.  There is a new
  pre-dispatch path that can be used by the application if needed to really
 do
  something before the IME, but afaik this is only used at this point by
 the
  auto complete text view to close its popup window when you hit back.
 
  On Fri, Mar 13, 2009 at 7:40 AM, Daniel daniel.himmel...@googlemail.com
 wrote:
 
 
 
 
 
   Hi,
   our Android HW has no touchscreen and no keyboard. We just have DPAD
   keys, menu, home and back.
   To use Cupcake's soft keyboard I extended onKeyDown in
   InputMethodService to push DPAD_LEFT, DPAD_RIGHT, DPAD_UP, DPAD_DOWN
   and DPAD_CENTER events to onKeyDown of class KeyboardView. Now we can
   control the SoftKeyboard with these keys. The problem is that we do
   not get DPAD_CENTER as this key event is already consumed by the
   focused text box when writing.
   Sure, this is exactly what you want if you control the soft keyboard
   by touch but there should be a way to tell InputMethodService to
   consume all key events before the underlieing activity can do so.
   Currently its the other way round I think.
   We need the DPAD_CENTER key to press the selected key (at the moment
   we do this with the menu button, but this is ugly).
   Do you plan to further extend the InputMethodService for such
   constrained environments? Would be very helpful ;-)
 
  --
  Dianne Hackborn
  Android framework engineer
  hack...@android.com
 
  Note: please don't send private questions to me, as I don't have time to
  provide private support.  All such questions should be posted on public
  forums, where I and others can see and answer them.
 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Clarification about system images

2009-03-16 Thread Prem Thilagar

Hi I just posted this in Android Platforms groups but wasn't sure
where it belonged so posting it here again.

I have this question about the system.img files that come as a part of
the standard android SDK (any release but i run 1.1)  and the ones
that are generated by doing a make in the source code.

I find these are different for example the DevTools is not a part of
the standard SDK system image but it is available in the image that
you get after you build from source downloaded.why is this difference
there ?

Secondly if i want to include any other packages (for eg i would like
to get back the Api Demos which has disappeared in recent releases)
what are the steps i should do ? Like i was trying a rough attempt to
just compile back Api Demos from a previous version and just did a
adb  install apidemos.apk and it complained about MISSING SHARED
LIBRARIES. what should i do to make sure this works fine ?

Thanks
Prem Thilagar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Why RIL uses Local socket instead of binder ipc?

2009-03-16 Thread Videoguy

Hi
The communication between GSM stack and RIL daemon is done using Local
unix socket instead of Binder ipc.

Why was it done like that?
Are there any exceptions to when one can use Binder based ipc?

Thanks
Videoguy

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: About threads in a service process

2009-03-16 Thread rktb

Thanks Dave.

On Mar 16, 12:04 pm, Dave Sparks davidspa...@android.com wrote:
 Unless otherwise specified, all binder calls are synchronous to the
 calling process (usually referred to as the client process). They are
 completely asynchronous to the callee (usually referred to as the
 server process).

 What this means is that the caller will block in the binder call until
 the server thread has completed the requested action. On the server
 side, the binder request is picked up by on the worker threads, it
 proceeds serially until the work is complete, and then returns the
 result to the caller across the binder. It is possible for multiple
 worker threads to be concurrent within the server process acting on
 behalf of different clients, and perhaps even different threads of the
 same client.

 On Mar 14, 8:09 pm, rktb yend...@pv.com wrote:

  Thanks Dianne.

  I think I am missing something very basic here. Please help me out.
  The way I understand it, atleast through the logs, all IPC calls
  across the binder are synchronous, i.e., Transact and corresponding
  OnTransact calls are serialized. Then, how could the threads run
  concurrently? Is this the case when two applications are accessing the
  same service?

  -Ravi

  On Mar 14, 9:17 pm, Dianne Hackborn hack...@android.com wrote:

   Yes they run concurrently, that is why they are separate threads. :)

   Currently the maximum number of threads in a process's thread pool is 16.

   On Sat, Mar 14, 2009 at 6:34 AM, rktb yend...@pv.com wrote:

But, these threads don't run concurrently...right? I am trying to
understand what kind of precautions the native library needs to take
in the case of multiple threads.

-Ravi

On Mar 14, 3:49 am, Freepine freep...@gmail.com wrote:
 startThreadPool() will spawn a new thread into the thread pool which
talks
 with binder driver, while joinThreadPool() will put the calling thread
 itself into thread pool.

 It seems there is no API to control the maximum number of binder 
 threads
in
 the pool, and sometimes driver will tell the process to spawn new 
 thread
 automatically via BR_SPAWN_LOOPER command.

 On Sat, Mar 14, 2009 at 1:01 PM, rktb yend...@pv.com wrote:

  Hi,

  - What do the methods startThreadPool() and joinThreadPool() do 
  during
  the process of launching a service, e.g., mediaplayer service in the
  file main_mediaserver.cpp?
  int main(int argc, char** argv)
  {
     spProcessState proc(ProcessState::self());
     spIServiceManager sm = defaultServiceManager();
     LOGI(ServiceManager: %p, sm.get());
     AudioFlinger::instantiate();
     MediaPlayerService::instantiate();
     CameraService::instantiate();
     ProcessState::self()-startThreadPool();
     IPCThreadState::self()-joinThreadPool();
  }

  - I have a service that I am using and see multiple threads on the
  server side. Below is a snippet of the log.
  03-13 19:52:58.143    26    45 V IMyTest: BnMyTest::onTrasact ...
  tid=45
  03-13 19:52:58.143    26    44 V IMyTest: BnMyTest::onTrasact ...
  tid=44
  03-13 19:52:58.183    26    26 V IMyTest: BnMyTest::onTrasact ...
  tid=26
  03-13 19:52:58.213    26    45 V IMyTest: BnMyTest::onTrasact ...
  tid=45
  03-13 19:52:58.213    26    44 V IMyTest: BnMyTest::onTrasact ...
  tid=44
  03-13 19:52:58.233    26    45 V IMyTest: BnMyTest::onTrasact ...
  tid=45
  03-13 19:52:58.233    26    26 V IMyTest: BnMyTest::onTrasact ...
  tid=26
  03-13 19:52:58.233    26   184 V IMyTest: BnMyTest::onTrasact ...
  tid=184

  If I read this correctly, the service is running on a process with
  pid=26. But, the onTransact calls happen on multiple threads. I 
  did
  verify that the Transact calls occur in all one thread (on the
  application process). Though there appear to be multiple threads 
  (ids)
  running, it looks like the calls are serialized. How come there are
  multiple threads? Is there a way to control the number of threads
  running on the server process?

  Thanks,
  Ravi

  On Feb 12, 3:13 pm, rktb yend...@pv.com wrote:
   Thanks Dianne. We will try to put together the pieces and get back
   with more concrete questions.

   -Ravi

   On Feb 11, 6:24 pm, Dianne Hackborn hack...@android.com wrote:

On Wed, Feb 11, 2009 at 1:43 PM, rktb yend...@pv.com wrote:
 addService from Java:
 Next, I tried to read how services are added from Java.
 - I looked at 
 frameworks/base/services/java/com/android/server/
 SystemServer.java.
 - This translates to a call in
frameworks/base/core/java/andrid/os/
 ServiceManager.java and then to
frameworks/base/core/java/andrid/os/
 ServiceManagerNative.java.
 - Here, there is a remote call to call native 

Vibrator device in emulator

2009-03-16 Thread Prem Thilagar

Hi I am trying to simulate a vibrator device in the emulator

The timed_output class driver is in place and is verified to work
( did a echo  1000 to /sys/class/timed_output/vibrator/enable to the
device and it has been verified to work ).

--- I wanted to invoke this device node from a app and was planning on
using Morsecode from Api Demos ,since it has gone missing in recent
releases wrote just a couple of lines of code to basically call the
vibrator device from an stand alone app.

--- This does not seem to work ,when i ran logcat these are the
sequence of logs passed as the application is being run from the menu

I/ActivityManager(  589): Starting activity: Intent
{ action=android.intent.acti
on.MAIN categories={android.intent.category.LAUNCHER} flags=0x1020
comp={com.x.ui/com.x.ui.uiSimpleWidet} }
I/ActivityManager(  589): Start proc com.mot.ui for activity
com.x.ui/.uiSimpleWidet: pid=791 uid=10023 gids={}
I/jdwp(  791): received file descriptor 20 from ADB
E/jdwp(  791): Failed sending req to debugger: Broken pipe (-1 of
27)
E/jdwp(  791): Failed sending reply to debugger: Broken pipe
I/dalvikvm(  791): Debugger has detached; object registry had 2
entries
D/dalvikvm(  553): GC freed 262 objects / 9848 bytes in 225ms
D/dalvikvm(  553): GC freed 40 objects / 1696 bytes in 183ms
D/dalvikvm(  553): GC freed 2 objects / 48 bytes in 260ms
V/ActivityThread(  791): Resuming ActivityRecord{436b6288
token=android.os.Binde
rpr...@436b5e50 {com.x.ui/com.x.ui.uiSimpleWidet}} with
isForward=true
I/ActivityManager(  589): Displayed activity
com.x.ui/.uiSimpleWidet: 1203 ms
I/jdwp(  791): received file descriptor 30 from ADB
D/dalvikvm(  679): GC freed 456 objects / 22176 bytes in 110ms


This is what i see . But the device node is not being called .The app
is pretty simple and just calls the vibrator.vibrate(1) for 10s (i
have also set the permission fine for VIBRATE).I am not able to see
any logs beyond the BinderProxy.I was hoping to see Harware
service.java kick in and take it from there.

 Can some one tell me if i am missing any link between the manager and
HAL ? I also made sure hardware service is running by doing  a service
list and also made sure libhardware.so and libhardware_logacy.so is
there .

Thanks

Prem Thilagar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: SoundRecorder app breaks in MediaRecorder.prepare()

2009-03-16 Thread waterblood

2.01 Release

On Mar 16, 9:40 pm, rktb yend...@pv.com wrote:
 Which codebase are you looking at?

 -Ravi

 On Mar 16, 3:59 am, waterblood guoyin.c...@gmail.com wrote:



  I also get the same failed error code in prepare. I trace the cause is
  in PVMFOMXEncNode::NegotiateAudioComponentParameters(), that output
  channels number is be set to 10 in a former calling. But i cannot find
  any place where PVMFOMXEncNode::SetOutputNumChannel(10) be called.

  Have you fixed the same issue?

  Best Regards
  Guoyin Chen

  On Mar 13, 12:21 pm, waterblood guoyin.c...@gmail.com wrote:

   The call path should be as below:

   MediaRecorder::prepare()PVMediaRecorder::prepare()---

   AuthorDriver::handlePrepare()---PVAuthorEngine::Init()

   On Mar 13, 6:53 am, Misael Lopez mesa...@gmail.com wrote:

Hi,

I used to record audio using SoundRecorder application, but in latest
pull it seems to be broken. The application starts but when the record
is actually going to happen, it fails. The error message (from logcat)
is:

E/MediaRecorder(  869): prepare failed: -2147483648

I'd like to give more information about the error, but I don't see
more related messages in the log. I grep-ed the error message and
found that the prepare function is returning with an error. But I
couldn't find the actual implementation of the prepare function.

Any idea or suggestion?

Thanks,
-Misa- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: Why RIL uses Local socket instead of binder ipc?

2009-03-16 Thread Dianne Hackborn
Basically because that is how it was implemented.  *shrug*  And it was
written long before there was any Binder IPC facility.

On Mon, Mar 16, 2009 at 1:47 PM, Videoguy puri_mall...@yahoo.com wrote:


 Hi
 The communication between GSM stack and RIL daemon is done using Local
 unix socket instead of Binder ipc.

 Why was it done like that?
 Are there any exceptions to when one can use Binder based ipc?

 Thanks
 Videoguy

 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Tools to Check Memory Leak

2009-03-16 Thread Nima

Hi,

Can anyone please suggest any tools to check memory leaks in Opencore
source code.
Can we check memory leaks with Valgrind  tool?

ThanksRegards,
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
android-framework group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---