yashsingh1/xdaforums huggingface dataset:
[Nook Color Android Development] ParMaster:
OK so I upgraded to the 0106 nightly and ran USB host diagnostics v.1.2 on it per byttes success with its detailed info. I am seeing device recognized under rooted api... I get that if I plug the nook into the hub when I have a y cable to the hub supplying power to the nook while it is shut off and the charging apparently powers the nook on. When I already have the nook booted however cm10 crashes when I plug the hub into it. After I power back up after the crash theres no /proc/last_kmsg
[Nook Color Android Development] steven676:
Okay, so it works if you boot with the device already plugged in, but not if you plug it in after boot? Interesting.

As for the crash, if you actually need to press the power switch, /proc/last_kmsg won't help -- it's useful in the cases where the system reboots on its own. It should in principle reboot on its own anytime there's a kernel panic, but I wouldn't bet a huge sum on that -- having a working hardware watchdog timer would be better (I've been playing with that without too much success recently).
[Nook Color Android Development] ParMaster:
I won't say it works as i had it working on 1229 the one single time actually playing audio through a USB audio device and all USB connected devices enumerating properly. I am only seeing that USB Diagnostics v1.2 shows that rooted api detects a usb device. I had absolutely no success with the hardware working at all on this nightly build even once. The USB Diagnostics v1.2 consistently shows under rooted api usb device detected when i plug in the cable in the manner i previously stated.
[Nook Color Android Development] bytte:
I look forward to a working watchdog - hopefully giving a kernel dump.

My experience of last_kmsg is different. At around 15:00 it wouldn't resume. Not charging etc. Long power press with USB attached. Booted. Adb pull last_kmsg showed the last log entries were: exit suspend at 12:38 ... PM:Entering mem sleep.

So last_kmsg seems to do what it says on the can.

What had I done to upset it? Cancelled all the alerts in eBay configuration, and uninstalled Amazon appstore (which would have killed the running app). That is the second time that killing an app may have lead to a resume issue. Uhm... I don't normally have such issues.

The good news is it has just slept for 22 mins without being woken for no good reason.
[Nook Color Android Development] bytte:
.

I can't reproduce that.

I have a Y USB cable supplying power for NC (and hub when connected) from a non-BN charger (not shorting data to gnd). Attaching the hub no longer crashes, but I have not had the hub recognised.

I do have some additional info though:

Do the above while having adb connected over wifi, and in adb do cat /proc/kmsg - that gives a realtime(ish) dump of kprintfs to the laptop.

The first time I do Start Diagnostics in USB Host Diag I get:

<7>hub 1-0:1.0: hub_resume

<7>hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0000

<7>hub 1-0:1.0: hub_suspend

<7>usb usb1: bus auto-suspend

Repeated runs of "Start Diagnostics" does not produce that output, but killing and restarting/rerunning USB Host Diag - start diag does. I shall now do some searching in the kernel source for the above.

Seems the hub_suspend call is from outside of usb/core/hub.c. Is there a working kgdb for encore, or other ideas on how to determine who is calling that function?

UPDATE

dump_stack() works with the current kernel_config:

<7>usb_set_device_state state 0x7

<7>hub 1-0:1.0: hub_resume

<7>hub_port_status status 0x100

<7>hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0000

<7>hub_suspend

<4>[<c0045788>] (unwind_backtrace+0x0/0xe0) from [<c0324ffc>] (hub_suspend+0x38/0xd0)

<4>[<c0324ffc>] (hub_suspend+0x38/0xd0) from [<c032e414>] (usb_suspend_both+0x78/0x1b8)

<4>[<c032e414>] (usb_suspend_both+0x78/0x1b8) from [<c032efe4>] (usb_runtime_suspend+0x24/0x38)

<4>[<c032efe4>] (usb_runtime_suspend+0x24/0x38) from [<c02f43a4>] (rpm_callback+0x64/0x84)

<4>[<c02f43a4>] (rpm_callback+0x64/0x84) from [<c02f4df0>] (rpm_suspend+0x22c/0x3f8)

<4>[<c02f4df0>] (rpm_suspend+0x22c/0x3f8) from [<c02f535c>] (__pm_runtime_suspend+0x54/0x80)

<4>[<c02f535c>] (__pm_runtime_suspend+0x54/0x80) from [<c0332628>] (usbdev_release+0x90/0xd8)

<4>[<c0332628>] (usbdev_release+0x90/0xd8) from [<c0111678>] (fput+0x104/0x1f8)

<4>[<c0111678>] (fput+0x104/0x1f8) from [<c010e624>] (filp_close+0x70/0x7c)

<4>[<c010e624>] (filp_close+0x70/0x7c) from [<c010e6f4>] (sys_close+0xc4/0x11c)

<4>[<c010e6f4>] (sys_close+0xc4/0x11c) from [<c0040f20>] (ret_fast_syscall+0x0/0x30)

<7>hub 1-0:1.0: hub_suspend

<7>usb usb1: bus auto-suspend

<7>usb_set_device_state state 0x8

So it seems likely that USB Host Diag caused the suspend by closing some fd - is that expected???

---------- Post added at 05:56 PM ---------- Previous post was at 05:20 PM ----------

Grabbed from latest nightly as suggested by Steven676, but things got worse! Original problem was that BBC Media Player had no video (audio was fine as was the UI progress bar etc). Installing this module resulted in no audio and ANR. (Wireshark showed that data was being streamed). Running the nightly or my own build both behave the same.
[Nook Color Android Development] steven676:
(emphasis mine)

I'd guess that having USB attached might have something to do with it? I can't say I've ever tried that before. The RAM console just stores the log messages in a particular location in memory, so the messages aren't going to survive a true power-off/power-on cycle.

We take a wakelock when anything other than an AC adapter is connected to the USB port. Generally, if nothing is holding a wakelock, an Android kernel will suspend the system. (And yes, the Android userland has to hold a wakelock while the screen is on in order to prevent the system from suspending.)

This sounds like DSP firmware being out of sync with everything else -- try wiping your /system and then flashing a nightly. (I also recall personally seeing problems when not wiping /data while poking around the codecs, but can't offer any explanation as to why that would be.) I'd then clobber vendor/bn in your local Android source tree and then re-run extract-files.sh with your freshly wiped/installed device connected.
[Nook Color Android Development] bytte:
The app was still running with the UI displayed and there were none of the usual suspend messages from the kernel - just USB hub suspend brought about by the FD close - very odd.
[Nook Color Android Development] hwong96:
I have set up a 64bit laptop Intel duo core2 with Ubuntu 12.10.1 with Java 1.6.0_24, Open JDK Runtime Environment and Open JDK 64bit server VM. Had done repo sync for jellybean, prebuilts, set up adb for proprietary blobs, and brunch encore. Build started and ran for a long time (5 hours) and errored out with the following:

Copy xml: /home/../android/system/out/target/product/encore/system/etc/system_fonts.xml

/bin/bash: xmllint: command not found

make: *** [/home/../android/system/out/target/product/encore/system/etc/system_fonts.xml] Error 127

make: *** Waiting for unfinished jobs....

I ran sudo apt-get install libxml2 and terminal printed 'libxml2 is already the newest version'.

I got verification that repo sync completed with the following :

Repository synced!

Looking for dependencies

Adding dependencies to manifest

Adding dependency: CyanogenMod/android_kernel_bn_encore => kernel/bn/encore

Syncing dependencies

... A new repo command (1.18) is available.

... You should upgrade soon.

Fetching projects: 100% (1/1), done.

Checking out files: 100% (37733/37733), done.

Done

Any idea how I can correct the xmllint error 127?
[Nook Color Android Development] leapinlar:
I had this problem too. I can't remember how I exactly fixed it but I think I had to install libxslt also.

Sent from my HD+ running CM10 on SD with XDA Premium
[Nook Color Android Development] hwong96:
I installed libxslt and libxml2-utils. Its building without errors now.
[Nook Color Android Development] bytte:
The following fixes the ANR:

# pwd

/android/system/frameworks/av/media/libstagefright

# git diff OMXCodec.cpp

diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 05a2fa6..446dcb4 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -5569,6 +5569,7 @@ status_t QueryCodec(
param.nPortIndex = !isEncoder ? 0 : 1;

for (param.nProfileIndex = 0;; ++param.nProfileIndex) {
+ int npi = param.nProfileIndex; // it appears that in at least one case getParameter resets param.nProfileIndex to the max valid value
err = omx->getParameter(
node, OMX_IndexParamVideoProfileLevelQuerySupported,
&param, sizeof(param));
@@ -5576,11 +5577,14 @@ status_t QueryCodec(
if (err != OK) {
break;
}
+ if (param.nProfileIndex != npi) {
+ break;
+ }

CodecProfileLevel profileLevel;
profileLevel.mProfile = param.eProfile;
profileLevel.mLevel = param.eLevel;
-
+ ALOGD("CodecProfileLevel Index %d, Profile 0x%x, Level 0x%x\n", param.nProfileIndex, param.eProfile, param.eLevel);
caps->mProfileLevels.push(profileLevel);
}

@@ -5589,12 +5593,17 @@ status_t QueryCodec(
InitOMXParams(&portFormat);
portFormat.nPortIndex = !isEncoder ? 1 : 0;
for (portFormat.nIndex = 0;; ++portFormat.nIndex) {
+ int pfni = portFormat.nIndex; // it appears that in at least one case getParameter resets portFormat.nIndeX to the max valid value
err = omx->getParameter(
node, OMX_IndexParamVideoPortFormat,
&portFormat, sizeof(portFormat));
if (err != OK) {
break;
}
+ if (pfni != portFormat.nIndex) {
+ break;
+ }
+ ALOGD("PortFormat Index %d, ColorFormat 0x%x\n", portFormat.nIndex, portFormat.eColorFormat);
caps->mColorFormats.push(portFormat.eColorFormat);
}

I still don't have working video, but at least there is more to go on.

The logcat is here: http://pastebin.com/e7kGR8GK

If there is someone who understands more about video than me, please advise, and consider committing the above fix.

Thanks

Nigel
[Nook Color Android Development] steven676:
Nothing obvious springs to mind after a quick look. Does video work with apps other than iPlayer (with or without your patch)? What, precisely, happens when you try to play video?
[Nook Color Android Development] bytte:
Other video apps, eg YouTube, worked fine without the patch.

Iplayer radio worked ok but Iplayer TV had audio but no video. In all cases the progress bar was present and updated on screen.

I then noted that libOMX.TI.720P.Decoder.so was missing. Adding it resulted in ANR.

With the patch the behaviour is similar to when the .so was missing.

On CM7.1 Iplayer behaves similarly (without patch) except that whereas in CM10 the video 'plain' is black, on CM7.1 the video 'plain' has the first video frame frozen (doesn't update). Stop and restart (live TV) gives a later frame. Running logcat shows the following during buffering at iplayer startup (there is a buffering widget):

E/OMXCodec( 9651): Timed out waiting for the buffer! Line 3305

UPDATED

========

I have enhanced the logging from CM10, so now have:

E/OMXNodeInstance( 1266): OMX_GetExtensionIndex failed 'OMX.google.android.index.enableAndroidNativeBuffers' handle 0x40dba118

The handle isn't reported elsewhere in the log but you can see the position of the entry in the previous pastebin - search for E/OMXNodeInstance

Perhaps worth mentioning is that IPlayer / MediaPlayer are Android apps so they may be taking advantage of Android features not exercised by other platforms (YouTube).
[Nook Color Android Development] hwong96:
Update to my Ubuntu build:

My initial Ubuntu build was with Windows Wubi with 30gb space. The build ran out of space while writing the wifi drivers.

I then tried VirtualBox but it was looking for the 32bit Ubuntu version. Virtualbox only set up one CPU.

My final setup was with Ubuntu desktop with a 60gb partition. I haven't repo sync yet, just adb.

Update 20130113 11:44PM

Build completed with 17gb remaining in the /home/android/system. The 10-20130113-UNOFFICIAL.zip file installed OK on SD card.
[Nook Color Android Development] bytte:
You should be OK.

du /android/system gives 32 gb.
[Nook Color Android Development] skwalas:
I'm setting up a dual boot system myself. This last message got me thinking, does compiling require one contiguous root partition greater than 30 GB, or can /output be under /home? Current setup is 20GB root and 50GB /home. I had intended to put /output under /home based on advice elsewhere.
[Nook Color Android Development] leapinlar:
Home works. Just put android/system there.

Sent from my HD+ running CM10 on SD with XDA Premium
[Nook Color Android Development] hwong96:
I entered the following command to do some otg testing using a modified encore_defconfig file for otg testing:

hubert@hubert-Qosmio-F55:~$ make ARCH=arm CROSS_COMPILE=~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi- encore_defconfig_test_otg

Terminal returned the following:

make: *** No rule to make target `encore_defconfig_test_otg'. Stop.

My setup is Ubuntu 12.10 on 3.5.0.17 kernel with a 60 gb partition. I followed fattire's post #3337 page 334. I used the compiler from CM prebuilts.

The 3.08 kernel source was already downloaded as I had already built an unofficial nightly (post #3421 above). Any ideas/suggestions?
[Nook Color Android Development] bytte:
The target that you are building has to exist in the makefile, so you can't just create a new configuration file name and expect it to work.

The following should help:

cp encore_defconfig encore_defconfig.issue

mv encore_defconfig_test_otg encore_defconfig

Then just follow fattire's guide.
[Nook Color Android Development] bytte:
Continuing my quest to get BBC media player functioning, I have identified the following probable bug:

root@nigel-ThinkPad-Edge-E420s:/media/android/android/system/frameworks/av/media/libstagefright# git diff ACodec.cpp
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 98bdbe1..c3d3951 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -16,7 +16,7 @@

//#define LOG_NDEBUG 0
#define LOG_TAG "ACodec"
-
+#include <utils/Log.h>
#include <media/stagefright/ACodec.h>

#include <binder/MemoryDealer.h>
@@ -3140,6 +3140,7 @@ bool ACodec::LoadedState::onConfigureComponent(
const sp<AMessage> &msg) {
ALOGV("onConfigureComponent");

+ ALOGD("%s: %s\n", __FUNCTION__, msg->debugString(4).c_str());
CHECK(mCodec->mNode != NULL);

AString mime;
@@ -3154,10 +3155,12 @@ bool ACodec::LoadedState::onConfigureComponent(
mCodec->signalError(OMX_ErrorUndefined, err);
return false;
}
+ ALOGD("configureCodec %s OK\n", mCodec->mComponentName.c_str());

sp<RefBase> obj;
if (msg->findObject("native-window", &obj)
&& strncmp("OMX.google.", mCodec->mComponentName.c_str(), 11)) {
+ ALOGD("native-window %s\n", mCodec->mComponentName.c_str());
sp<NativeWindowWrapper> nativeWindow(
static_cast<NativeWindowWrapper *>(obj.get()));
CHECK(nativeWindow != NULL);
@@ -3166,8 +3169,8 @@ bool ACodec::LoadedState::onConfigureComponent(
native_window_set_scaling_mode(
mCodec->mNativeWindow.get(),
NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW);
+ CHECK_EQ((status_t)OK, mCodec->initNativeWindow());
}
- CHECK_EQ((status_t)OK, mCodec->initNativeWindow());

{
sp<AMessage> notify = mCodec->mNotify->dup();

If you ignore the extra debug output, it is a one-line change to take the initNativeWindow() call inside the scope of:

if (msg->findObject("native-window", &obj)
&& strncmp("OMX.google.", mCodec->mComponentName.c_str(), 11)) {

Without that change it was being called and errored for audio msgs (amongst others).

That still didn't get me working video; however, replacing vendor /system/lib/libOMX.TI.720P.Decoder.so with an earlier release did.

The version in the nightlies (as at 7 Jan 2013) was DEC_3630_06_11_2012. I replaced it with DEC_3630_05_16_2011. I have not tested it extensively; however, the difference was between a black screen and correctly time-synced video. In the latest test I watched over 5 mins of video without issue. In an earlier test there were numerous problems trying to resync (I don't know whether that was caused by poor download bandwidth or something else).

I comparison of the two binaries, shows that the newer one additionally imports libion and libhardware (so I'm quite impressed that the 2011 version runs at all).

Hopefully, someone knowledgeable knows more of the background to the 2012 version, and may be able to shed some light on the underlying problem.
[Nook Color Android Development] steven676:
Do you need the patch to frameworks/av to get things to play, or is the decoder swap sufficient? Also, where are you getting the older libOMX.TI.720P.Decoder -- an older CM9/10 build?

Also, do you have http://review.cyanogenmod.org/#/c/26498/ applied? (I don't expect it'll make a difference, I'm just checking.)
[Nook Color Android Development] bytte:
I had applied the patch before I swapped the decoder - so I don't know if it was needed, but the patched stopped the error in the previously posted log.

E/OMXNodeInstance( 1266): OMX_GetExtensionIndex failed

I had not applied 26498 but it looks as if it could be associated with one of the failures I saw

I/DEBUG ( 1262): backtrace:
I/DEBUG ( 1262): #00 pc 00000000 <unknown>
I/DEBUG ( 1262): #01 pc 00000b1f /system/lib/libstagefrighthw.so (android::TIOMXPlugin::~TIOMXPlugin()+18)
I/DEBUG ( 1262): #02 pc 00000b45 /system/lib/libstagefrighthw.so (android::TIOMXPlugin::~TIOMXPlugin()+4)
I/DEBUG ( 1262): #03 pc 0000c0a3 /system/lib/libstagefright_omx.so (android::eek:MXMaster::clearPlugins()+58)
I/DEBUG ( 1262): #04 pc 0000c0d5 /system/lib/libstagefright_omx.so (android::eek:MXMaster::~OMXMaster()+12)
I/DEBUG ( 1262): #05 pc 0000c11d /system/lib/libstagefright_omx.so (android::eek:MXMaster::~OMXMaster()+4)
I/DEBUG ( 1262): #06 pc 0000ae57 /system/lib/libstagefright_omx.so (android::eek:MX::~OMX()+38)
I/DEBUG ( 1262): #07 pc 0000aee1 /system/lib/libstagefright_omx.so (android::eek:MX::~OMX()+4)

I have PMed you with the source of the decoder.

Nigel
[Nook Color Android Development] steven676:
That's a decoder built for Gingerbread, and as such wouldn't have native buffers of that sort in the first place. Choppiness might be caused by fallback to the software decoder; the "regular" (non-720p) hardware decoder doesn't handle anything above a certain size (I want to say 640x360, but I don't recall exactly).

What happens when you remove the 720p decoder from /system/etc/media_codecs.xml?
[Nook Color Android Development] bytte:
The following may provide some clue as to how to proceed:

Running with both TI codecs disabled, I found that there was still no video. I then noted in one case there was, after a shorts pause, video displayed, as there was previously with just TI.720P disabled. Logcat showed that in this case mediaserver had died with a SEGV:

F/ACodec ( 1266): frameworks/av/media/libstagefright/ACodec.cpp:2609 CHECK_LE( buffer->size(),info->mData->capacity()) failed: 74892 vs. 65536
F/libc ( 1266): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 2654 (NuPlayerDecoder)
I/DEBUG ( 1262): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 1262): Build fingerprint: 'bn/bn_encore/encore:4.1.2/JZO54K/228551:user/release-keys'
I/DEBUG ( 1262): pid: 1266, tid: 2654, name: NuPlayerDecoder >>> /system/bin/mediaserver <<<
I/DEBUG ( 1262): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad

It was the automatically restarted mediaserver that displayed the video.

I found that this situation was repeatable: start IPlayer, wait until there was audio but no video, issue kill -SEGV to <PID of mediaserver>, and after a few seconds the newly created mediaserver displayed audio and video.

How can I leverage this to work out the cause of the problem?

Of the config msgs sent to the old server, were any remembered by the hardware?

Of the remainder, were they the cause of the problem (presumably the new server had no knowledge of their content).

[I tried this without disabling the TI Codecs, but JB 720P seemed to be catching the signal].

Any thoughts?

Nigel
[Nook Color Android Development] steven676:
Quite honestly, in that case, I'm stumped. If it still misbehaves with software codecs, then the suggestion is that it's either a bug in the media framework or the application. If you can get another device running CM10, try it with just software codecs and see what happens.

That's an assertion failure in the framework which is probably worth looking into.

Nothing in the video part, if you disabled the hardware decoders. The sound hardware will be reconfigured by the restart, though.

Send SIGKILL instead, which cannot be caught or ignored. (If it still hangs without terminating, that implies that the process is blocking on a system call, which would imply that strace output would be interesting.)
[Nook Color Android Development] bytte:
Different topic

Several people have complained of extreme sluggishness when waking. I had such an issue. Top gave:

User 2%, System 10%, IOW 87%, IRQ 0%
User 8 + Nice 0 + Sys 33 + Idle 0 + IOW 279 + IRQ 0 + SIRQ 0 = 320

User 2%, System 10%, IOW 86%, IRQ 0%
User 9 + Nice 0 + Sys 33 + Idle 0 + IOW 276 + IRQ 0 + SIRQ 0 = 318

PID PR CPU% S #THR VSS RSS PCY UID Name
16457 0 4% R 1 1112K 472K root top
817 0 3% D 1 0K 0K root mmcqd/1
1336 0 2% D 1 368K 124K root /sbin/adbd
1227 0 2% D 1 0K 0K root jbd2/mmcblk1p3-
1540 0 1% S 83 592556K 67276K fg system system_server
15171 0 1% S 1 0K 0K root kworker/0:3
1632 0 0% S 19 512924K 56048K fg u0_a29 com.android.systemui
6 0 0% S 1 0K 0K root rcu_kthread
1263 0 0% S 9 65984K 42320K fg system /system/bin/surfaceflinger

The values were similar over several samples.

Nigel
[Nook Color Android Development] webyrd:
NOOB questions

OK, after totally ignoring fattire's "STATE OF THE UM, STATE OF THINGS" for about a year, CM10 and my SOD's got me interested in trying to build myself. I installed an old 320G drive on the computer and loaded Ubuntu 12.04 (don't ask me why, seemed like a good choice at the time, I'm starting to wonder) about a month ago, needed to keep Windows for the family. Played with it for a few weeks to learn a little about the OS (Linux NOOB) and then started setting up my build environment per http://wiki.cyanogenmod.org/index.php?title=Build_for_encore - took a while, no major problems, just trying to learn a little as I go, searching for explanations as to what/why I am doing rather than just entering commands that I don't really understand (any advice on good (and free) places to learn would be appreciated). Anyways, decided to start with CM10 rather than CM10.1 and got to my first $ repo sync (for anyone following in my footsteps, do not follow the advice "Prepare to wait a long time while the source code downloads." on the Wiki, don't wait, find something else to do, cook and eat dinner, watch a movie, take a nap, you might have time to do all three). I noticed some errors in the output, such as:

remote: aborting due to possible repository corruption on the remote side.

fatal: early EOF

fatal: index-pack failed

I am guessing that re-running $ repo sync until there are no errors is my next step before actually trying to build, if I am wrong please let me know, if not, I guess I'll learn the hard way since I'm trying it now.

Also, I posted on http://xdaforums.com/showpost.php?p=37781202&postcount=50 with a logcat from a SOD - logcat file actually at https://www.dropbox.com/s/vxjwv7s9nffgyd2/020913.txt - most of it is like reading a foriegn language to me. Any suggestions where can I learn to understand what the logcat is telling me?

Thanks in advance for the help and thanks again for all the great work - wish me luck.
[Nook Color Android Development] hwong96:
What is your download speed? 300mbs takes 3-4 hours. 1.5Gbs takes 1 hour. You should end up with a line "repo synced!' in the terminal. I have successfully built CM10 several times and several uImages experimenting with usb OTG (not working yet). I'm thinking of moving on to CM10.1 soon.