Logging OpenCore through logcat

by RCP2278 » Sat, 31 Jan 2009 02:12:17 GMT


Sponsored Links
 Hi,

I'm trying to capture some log traces from openCore by running/playing
the media player from the emulator.  I'm running OpenCore 2.0 and I
followed the steps as instructed inside external/opencore/android/
android_logger_config.h.  Below is what I did:

1) Create a file named pvlogger.txt which contains the following line:
8,PVPlayerEngine

2) Launch emulator through Eclipse (APIDemos project > Debug As),
making sure that when the emulator is launched that I mounted the
sdcard directory

2a) Open the Debug perspective so I can see the output through LogCat

3) adb push pvlogger.txt /sdcard

4) adb shell and cd to /sdcard just to make sure the pvlogger.txt is
there

5) Launch the media player (play local file or play streaming video)

NOTE: I've never been successful in playing the streaming video on the
emulator, which is one of my motivations to run a trace and see what
is going on in the framework.  I've googled around and it seems like
everyone is having the same problem and could be an emulator
problem....

After Step (5) I don't see any traces that would appear to come from
openCore.

Do I need to attach to a separate process to see the logs generated
from openCore?  If so, can I do that through Eclipse/DDMS (when I
played the local playback, only 4 threads were running (1 main thread
and 3 binder threads)  I highlighted each one and it doesn't appear
that any openCore logs are showing.  Obviously I'm doing something
wrong here.  I'm also new at Eclipse so can you please advice how and
which process to attach to?

Thanks.

R
--~--~---------~--~----~------------~-------~--~----~



Logging OpenCore through logcat

by rktb » Sat, 31 Jan 2009 03:23:35 GMT


 You need to build the OpenCORE code with the macro ENABLE_PV_LOGGING.

Try this ..
rm -rf out/target/product/generic/obj/include/libpv
make -j ENABLE_PV_LOGGING=1

And, then follow your steps 1 to 5.


-Ravi




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Logging OpenCore through logcat

by RCP2278 » Mon, 02 Feb 2009 18:59:02 GMT


 avi,

I rebuilt openCore with ENABLE_PV_LOGGING=1 (using your suggestions,
running the make command from the top level android directory) and re-
did my steps again (although, not necessary since the pvlogger.txt is
already in the /sdcard...I just basically restarted my eclipse and
emulator).

Unfortunately, I'm not seeing any logs that would look like it comes
from the openCore engine...unless I'm not looking at the right place.
What should the "tag" be in the logcat display to know that the log
came from the openCore engine? Or what should I expect if I have the
logging on and I run the APIDemos sample code for playing back media
in the emulator?


In the Eclipse Debug Perspective, here is what I see in the logcat
verbose output (I'm playing a local media file)

02-02 18:48:23.172: INFO/ActivityManager(54): Starting activity:
Intent { comp={com.example.android.apis/
com.example.android.apis.media.MediaPlayerDemo} }
02-02 18:48:24.052: INFO/ActivityManager(54): Displayed activity
com.example.android.apis/.media.MediaPlayerDemo: 872 ms
02-02 18:48:30.232: INFO/ActivityManager(54): Starting activity:
Intent { comp={com.example.android.apis/
com.example.android.apis.media.MediaPlayerDemo_Video} (has extras) }
02-02 18:48:31.121: DEBUG/MediaPlayerDemo(201): surfaceCreated called
02-02 18:48:31.742: DEBUG/MediaPlayerDemo(201): surfaceChanged called
02-02 18:48:32.022: DEBUG/MediaPlayerDemo(201): onPrepared called
02-02 18:48:32.101: INFO/ActivityManager(54): Displayed activity
com.example.android.apis/.media.MediaPlayerDemo_Video: 1870 ms
02-02 18:48:35.822: WARN/AudioFlinger(24): write blocked for 139 msecs
02-02 18:48:35.882: WARN/AudioFlinger(24): write blocked for 53 msecs
02-02 18:48:35.982: WARN/AudioFlinger(24): write blocked for 93 msecs
02-02 18:49:40.192: DEBUG/MediaPlayerDemo(201): onCompletion called

...on streaming, here is the log (I see a tag "VERBOSE/
ProtocolEngine". Could this be an openCore trace log? Does that mean
logging is working now?)

02-02 18:52:55.652: INFO/ActivityManager(54): Starting activity:
Intent { comp={com.example.android.apis/
com.example.android.apis.media.MediaPlayerDemo_Video} (has extras) }
02-02 18:52:56.322: DEBUG/MediaPlayerDemo(201): surfaceCreated called
02-02 18:52:57.132: VERBOSE/ProtocolEngine(24): DownloadRate 104166
bytes per sec. Downloaded Bytes 5643/34714
02-02 18:52:57.402: ERROR/MediaPlayerDemo(201): error: Prepare
failed.: status=0xFFFFFFFF
02-02 18:52:57.402: ERROR/MediaPlayerDemo(201): java.io.IOException:
Prepare failed.: status=0xFFFFFFFF
02-02 18:52:57.402: ERROR/MediaPlayerDemo(201): at
android.media.MediaPlayer.prepare(Native Method)
02-02 18:52:57.402: ERROR/MediaPlayerDemo(201): at
com.example.android.apis.media.MediaPlayerDemo_Video.playVideo
(MediaPlayerDemo_Video.java:112)
02-02 18:52:57.402: ERROR/MediaPlayerDemo(201): at
com.example.android.apis.media.MediaPlayerDemo_Video.surfaceCreated
(MediaPlayerDemo_Video.java:157)
02-02 18:52:57.402: ERROR/MediaPlayerDemo(201): at
android.view.SurfaceView.updateWindow(SurfaceView.java:347)
02-02 18:52:57.402: ERROR/MediaPlayerDemo(201): at
android.view.SurfaceView.dispatchDraw(SurfaceView.java:255)
02-02 18:52:57.402: ERROR/MediaPlayerDemo(201): at
android.view.ViewGroup.drawChild(ViewGroup.java:1434)
02-02 18:52:57.402: ERROR/MediaPlayerDemo(201): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1208)
02-02



Logging OpenCore through logcat

by rktb » Tue, 03 Feb 2009 04:25:02 GMT


 n Feb 2, 12:58pm, RCP2278 <rcp2...@gmail.com> wrote:
This VERBOSE/ProtocolEngine statement *was* a logcat statement in
OpenCORE 1.0. This statement has been removed in OpenCORE 2.0. This
shows that you are still exercising an older code. Please check. Hint:
When launching the emulator, try "-wipe-data".

--~--~---------~--~----~------------~-------~--~----~



Logging OpenCore through logcat

by yungster » Tue, 03 Feb 2009 18:53:04 GMT


 I made a modification to android_logger_config.h to enable logging
without the config file...

Add to this to the top of ReadAndParseLoggerConfigFile()

#define LOG_EVERYTHING
#ifdef LOG_EVERYTHING
        LoggerConfigElement obj;
        obj.iLoggerString = "";
        obj.iLogLevel = 8;
        iLoggerConfigElements.push_back(obj);
        iLogFileRead = true;
        return 1;
#endif

-Yung



--~--~---------~--~----~------------~-------~--~----~



Logging OpenCore through logcat

by RCP2278 » Wed, 04 Feb 2009 01:11:43 GMT


 Hi Ravi,

Thanks again for your response and patience.

So I've confirmed that the emulator is still loading the old images
after I've compiled the android code, but I'm now running into issues
(not necessarily logging issues) when I launch the emulator or try to
run the ApiDemos application.  It turns out that the emulator that I'm
launching is looking at the emulator located in the android-sdk tools
folder.  So here's what I've done:

1) Ended up building the entire android codebase (just to be safe,
plus I had some time in my hands :)).  Basically, from <android-root>:

