Error! Sometimes they are hard to find!

Sometimes errors can be nested deep in the terminal output, in fact, sometimes it is so deep that you have to scroll back several HUNDRED LINES just to find it. Consider this real example from helping a fellow developer:

[CODE]

….EDITED FOR SPACE….
….LINE# 135….

device/samsung/grandprimeve3g/libs/audio/audio_hw.c:666:34: error: ‘AUDIO_DEVICE_OUT_FM_SPEAKER’ undeclared here (not in a function)
{ AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_OUT_FM_SPEAKER, “speaker” },
^
device/samsung/grandprimeve3g/libs/audio/audio_hw.c:667:75: error: ‘AUDIO_DEVICE_OUT_FM_HEADSET’ undeclared here (not in a function)
{ AUDIO_DEVICE_OUT_WIRED_HEADSET | AUDIO_DEVICE_OUT_WIRED_HEADPHONE | AUDIO_DEVICE_OUT_FM_HEADSET, “headphone” },
^
device/samsung/grandprimeve3g/libs/audio/audio_hw.c:670:44: error: ‘AUDIO_DEVICE_OUT_ALL_FM’ undeclared here (not in a function)
{ AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET | AUDIO_DEVICE_OUT_ALL_FM, “line” },
^
device/samsung/grandprimeve3g/libs/audio/audio_hw.c:684:32: error: invalid operands to binary | (have ‘int’ and ‘const struct dev_names_para_t *’)
{ AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_OUT_FM_SPEAKER, “speaker” },
^
device/samsung/grandprimeve3g/libs/audio/audio_hw.c:684:5: error: initializer element is not constant
{ AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_OUT_FM_SPEAKER, “speaker” },
^
device/samsung/grandprimeve3g/libs/audio/audio_hw.c:684:5: error: (near initialization for ‘dev_names_digitalfm[0].mask’)
device/samsung/grandprimeve3g/libs/audio/audio_hw.c:685:73: error: invalid operands to binary | (have ‘int’ and ‘const struct dev_names_para_t *’)
{ AUDIO_DEVICE_OUT_WIRED_HEADSET | AUDIO_DEVICE_OUT_WIRED_HEADPHONE | AUDIO_DEVICE_OUT_FM_HEADSET, “headphone” },
^
device/samsung/grandprimeve3g/libs/audio/audio_hw.c:685:5: error: initializer element is not constant
{ AUDIO_DEVICE_OUT_WIRED_HEADSET | AUDIO_DEVICE_OUT_WIRED_HEADPHONE | AUDIO_DEVICE_OUT_FM_HEADSET, “headphone” },
^
device/samsung/grandprimeve3g/libs/audio/audio_hw.c:685:5: error: (near initialization for ‘dev_names_digitalfm[1].mask’)
In file included from device/samsung/grandprimeve3g/libs/audio/audio_hw.c:810:0:

….EDITED FOR SPACE….
….LINE# 843….

build/core/binary.mk:803: recipe for target ‘/home/hassan/Working/LiquidDark-RRO-Layer-Ih24n/out/target/product/grandprimeve3g/obj/SHARED_LIBRARIES/audio.primary.sc8830_intermediates/audio_hw.o’ failed
make: *** [/home/hassan/Working/LiquidDark-RRO-Layer-Ih24n/out/target/product/grandprimeve3g/obj/SHARED_LIBRARIES/audio.primary.sc8830_intermediates/audio_hw.o] Error 1
make: *** Waiting for unfinished jobs….

….EDITED FOR SPACE….
….LINE# 990….

device/samsung/grandprimeve3g/libs/audio/record_process/aud_proc_config.c:956:5: warning: (near initialization for ‘recordeq_filter_set[0]’) [-Wmissing-braces]
device/samsung/grandprimeve3g/libs/audio/record_process/aud_proc_config.c: In function ‘AUDPROC_ProcessDp’:
device/samsung/grandprimeve3g/libs/audio/record_process/aud_proc_config.c:1319:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(si=0;si<uiSrcCount;si++)//AUDIO POST PROCESS
^

#### make failed to build some targets (53:06 (mm:ss)) ####

Total time elapsed: 53 minutes 12 seconds