make clean
make -j ENABLE_PV_LOGGING=1

2) After building, I saw that the new images are built under <android-
root>/out/target/product/generic.  The three images that I need I'm
assuming are ramdisk.img, system.img, and userdata.img

3) Launched the emulator from Eclipse with option -system <android-
root>/out/target/product/generic.  Unfortunately it prompted me saying
that it could not find the kernel-qemu and that I should use -kernel
option.  Couldn't find the kernel-qemu file in the same directory, so
I did an alternative approach instead (see (4) below)

4) Since my default emulator is being launched from the android-sdk
tools folder, I copied those three built images to <android-sdk-
folder>/tools/lib/images instead.  Coincidentally, there is a kernel-
qemu file in that directory as well.

5) Relaunched the emulator again from Eclipse (this time with -wipe-
data option included but removed the -system option I added earlier).
When it came time to install the ApiDemos.apk, the following DDMS
console error appeared:

ApiDemos]  Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
ApiDemos]  Please check logcat output for more details

Not suprisingly, the ApiDemos app is not there and the logcat messages
show a lot of errors indicating that it couldn't find any libraries,
etc


Now, I thought maybe the only image that I need is userdata.img???  So
once more I followed the same steps as above, except this time I'm
only using the built userdata.img and kept the ramdisk.img and
system.img as is.  Everything loaded fine, but when it came time to
play a streaming file, I continue to see the VERBOSE log of tag
ProtocolEngine (argh!)


Can you help me point out what step I did wrong here?  Did I copy the
wrong images?  Did I build it incorrectly?


-R




--~--~---------~--~----~------------~-------~--~----~



Logging OpenCore through logcat

by rktb » Wed, 04 Feb 2009 02:54:51 GMT


 I would prefer not mixing the SDK build and the opensource build. The
following should work:
<android-root>$ source build/envsetup.sh
<android-root>$ lunch 1
<android-root>$ make clean
<android-root>$ make -j ENABLE_PV_LOGGING=1
<android-root>$ emulator & adb logcat


-Ravi





--~--~---------~--~----~------------~-------~--~----~



Logging OpenCore through logcat

by RCP2278 » Wed, 04 Feb 2009 23:11:26 GMT


 Okay, I think I'm getting close, but not quite there yet--

Followed your steps below and I got the emulator to launch (using the
one located in out/host/linux-x86/bin/emulator).  But now I'm having
issues when trying to launch ApiDemos so I can test the media
playback.  The following are what I did:

Approach 1:
=========

1) Modify MediaPlayerDemo_Video.java from development/samples/ApiDemos/
src/com/example/android/apis/media/ and supplied the path to the media
I want to do a local playback with

2) cd to <android-root> then run make (apparently running 'make -f
Android.mk' from ApiDemos directory doesn't work to build the apk file
(???))

3) I was expecting an ApiDemos.apk to get built, but it didn't and
couldn't locate it when I ran the 'find' command.  Instead, after
looking at the make output, it appears an apk is created in "out/
target/product/generic/obj/APPS/ApiDemos_intermediates/package.apk"
instead.  Is this the ApiDemos.apk?  I'm not sure but I have nothing
to lose....

4) Launched emulator (-wipe-data to be sure)

5) Run adb install on package.apk

I got the following error instead:

912 KB/s (1970610 bytes in 2.108s)
        pkg: /data/local/tmp/package.apk
Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY]


Approach 2:
=========

1) So now I tried building the ApiDemos.apk through Eclipse IDE.
After setting up the project then Running it as an Android
application, it says that there are errors in the project and couldn't
install the ApiDemos application (it looks like problems with the
AndroidManifest.xml file?)  Note that I didn't change anything in this
directory yet except for the file to point to my media file.