[/CODE]

As you can see, the "make failed" line is around line 990 of the terminal output. However, the line that actually shows that make has an error is back at line 840, and the reason make has an error is all the way back at line 135! Sometimes what we are looking for is really hard to find, especially if you are scrolling through seemingly endless terminal outputs trying to read every line, looking for your failure.

One great trick that you can use is to copy your output into a text file. Then you can use standard search tools, like grep, or even your text applications search functions to find key words like: error, fail, stop, forbidden warning, or other similar words that clue you in to the real problem.

In this case, the issue that he had was captured in line 135 of his copied output from the terminal:

[CODE]

device/samsung/grandprimeve3g/libs/audio/audio_hw.c:666:34: error: 'AUDIO_DEVICE_OUT_FM_SPEAKER' undeclared here (not in a function)
{ AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_OUT_FM_SPEAKER, "speaker" },

[/CODE]

There are several options, one of which is this:

The audio_hw.c file line 666:

{ AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_OUT_FM_SPEAKER, "speaker" },

Wecould remove "AUDIO_DEVICE_OUT_FM_SPEAKER"

Like this:
{ AUDIO_DEVICE_OUT_SPEAKER, "speaker" },

And do the same for the other lines with errors. The compiler is saying that it does not know what AUDIO_DEVICE_OUT_FM_SPEAKER is, so we either need to declare it or get rid of it. To declare it is tricky and would take a little bit of ingenuity and fore thought, as well as a full understanding of what it should be declared as. If we remove it, then that function will not work. E.G., the Audio device out FM speaker. As long as you have the main other speakers defined, then it should work. If the sound then does not work in the finished product, then we can come back and declare it instead.

Sometimes there are other options for something that doesn't exist in your phone model, other times, these items need to be declared from your device tree as either existing or not, and if so, what they are supposed to be declared as. Either way, it was fun to help another developer with their project, and I am sure that they will turn out some great work!

Linux – keep it simple.

Breaking down a gif file into frames

I was having a bit of fun with Gimp and put together this new boot animation for Liquid Smooth.

The principle thing that I did was create a template that was black with the Liquid Smooth logo cut out. Then I grabbed a raindrop gif that was freely available online. I then used this command to break it down from a gif into the various frames:

$ convert raindrops.gif 100.png

This created a file named 100-*.png for each frame (100-1.png, 100-2.png, etc.). ImageMagic is a very neat program, and if you are a Linux user, I suggest you apt-get/yum it. It works marvels! After breaking down the gif, I placed each frame behind the cutout I made earlier, and created each frame for my boot animation. Feel free to download it and check it out!

Download Link: http://www.mediafire.com/download/0n5zsxarxbk6b3b/akls6.zip

Linux – keep it simple.

When LiquidSmooth gets rough!

Among the many roms that I am currently working on, one of them is Liquid-Marshmallow (LiquidSmooth 6.0.1) for the Samsung Galaxy S4, T-Mobile variant (SGH-M919, JFLTETMO). There are a couple of problems with this endevour, not the least of which is that official development of LiquidSmooth has stopped. That’s right, LS as a group has decided to call it quits. That being said, any further development of LS roms requires a bit more finess, as the repository is no longer being updated with the current Android repository changes.

However, to God be the glory, I was able to compile a booting Liquid-Marshmallow for my phone. Unfortunately, it is a bit buggy. Here is my change log:

20160628
-Added Texting app
-changed background to liquidsmooth
-Added AKLU-Lionheart kernel

20160627
-Fixed Audio
-Fixed Root
-Added homemade liquidsmooth boot animation (not great, but it will do)

20160623
-First successful boot
-No GPS
-No Audio
-No root
-No text message app
-No default ringtone/notification tone
-Browser fail
-Layers fail
-Google boot animation

As you can see, it has been a grand adventure, one which I was hoping would come to a very grand end! Unfortunately, there are still several issues that I am working on, and that may cause the project to get scrapped altogether. For instance, you can make phone calls, play games, and the like, but you cannot open up a web browser. Actually, to be more specific, it appears that you cannot use data, either cellular nor WiFi. Look at this logcat:

[CODE]
06-30 19:59:33.643 585 1932 I Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 09/02/15, 76f806e, Ibddc658e36
06-30 19:59:33.643 585 1932 I OpenGLRenderer: Initialized EGL, version 1.4
06-30 19:59:33.665 231 296 E BufferQueueProducer: [Application Error: com.android.browser] allocateBuffers: slot 0 without buffer is not FREE
06-30 19:59:34.098 585 607 W ActivityManager: Activity pause timeout for ActivityRecord{1fd54da u0 com.android.browser/.BrowserActivity t11 f}
06-30 19:59:34.733 1242 1388 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer…
06-30 19:59:34.735 1242 1388 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer…
06-30 19:59:35.021 2795 2795 I Process : Sending signal. PID: 2795 SIG: 9
06-30 19:59:35.035 246 684 D ALSAStreamOps: setParameters(): keyRouting with device 0x2
06-30 19:59:35.035 246 684 D ALSAStreamOps: setParameters(): keyRouting with device 0x2
06-30 19:59:35.035 246 684 D ALSADevice: route: devices 0x2 in mode 0
06-30 19:59:35.035 246 684 D ALSADevice: No valid input device: 0
06-30 19:59:35.036 246 684 D alsa_ucm: snd_use_case_set(): uc_mgr 0xb3198540 identifier _enadev value Speaker
06-30 19:59:35.036 246 684 D alsa_ucm: Set mixer controls for HiFi enable 1
06-30 19:59:35.036 246 684 D alsa_ucm: Setting mixer control: SLIMBUS_0_RX Audio Mixer MultiMedia1, value: 1
06-30 19:59:35.036 246 684 D ALSADevice: switchDevice: mCurTxUCMDevivce None mCurRxDevDevice Speaker
06-30 19:59:35.039 585 1420 W InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@de9bee2 attribute=null, token = android.os.BinderProxy@f0abec7
06-30 19:59:35.068 246 684 D AudioFlinger: mixer(0xb2480000) throttle end: throttle time(10)
06-30 19:59:35.161 585 1259 I ActivityManager: Process com.android.browser (pid 2795) has died
06-30 19:59:35.200 585 619 W AppOps : Finishing op nesting under-run: uid 1000 pkg android code 24 time=0 duration=0 nesting=0
06-30 19:59:35.991 585 880 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 pkg=com.android.browser cmp=com.android.browser/.BrowserActivity bnds=[849,1676][1050,1928] (has extras)} from uid 10015 on display 0
06-30 19:59:35.994 246 684 D ALSAStreamOps: setParameters(): keyRouting with device 0x2
06-30 19:59:35.994 246 684 D ALSAStreamOps: setParameters(): keyRouting with device 0x2
06-30 19:59:35.994 246 684 D ALSADevice: route: devices 0x2 in mode 0
06-30 19:59:35.995 246 684 D ALSADevice: No valid input device: 0
06-30 19:59:35.995 246 684 D alsa_ucm: snd_use_case_set(): uc_mgr 0xb3198540 identifier _enadev value Speaker
06-30 19:59:35.995 246 684 D alsa_ucm: Set mixer controls for HiFi enable 1
06-30 19:59:35.995 246 684 D alsa_ucm: Setting mixer control: SLIMBUS_0_RX Audio Mixer MultiMedia1, value: 1
06-30 19:59:35.996 246 684 D ALSADevice: switchDevice: mCurTxUCMDevivce None mCurRxDevDevice Speaker
06-30 19:59:36.052 585 1277 I ActivityManager: Start proc 2870:com.android.browser/u0a24 for activity com.android.browser/.BrowserActivity
06-30 19:59:36.135 2870 2870 W System : ClassLoader referenced unknown path: /system/app/Browser/lib/arm
06-30 19:59:36.174 2870 2891 E ActivityThread: Failed to find provider info for com.google.settings
06-30 19:59:36.175 2870 2891 E ActivityThread: Failed to find provider info for com.google.settings
06-30 19:59:36.182 2870 2870 E WebViewFactory: Chromium WebView package does not exist
06-30 19:59:36.182 2870 2870 E WebViewFactory: android.webkit.WebViewFactory$MissingWebViewPackageException: android.content.pm.PackageManager$NameNotFoundException: com.android.webview
06-30 19:59:36.182 2870 2870 E WebViewFactory: at android.webkit.WebViewFactory.fetchPackageInfo(WebViewFactory.java:116)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:190)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:165)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at android.webkit.CookieManager.getInstance(CookieManager.java:39)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at com.android.browser.BrowserSettings.syncSharedSettings(BrowserSettings.java:312)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at com.android.browser.BrowserSettings.setController(BrowserSettings.java:148)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at com.android.browser.Controller.<init>(Controller.java:235)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at com.android.browser.BrowserActivity.createController(BrowserActivity.java:84)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at com.android.browser.BrowserActivity.onCreate(BrowserActivity.java:73)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at android.app.Activity.performCreate(Activity.java:6251)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at android.app.ActivityThread.-wrap11(ActivityThread.java)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at android.os.Handler.dispatchMessage(Handler.java:102)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at android.os.Looper.loop(Looper.java:148)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at android.app.ActivityThread.main(ActivityThread.java:5422)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at java.lang.reflect.Method.invoke(Native Method)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-30 19:59:36.182 2870 2870 E WebViewFactory: Caused by: android.content.pm.PackageManager$NameNotFoundException: com.android.webview
06-30 19:59:36.182 2870 2870 E WebViewFactory: at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:137)
06-30 19:59:36.182 2870 2870 E WebViewFactory: at android.webkit.WebViewFactory.fetchPackageInfo(WebViewFactory.java:114)
06-30 19:59:36.182 2870 2870 E WebViewFactory: … 20 more
06-30 19:59:36.183 2870 2870 D AndroidRuntime: Shutting down VM
06-30 19:59:36.184 2870 2870 E AndroidRuntime: FATAL EXCEPTION: main
06-30 19:59:36.184 2870 2870 E AndroidRuntime: Process: com.android.browser, PID: 2870
06-30 19:59:36.184 2870 2870 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.browser/com.android.browser.BrowserActivity}: android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: android.content.pm.PackageManager$NameNotFoundException: com.android.webview
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5422)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: Caused by: android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: android.content.pm.PackageManager$NameNotFoundException: com.android.webview
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:218)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:165)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.webkit.CookieManager.getInstance(CookieManager.java:39)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at com.android.browser.BrowserSettings.syncSharedSettings(BrowserSettings.java:312)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at com.android.browser.BrowserSettings.setController(BrowserSettings.java:148)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at com.android.browser.Controller.<init>(Controller.java:235)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at com.android.browser.BrowserActivity.createController(BrowserActivity.java:84)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at com.android.browser.BrowserActivity.onCreate(BrowserActivity.java:73)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6251)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: … 9 more
06-30 19:59:36.184 2870 2870 E AndroidRuntime: Caused by: android.webkit.WebViewFactory$MissingWebViewPackageException: android.content.pm.PackageManager$NameNotFoundException: com.android.webview
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.webkit.WebViewFactory.fetchPackageInfo(WebViewFactory.java:116)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:190)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: … 19 more
06-30 19:59:36.184 2870 2870 E AndroidRuntime: Caused by: android.content.pm.PackageManager$NameNotFoundException: com.android.webview
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:137)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: at android.webkit.WebViewFactory.fetchPackageInfo(WebViewFactory.java:114)
06-30 19:59:36.184 2870 2870 E AndroidRuntime: … 20 more
06-30 19:59:36.186 585 600 W ActivityManager: Force finishing activity com.android.browser/.BrowserActivity
[/CODE]

Loading any other browser (via adb or otherwise) causes the same problems. Likewise, if you install Google Apps, you can’t get past the first start screen when it tries to hook to Google’s servers. Obviously that is not going to fly. So, I will do my best and keep plugging away at it in between other builds, but since LS has stopped development, I don’t think this one is going to make the cut of fully functional roms, due to my lack of experience with these sort of issues.

If you happen to know the answer to this problem, feel free to chime in, I could use the help!

For the brave, however, here is the download link, just remember, it is pretty buggy:
http://www.mediafire.com/download/9dxfzfn3wcsu3oj/LS-MM-v6.0-jfltetmo-20160628-lionheart-aklu.zip

Linux – keep it simple.