Is there something wrong with the ApiDemos source code/manifest in the
latest repository?  Does that need to be updated to reflect changes
with OpenCore 2.0 or is that irrelevant?  How can I fix this error?
(Reminder:  I'm still an android beginner here :) )


Thanks

-R







--~--~---------~--~----~------------~-------~--~----~



Logging OpenCore through logcat

by RCP2278 » Thu, 05 Feb 2009 01:48:02 GMT


 Looks like my issue below has been explained (The
FAILED_MISSING_SHARED_LIBRARY issue when loading the ApiDemos.apk to
the latest emulator...)




Logging OpenCore through logcat

by das.ar...@gmail.com » Wed, 04 Mar 2009 18:44:44 GMT


 i I have followed the steps as mentioned in the post.I tried playing
MP3 clip of 52 secs.I am attaching below the logs.Please le me know me
whether they are the proper logs of PVMF or not??
==========================================================================================================================
I/ActivityManager( 52): Starting activity: Intent
{ action=android.intent.action.MAIN categories=
{android.intent.category.LAUNCHER} flags=0x10200000 comp=
{com.android.music/com.android.music.MusicBrowserActivity} }

I/ActivityManager( 52): Start proc com.android.music for activity
com.android.music/.MusicBrowserActivity: pid=182 uid=10022 gids={3003}

D/dalvikvm( 23): GC freed 267 objects / 10032 bytes in 185ms

D/dalvikvm( 23): GC freed 45 objects / 1912 bytes in 130ms

D/dalvikvm( 23): GC freed 2 objects / 48 bytes in 115ms

V/ActivityThread( 182): Resuming ActivityRecord{436b6178
token=android.os.binderpr...@436b5cc8 {com.android.music/
com.android.music.MusicBrowserActivity}} with isForward=true

V/MediaPlayer-JNI( 182): native_setup

V/MediaPlayer( 182): constructor

V/MediaPlayer( 182): setListener

I/ActivityManager( 52): Displayed activity
com.android.music/.MusicBrowserActivity: 2380 ms

I/ActivityManager( 52): Starting activity: Intent
{ action=android.intent.action.PICK data= type=vnd.android.cursor.dir/
track comp={com.android.music/
com.android.music.TrackBrowserActivity} }

V/ActivityThread( 182): Resuming ActivityRecord{436e1158
token=android.os.binderpr...@436e0ca8 {com.android.music/
com.android.music.TrackBrowserActivity}} with isForward=true

I/ActivityManager( 52): Displayed activity
com.android.music/.TrackBrowserActivity: 1260 ms

V/MediaPlayer( 182): reset

V/MediaPlayer( 182): setDataSource(36, 0, 576460752303423487)

V/MediaPlayerService( 24): Client(1) constructor

V/MediaPlayerService( 24): Create new client(1) from pid 182, fd=10,
offset=0, length=576460752303423487

V/MediaPlayerService( 24): setDataSource fd=10, offset=0,
length=576460752303423487

V/MediaPlayerService( 24): st_dev = 45824

V/MediaPlayerService( 24): st_mode = 32822

V/MediaPlayerService( 24): st_uid = 1000

V/MediaPlayerService( 24): st_gid = 1000

V/MediaPlayerService( 24): st_size = 370021

V/MediaPlayerService( 24): calculated length = 370021

V/MediaPlayerService( 24): player type = 1

V/MediaPlayerService( 24): create PVPlayer

V/PVPlayer( 24): PVPlayer constructor

V/PVPlayer( 24): construct PlayerDriver

V/PlayerDriver( 24): constructor

V/PlayerDriver( 24): start player thread

V/PlayerDriver( 24): startPlayerThread

V/PlayerDriver( 24): InitializeForThread

V/PlayerDriver( 24): OMX_Init

V/PlayerDriver( 24): OsclScheduler::Init

V/PlayerDriver( 24): CreatePlayer

V/PlayerDriver( 24): AddToScheduler

V/PlayerDriver( 24): PendForExec

V/PlayerDriver( 24): OsclActiveScheduler::Current

V/PlayerDriver( 24): StartScheduler

V/PVPlayer( 24): send PLAYER_SETUP

V/PlayerDriver( 24): Send player command: 2

V/PlayerDriver( 24): CommandCompleted

V/PlayerDriver( 24): Command 2 status=1

V/PVPlayer( 24): setDataSource(10, 0, 370021)

V/MediaPlayer( 182): MediaPlayer::setAudioStreamType

V/MediaPlayer( 182): prepare

V/MediaPlayerService( 24): [1] setAudioStreamType(3)

V/MediaPlayerService( 24): [1] prepareAsync

V/PVPlayer( 24)



Logging OpenCore through logcat

by raj.10788 » Tue, 07 Apr 2009 11:52:26 GMT


 i Das,


Can you please tell me the setps to execute the open core test cases.
I am new to this one. I am trying to understand the media frame work.
So can you please help me out in this.


On Mar 4, 11:42pm, "das.ar...@gmail.com" <das.ar...@gmail.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Logging OpenCore through logcat

by das.ar...@gmail.com » Tue, 14 Apr 2009 13:51:44 GMT


 he steps are
<android-root>$ source build/envsetup.sh
<android-root>$ lunch 1
<android-root>$ make clean
<android-root>$ make -j2 ENABLE_PV_LOGGING=1
<android-root>$ emulator & adb logcat

On Apr 7, 4:50pm, "raj.10788" <raj.10...@gmail.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. adb push wtf

C:\android-sdk-windows-1.1_r1\tools>adb push C:\src\test \data
failed to copy 'C:\src\test' to '\data': Read-only file system

wtf??
--~--~---------~--~----~------------~-------~--~----~

2. Problem with multi select listview with default selected List Items.

HI,

I want to create multi select listview with checkbox. and also make checked
= true for some of the item based on some business rule.

I can get the list view with multiple choice option working but I am not
able to load some of the item as default checked when list view first
loaded.

I tried using custom list adpater with following code, but its not working
at all.

if (convertView == null) {
convertView =
mInflater.inflate(android.R.layout.simple_list_item_multiple_choice, null);

holder = new ViewHolder();
holder.checkbox = (CheckedTextView)
convertView.findViewById(android.R.id.text1);

convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
//holder.checkbox.setChecked(true);
String mvalue = ((Item)lv.get(position)).getValue();
holder.checkbox.setText(mvalue);
if(mSelectedValues != null && mSelectedValues.length > 0) {
boolean blnSetChecked = false;
for(String s : mSelectedValues) {
if(s.equalsIgnoreCase(mvalue)) {
blnSetChecked = true;
break;
}
}
holder.checkbox.setChecked(blnSetChecked);
} else
holder.checkbox.setChecked(false);

return convertView;


I have also set follwoign property for listview after setting custom
adapter.

lvList.setItemsCanFocus(false);
lvList.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

Please help me to get this working.

Thanks in Advance.

--~--~---------~--~----~------------~-------~--~----~

3. I want to run my application in system process instead of application

4. suggestion for keyboard

5. Check Download freeware for you

6. SDK 1.5 CPU usage

7. Unbale to opem IM app.