<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Compdigitec Labs</title>
	<atom:link href="http://www.compdigitec.com/labs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.compdigitec.com/labs</link>
	<description>The place for interesting things</description>
	<lastBuildDate>Sat, 04 May 2013 22:15:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Generating slope fields / direction fields with python and gnuplot</title>
		<link>http://www.compdigitec.com/labs/2013/04/21/generating-slope-fields-direction-fields-with-python-and-gnuplot/</link>
		<comments>http://www.compdigitec.com/labs/2013/04/21/generating-slope-fields-direction-fields-with-python-and-gnuplot/#comments</comments>
		<pubDate>Mon, 22 Apr 2013 01:13:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[gnuplot]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[slope field]]></category>

		<guid isPermaLink="false">http://www.compdigitec.com/labs/?p=349</guid>
		<description><![CDATA[slopefields.py (1.9 KB) Now you can generate your own slope field / vector field / direction field of a differential equation using open source python and gnuplot! Set function to draw field of under dy_dx(). Set window parameters (x/y minimums and maximums, intervals, and length of field arrows). Run with to generate the slope field.]]></description>
				<content:encoded><![CDATA[<div id="attachment_350" class="wp-caption aligncenter" style="width: 490px"><a href="http://www.compdigitec.com/labs/wp-content/uploads/2013/04/slope_field_output.png"><img class=" wp-image-350 " alt="Slope field of (dy/dx) = x/y" src="http://www.compdigitec.com/labs/wp-content/uploads/2013/04/slope_field_output.png" width="480" height="360" /></a><p class="wp-caption-text">Slope field of (dy/dx) = x/y</p></div>
<p><a href="http://www.compdigitec.com/labs/files/slopefields.py">slopefields.py</a> (1.9 KB)</p>
<p>Now you can generate your own slope field / vector field / direction field of a differential equation using open source python and gnuplot!</p>
<ul>
<li>Set function to draw field of under dy_dx().</li>
<li>Set window parameters (x/y minimums and maximums, intervals, and length of field arrows).</li>
<li>Run with
<pre class="brush: bash; title: ; notranslate">python slopefields.py</pre>
<p>to generate the slope field.</li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.compdigitec.com/labs/2013/04/21/generating-slope-fields-direction-fields-with-python-and-gnuplot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Techniques for testing Android fragments</title>
		<link>http://www.compdigitec.com/labs/2013/03/04/techniques-for-testing-android-fragments/</link>
		<comments>http://www.compdigitec.com/labs/2013/03/04/techniques-for-testing-android-fragments/#comments</comments>
		<pubDate>Mon, 04 Mar 2013 11:33:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[fragments]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.compdigitec.com/labs/?p=344</guid>
		<description><![CDATA[How to test a fragment-based Android application: Switching fragments directly from a sub-fragment (inside backstack) - This tests how well your fragment switching code deals with backstacks while switching fragments. Switching from another top level fragment - This tests your fragment switching code. Turning off the screen - This tests your onResume() and onResumeFragments() handlers [...]]]></description>
				<content:encoded><![CDATA[<p>How to test a fragment-based Android application:</p>
<ul>
<li>Switching fragments directly from a sub-fragment (inside backstack) - This tests how well your fragment switching code deals with backstacks while switching fragments.</li>
<li>Switching from another top level fragment - This tests your fragment switching code.</li>
<li>Turning off the screen - This tests your onResume() and onResumeFragments() handlers</li>
<li>Opening another activity from a fragment - Same as above</li>
<li>Opening another activity from the action bar - Same as above</li>
</ul>
<p>Preferably test in the &#8220;don&#8217;t keep activities&#8221; mode, as this will root out a ton of bugs related to the Android lifecycle - i.e. when Android decides to kill an old activity of yours.</p>
<p><strong>Case Study:</strong></p>
<p>User complaint: http://forum.videolan.org/viewtopic.php?f=35&amp;t=108743</p>
<p>The story so far&#8230; old versions of the VLC for Android beta, up to 0.0.10, suffer from a bug, where trying to delete something in another fragment causes the other (non-visible) fragment to receive the onContextItemSelected() call. After setting user visibility hints for that bug, a series of fragment related bugs appeared, mostly involving IllegalStateException in <code>android.support.v4.app.FragmentManager</code> because of duplicate fragments being added.</p>
<p>The problems were caused when Android decided to kill unused background activities. The interface code would try to recreate and re-add() fragments, even though Android had automatically recreated them via &#8220;android.support.fragments&#8221; in the onCreate() bundle. This would manifest after opening another activity, shutting the screen off, or having a system popup appear.</p>
<p>The solution was to keep better track of currently-added fragments, as member variables of the main activity may not necessarily be kept after the activity was hidden. To solve the problem, a check was implemented in onRestoreFragments() to &#8216;recall&#8217; fragments that were already added. This fixed the problem permanently.</p>
<p><strong>The moral of the story:</strong> watch and manage fragments very carefully in order to prevent problems.</p>]]></content:encoded>
			<wfw:commentRss>http://www.compdigitec.com/labs/2013/03/04/techniques-for-testing-android-fragments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiling mingw-w64 with GCC 4.8</title>
		<link>http://www.compdigitec.com/labs/2013/02/07/compiling-mingw-w64-with-gcc-4-8/</link>
		<comments>http://www.compdigitec.com/labs/2013/02/07/compiling-mingw-w64-with-gcc-4-8/#comments</comments>
		<pubDate>Fri, 08 Feb 2013 03:57:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[cross-compile]]></category>
		<category><![CDATA[GCC]]></category>
		<category><![CDATA[mingw]]></category>
		<category><![CDATA[mingw-64]]></category>
		<category><![CDATA[mingw32]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.compdigitec.com/labs/?p=339</guid>
		<description><![CDATA[You need at least mingw-w64 rev 5579, build-essential, and a working compiler. Replace the demo prefix /usr/i686-w64-mingw32 with whatever you feel like, if you want to. Extract the gcc tarball, and pull in mpfr, mpc, and and gmp tarballs under the extracted gcc root. And just for fun, let&#8217;s test it: Bibliography: http://pete.akeo.ie/2010/07/compiling-mingw-w64-with-multilib-on.html http://mingw.5.n7.nabble.com/Rantings-of-a-crazy-dude-on-GCC-NO-EXECUTABLES-td20091.html http://www.mail-archive.com/mingw-w64-public@lists.sourceforge.net/msg02903.html]]></description>
				<content:encoded><![CDATA[<p>You need at least <b>mingw-w64 rev 5579</b>, build-essential, and a working compiler.</p>
<p>Replace the demo prefix /usr/i686-w64-mingw32 with whatever you feel like, if you want to.</p>
<p>Extract the gcc tarball, and pull in mpfr, mpc, and and gmp tarballs under the extracted gcc root.</p>
<pre class="brush: bash; title: ; notranslate">
sudo mkdir /usr/i686-w64-mingw32

../binutils-2.22/configure --disable-multilib --target=i686-w64-mingw32 --with-sysroot=/usr/i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32
make -j4
sudo make install

ln -s /usr/i686-w64-mingw32/i686-w64-mingw32 /usr/i686-w64-mingw32/mingw

../mingw-w64/mingw-w64-headers/configure --build=i686-linux-gnu --host=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32/i686-w64-mingw32 # notice the extra i686-w64-mingw32
make
sudo make install

../gcc-4.8-20130120/configure --target=i686-w64-mingw32 --disable-multilib --enable-languages=c,c++  --with-system-zlib --enable-shared --prefix=/usr/i686-w64-mingw32 --with-sysroot=/usr/i686-w64-mingw32
make all-gcc -j4
sudo make install-gcc

../mingw-w64/configure --host=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32 --with-sysroot=/usr/i686-w64-mingw32
make -j4
sudo su
export PATH=/usr/i686-w64-mingw32/bin:$PATH
make install
exit

cd ../gcc-4.8-20130120-build
make -j4
# /usr/i686-w64-mingw32/i686-w64-mingw32/bin/ld: cannot find dllcrt2.o: No such file or directory
sudo ln -s /usr/i686-w64-mingw32/lib/dllcrt2.o /usr/i686-w64-mingw32/mingw/lib/
make
# checking for ld that supports -Wl,--gc-sections... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
# dig into i686-w64-mingw32/libstdc++-v3/config.log, you find this:
# /usr/i686-w64-mingw32/i686-w64-mingw32/bin/ld: cannot find crt2.o: No such file or directory
# solution:
sudo ln -s /usr/i686-w64-mingw32/lib/crt2.o /usr/i686-w64-mingw32/mingw/lib/
make
sudo make install

../../../mingw-w64/mingw-w64-libraries/winstorecompat/configure --prefix=/usr/i686-w64-mingw32 --host=i686-w64-mingw32
make
sudo su
export PATH=/usr/i686-w64-mingw32/bin:$PATH
make install
exit
</pre>
<p>And just for fun, let&#8217;s test it:</p>
<pre class="brush: bash; title: ; notranslate">
i686-w64-mingw32-gcc --version
# i686-w64-mingw32-gcc (GCC) 4.8.0 20130120 (experimental)
# Copyright (C) 2013 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions.  There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

i686-w64-mingw32-gcc ~/c/hello.c

file a.exe
# a.exe: PE32 executable for MS Windows (console) Intel 80386 32-bit

wine a.exe
# Hello, World!

</pre>
<p><b>Bibliography:</b></p>
<ul>
<li><a href="http://pete.akeo.ie/2010/07/compiling-mingw-w64-with-multilib-on.html">http://pete.akeo.ie/2010/07/compiling-mingw-w64-with-multilib-on.html</a></li>
<li><a href="http://mingw.5.n7.nabble.com/Rantings-of-a-crazy-dude-on-GCC-NO-EXECUTABLES-td20091.html">http://mingw.5.n7.nabble.com/Rantings-of-a-crazy-dude-on-GCC-NO-EXECUTABLES-td20091.html</a></li>
<li><a href="http://www.mail-archive.com/mingw-w64-public@lists.sourceforge.net/msg02903.html">http://www.mail-archive.com/mingw-w64-public@lists.sourceforge.net/msg02903.html</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.compdigitec.com/labs/2013/02/07/compiling-mingw-w64-with-gcc-4-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android DTS benchmark - libavcodec vs libdca</title>
		<link>http://www.compdigitec.com/labs/2013/01/04/android-dts-benchmark-libavcodec-vs-libdca/</link>
		<comments>http://www.compdigitec.com/labs/2013/01/04/android-dts-benchmark-libavcodec-vs-libdca/#comments</comments>
		<pubDate>Fri, 04 Jan 2013 05:17:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[avcodec]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[dts]]></category>
		<category><![CDATA[libav]]></category>
		<category><![CDATA[libdca]]></category>

		<guid isPermaLink="false">http://www.compdigitec.com/labs/?p=334</guid>
		<description><![CDATA[Galaxy Nexus with Android 4.1, ARMv7+NEON, VLC for Android 0.0.9-git (libdca 0.0.5 and libav revision 53c25ee), and OpenSL ES audio output See previous audio benchmark for method Summary/Conclusion: On an ARMv7 processor with NEON, libavcodec is faster by about 7% CPU-wise. libdca libavcodec Mean 18.326% 11.193% Median 17.7% 9.4% Mode 17.5% 9% Raw data:]]></description>
				<content:encoded><![CDATA[<p>Galaxy Nexus with Android 4.1, ARMv7+NEON, VLC for Android 0.0.9-git (libdca 0.0.5 and libav revision 53c25ee), and OpenSL ES audio output</p>
<p>See <a href="http://www.compdigitec.com/labs/2012/02/01/android-codec-benchmarks/">previous audio benchmark</a> for method</p>
<p><strong>Summary/Conclusion</strong>: On an ARMv7 processor with NEON, libavcodec is faster by about 7% CPU-wise.</p>
<table>
<tbody>
<tr>
<td></td>
<th>libdca</th>
<th>libavcodec</th>
</tr>
<tr>
<td>Mean</td>
<td>18.326%</td>
<td><strong>11.193%</strong></td>
</tr>
<tr>
<td>Median</td>
<td>17.7%</td>
<td>9.4%</td>
</tr>
<tr>
<td>Mode</td>
<td>17.5%</td>
<td>9%</td>
</tr>
</tbody>
</table>
<div id="attachment_335" class="wp-caption aligncenter" style="width: 574px"><a href="/labs/wp-content/uploads/2013/01/armv7-dts.png"><img class="size-full wp-image-335" alt="DTS benchmark - libdca vs libavcodec" src="/labs/wp-content/uploads/2013/01/armv7-dts.png" width="564" height="440" /></a><p class="wp-caption-text">DTS benchmark - libdca vs libavcodec</p></div>
<p><b>Raw data:</b></p>
<pre class="brush: plain; title: ; notranslate">
===libdca===
D/VLC     (15980): [0x5c6299b4]: main decoder using decoder module &quot;dts&quot;
  PID  PPID USER     STAT   VSZ %MEM CPU %CPU COMMAND
15980   124 10079    R     527m 75.7   1 26.0 org.videolan.vlc
15980   124 10079    S     531m 76.4   1 21.4 org.videolan.vlc
15980   124 10079    S     531m 76.4   1 17.5 org.videolan.vlc
15980   124 10079    S     531m 76.4   1 17.6 org.videolan.vlc
15980   124 10079    S     531m 76.4   1 17.4 org.videolan.vlc
15980   124 10079    S     531m 76.4   1 18.4 org.videolan.vlc
15980   124 10079    S     531m 76.4   1 17.7 org.videolan.vlc
15980   124 10079    S     531m 76.4   0 17.5 org.videolan.vlc
15980   124 10079    S     531m 76.4   1 17.3 org.videolan.vlc
15980   124 10079    S     531m 76.4   0 17.1 org.videolan.vlc
D/VLC     (16769): [0x5bf9e44c]: main decoder using decoder module &quot;dts&quot;
16769   124 10079    S     524m 75.3   1 20.8 org.videolan.vlc
16769   124 10079    S     531m 76.4   1 25.0 org.videolan.vlc
16769   124 10079    S     531m 76.4   1 17.2 org.videolan.vlc
16769   124 10079    S     531m 76.4   1 17.6 org.videolan.vlc
16769   124 10079    S     531m 76.4   1 18.0 org.videolan.vlc
16769   124 10079    S     531m 76.4   1 17.7 org.videolan.vlc
16769   124 10079    S     531m 76.4   0 18.2 org.videolan.vlc
16769   124 10079    S     531m 76.4   1 17.8 org.videolan.vlc
16769   124 10079    S     531m 76.4   1 17.9 org.videolan.vlc
16769   124 10079    S     531m 76.4   0 17.5 org.videolan.vlc
D/VLC     (16840): [0x5c64fc54]: main decoder using decoder module &quot;dts&quot;
16840   124 10079    S     523m 75.3   0  9.3 org.videolan.vlc
16840   124 10079    S     531m 76.4   1 24.1 org.videolan.vlc
16840   124 10079    S     531m 76.4   0 17.9 org.videolan.vlc
16840   124 10079    S     531m 76.4   0 16.8 org.videolan.vlc
16840   124 10079    S     531m 76.4   1 17.7 org.videolan.vlc
16840   124 10079    S     531m 76.4   0 17.5 org.videolan.vlc
16840   124 10079    S     531m 76.4   1 17.8 org.videolan.vlc
16840   124 10079    S     531m 76.4   0 18.2 org.videolan.vlc
16840   124 10079    S     531m 76.4   1 17.7 org.videolan.vlc
16840   124 10079    S     531m 76.4   0 17.2 org.videolan.vlc

=====libavcodec=====
D/VLC     (17167): [0x5c43802c]: main decoder using decoder module &quot;avcodec&quot;
  PID  PPID USER     STAT   VSZ %MEM CPU %CPU COMMAND
17167   124 10079    S     523m 75.3   0 20.2 org.videolan.vlc
17167   124 10079    S     532m 76.4   0 16.0 org.videolan.vlc
17167   124 10079    S     532m 76.4   0  9.4 org.videolan.vlc
17167   124 10079    S     532m 76.4   1  8.8 org.videolan.vlc
17167   124 10079    S     532m 76.4   0  9.0 org.videolan.vlc
17167   124 10079    S     532m 76.4   1  9.3 org.videolan.vlc
17167   124 10079    S     532m 76.4   0  9.6 org.videolan.vlc
17167   124 10079    S     532m 76.4   1  9.7 org.videolan.vlc
17167   124 10079    S     532m 76.4   1  9.4 org.videolan.vlc
17167   124 10079    S     532m 76.4   0  7.9 org.videolan.vlc
D/VLC     (17276): [0x5c4add84]: main decoder using decoder module &quot;avcodec&quot;
17276   124 10079    S     522m 75.1   0 20.0 org.videolan.vlc
17276   124 10079    S     530m 76.2   1 14.2 org.videolan.vlc
17276   124 10079    S     530m 76.2   0  8.7 org.videolan.vlc
17276   124 10079    S     530m 76.2   0  9.4 org.videolan.vlc
17276   124 10079    S     530m 76.2   0  9.9 org.videolan.vlc
17276   124 10079    S     530m 76.2   0  9.9 org.videolan.vlc
17276   124 10079    S     530m 76.2   1  9.0 org.videolan.vlc
17276   124 10079    S     530m 76.2   0  9.2 org.videolan.vlc
17276   124 10079    S     530m 76.2   0  9.7 org.videolan.vlc
17276   124 10079    S     530m 76.2   1  9.3 org.videolan.vlc
D/VLC     (17340): [0x5c657204]: main decoder using decoder module &quot;avcodec&quot;
17340   124 10079    S     522m 75.1   1 27.6 org.videolan.vlc
17340   124 10079    S     530m 76.3   0 14.5 org.videolan.vlc
17340   124 10079    S     530m 76.2   0  9.5 org.videolan.vlc
17340   124 10079    S     530m 76.2   0  9.4 org.videolan.vlc
17340   124 10079    S     530m 76.2   0  9.0 org.videolan.vlc
17340   124 10079    S     530m 76.2   1  9.4 org.videolan.vlc
17340   124 10079    S     530m 76.2   0  9.0 org.videolan.vlc
17340   124 10079    S     530m 76.2   0 10.0 org.videolan.vlc
17340   124 10079    S     530m 76.2   0  9.0 org.videolan.vlc
17340   124 10079    S     530m 76.2   0  9.8 org.videolan.vlc
</pre>]]></content:encoded>
			<wfw:commentRss>http://www.compdigitec.com/labs/2013/01/04/android-dts-benchmark-libavcodec-vs-libdca/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compose key not working with iBus</title>
		<link>http://www.compdigitec.com/labs/2012/12/08/compose-key-not-working-with-ibus/</link>
		<comments>http://www.compdigitec.com/labs/2012/12/08/compose-key-not-working-with-ibus/#comments</comments>
		<pubDate>Sat, 08 Dec 2012 16:44:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.compdigitec.com/labs/?p=330</guid>
		<description><![CDATA[The iBus input method does not work with the compose key - see Debian bug #591459 and Ubuntu bug #493766. It seems that iBus is intercepting all keystrokes and substituting its own instead, even though xev shows the Multi_key and accent being produced. For example, Multi_Key + &#8216; + e leads to &#8216;e instead of [...]]]></description>
				<content:encoded><![CDATA[<p>The iBus input method does not work with the compose key - see <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591459">Debian bug #591459</a> and <a href="https://bugs.launchpad.net/ubuntu/+source/emacs23/+bug/493766">Ubuntu bug #493766</a>. It seems that iBus is intercepting all keystrokes and substituting its own instead, even though xev shows the Multi_key and accent being produced. For example, Multi_Key + &#8216; + e leads to &#8216;e instead of é.</p>
<p>A temporary solution is to <strong>export XMODIFIERS=&#8221;"</strong> to bypass iBus, freeing the keystrokes for compose. However, this disables the iBus input method as it prevents iBus from receiving the keystrokes. XMODIFIERS, however, can be set per application, so one can simply set XMODIFIERS=&#8221;" for the specific application that requires the compose key.</p>]]></content:encoded>
			<wfw:commentRss>http://www.compdigitec.com/labs/2012/12/08/compose-key-not-working-with-ibus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exploring and rooting the iPPea TV</title>
		<link>http://www.compdigitec.com/labs/2012/11/24/rooting-the-ippea/</link>
		<comments>http://www.compdigitec.com/labs/2012/11/24/rooting-the-ippea/#comments</comments>
		<pubDate>Sun, 25 Nov 2012 03:19:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://www.compdigitec.com/labs/?p=319</guid>
		<description><![CDATA[Skip to the rooting process, if you wish. The iPPea TV is a pretty neat gadget, to say the least. The USB-stick sized device features a full Android 4.0.3 OS, a 1Ghz Ingenic JZ4770 MIPS processor (complete with FPU!), 512 MB of RAM, 2 GB flash storage, and about 800 MB of internal memory. Overall, [...]]]></description>
				<content:encoded><![CDATA[<p><a href="#aanchor">Skip to the rooting process</a>, if you wish.</p>
<p>The <a href="http://www.ippea.com/">iPPea TV</a> is a pretty neat gadget, to say the least. The USB-stick sized device features a full Android 4.0.3 OS, a 1Ghz Ingenic JZ4770 MIPS processor (complete with FPU!), 512 MB of RAM, 2 GB flash storage, and about 800 MB of internal memory. Overall, it is pretty impressive for only $65. Having received it about three weeks ago for use in the development of the MIPS port of VLC Android, I&#8217;ve been meaning to write about this device. Now that I&#8217;ve received this device and have time to write, let&#8217;s take a look at what&#8217;s in it.</p>
<div id="attachment_322" class="wp-caption aligncenter" style="width: 592px"><a href="/labs/wp-content/uploads/2012/11/unboxing.jpg"><img class=" wp-image-322 " title="Unboxing the iPPea" alt="Unboxing the iPPea" src="http://www.compdigitec.com/labs/wp-content/uploads/2012/11/unboxing.jpg" width="582" height="389" /></a><p class="wp-caption-text">Unboxing the iPPea</p></div>
<p>The iPPea comes in its own packaging, in addition to the 3D gyroscopic remote offered by Option B.</p>
<div id="attachment_321" class="wp-caption aligncenter" style="width: 688px"><a href="http://www.compdigitec.com.nyud.net/labs/wp-content/uploads/2012/11/packaging.jpg"><img class=" wp-image-321 " title="The iPPea's packaging" alt="The iPPea's packaging" src="http://www.compdigitec.com.nyud.net/labs/wp-content/uploads/2012/11/packaging.jpg" width="678" height="485" /></a><p class="wp-caption-text">The iPPea&#8217;s packaging</p></div>
<p>The iPPea comes with some packaging.</p>
<div id="attachment_320" class="wp-caption aligncenter" style="width: 351px"><a href="http://www.compdigitec.com.nyud.net/labs/wp-content/uploads/2012/11/ippea.jpg"><img class=" wp-image-320 " title="The iPPea after unpacking" alt="The iPPea after unpacking" src="http://www.compdigitec.com.nyud.net/labs/wp-content/uploads/2012/11/ippea.jpg" width="341" height="254" /></a><p class="wp-caption-text">The iPPea after unpacking</p></div>
<p>So, after unpacking, we are ready to play with the iPPea. The iPPea simply &#8220;plugs in&#8221; to any HDMI-enabled TV, just like how a USB stick plugs into a computer. It doesn&#8217;t take too long to boot up, about 15-25 seconds-ish (I did not time this).</p>
<div id="attachment_323" class="wp-caption aligncenter" style="width: 413px"><a href="http://www.compdigitec.com.nyud.net/labs/wp-content/uploads/2012/11/ippea-bootup.jpg"><img class=" wp-image-323 " title="The iPPea's home screen after booting up" alt="The iPPea's home screen after booting up" src="http://www.compdigitec.com.nyud.net/labs/wp-content/uploads/2012/11/ippea-bootup.jpg" width="403" height="284" /></a><p class="wp-caption-text">The iPPea&#8217;s home screen after booting up</p></div>
<div id="attachment_324" class="wp-caption aligncenter" style="width: 276px"><a href="/labs/wp-content/uploads/2012/11/ippea-cpuinfo.jpg"><img class=" wp-image-324  " title="Output of /proc/cpuinfo on the iPPea" alt="Output of /proc/cpuinfo on the iPPea" src="/labs/wp-content/uploads/2012/11/ippea-cpuinfo.jpg" width="266" height="396" /></a><p class="wp-caption-text">Output of /proc/cpuinfo on the iPPea</p></div>
<p>Just a curious note here, the iPPea claims to support full 1080p, but my television reports it to be 720p. I did not notice any lack of quality though, the picture was still very clear and not pixellated.</p>
<p>The iPPea boots into a full Android 4.0.3 installation, as mentioned before, with the twist that it runs a MIPS processor. It also features full wifi, which we will use in some diagnostics. Here are the /proc/cpuinfo and <a href="http://code.google.com/p/sysinfo-for-android/">Android Sysinfo</a> dumps for the iPPea TV:</p>
<pre class="brush: plain; title: ; notranslate">
system type		: JZ4770
processor		: MIPS-compatible processor JZ4770
cpu model		: Ingenic XBurst
BogoMIPS		: 1001.88
wait instruction	: yes
microsecond timers	: no
tlb_entries		: 32
extra interrupt vector	: yes
hardware watchpoint	: yes, count: 1, address/irw mask: [0x0fff]
ASEs implemented	: mxu
shadow register sets	: 1
core			: 0
VCED exceptions		: not available
VCEI exceptions		: not available
Features		: fpu mxu
CPU implementer		: Ingenic
CPU architecture	: MIPS

Hardware		: linden
Revision		: 0005
Serial			: 0000000000000000

EFUSE0			: d075370b
EFUSE1			: 02c00811
EFUSE2			: fc460000
EFUSE3			: 8a54c84f
EFUSE4			: 00000000
EFUSE5			: 00000000
EFUSE6			: 00000000
EFUSE7			: 00000000
</pre>
<p>&#8230;and <a href="/labs/wp-content/uploads/2012/11/sysinfo-1353803016317.txt">the Sysinfo dump</a>:</p>
<pre class="brush: plain; title: ; notranslate">
ID=IML74K
Product=linden
Device=linden
Board=unknown
CPU ABI=mips
CPU ABI 2=mips-r2
Manufacturer=ingenic
Brand=Ingenic
Model=iPPea
Type=eng
Tags=test-keys
Finger Print=Ingenic/linden/linden:4.0.3/IML74K/eng.spark.20120901.003556:eng/test-keys
Time=1346431472000
User=spark
Host=spark
Hardware=linden
Radio=unknown
Bootloader=unknown
Incremental Version=eng.spark.20120901.003556
Release Version=4.0.3
SDK Version=15
</pre>
<h2 id="aanchor">Rooting the iPPea TV</h2>
<p>Curiously, the iPPea comes with busybox built-in into the image. This will make working with the iPPea easier, as we don&#8217;t have to compile/download busybox and deploy it - full access to all the busybox tools is available by default.</p>
<p>But what makes rooting really easy is the fact that the makers of the iPPea handed the blessing of leaving ro.secure off. This means that a simple adb connection is enough to grant root access - all that we have to do is install a su binary.</p>
<p>Unfortunately, the busybox su requires too much baggage of the traditional Linux system - notably /etc/passwd, /etc/groups and friends to work. Since this is a MIPS system and Superuser.apk is contains an ARM binary, that approach cannot work either. In addition, compiling su-binary from Superuser.apk requires the entire AOSP tree, which is too much work and network bandwidth for us. So, we will use <a href="http://www.compdigitec.com/labs/2012/11/23/a-simple-su-implementation-in-c/">a portable C implementation</a> of su instead.</p>
<p>This step does require you to plug in the iPPea into a computer with ADB, so be prepared to do so. You will also need this <a href="/labs/files/mips-su.zip">prebuilt portable MIPS Android su binary</a>. Skip over these steps if you are using the prebuilt binary (these are instructions to compile it yourself with the Android NDK):</p>
<pre class="brush: bash; title: ; notranslate">
export ANDROID_NDK=/opt/android-ndk-r8c # set as you need
$ANDROID_NDK/toolchains/mipsel-linux-android-4.6/prebuilt/linux-x86/bin/mipsel-linux-android-gcc --sysroot=$ANDROID_NDK/platforms/android-9/arch-mips -g su.c -o su
</pre>
<p>Now that you have the &#8216;su&#8217; binary handy as well as your iPPea detected in adb (adb devices, you may need to chown it to make it visible), here we go:</p>
<pre class="brush: bash; title: ; notranslate">
adb push su /dev/
adb shell
# now we are on the iPPea
busybox mount -o remount,rw /system
busybox mv /dev/su /system/bin/su
busybox chmod 4755 /system/bin/su
busybox mount -o remount,ro /system
exit
# now we are back to our computer
adb reboot # to reboot
</pre>
<p>At this point we can put the iPPea back on the TV. If we open <a href="https://github.com/jackpal/Android-Terminal-Emulator">Term.apk</a> and put in &#8220;su&#8221; and press Enter, we should have root:</p>
<div id="attachment_327" class="wp-caption aligncenter" style="width: 490px"><a href="http://www.compdigitec.com/labs/wp-content/uploads/2012/11/ippea-root.jpg"><img class="wp-image-327 " title="Victory! Root access on the iPPea" alt="Victory! Root access on the iPPea" src="http://www.compdigitec.com/labs/wp-content/uploads/2012/11/ippea-root.jpg" width="480" height="207" /></a><p class="wp-caption-text">Victory! Root access on the iPPea</p></div>
<p>And of course, once we have root access, the opportunities increase without bound - chrooted Debian/Linux, Android apps that require root, reformat and reflash with a custom ROM - the sky becomes the limit. We do, however, owe many thanks (and this is not meant to be sarcastic) to iPPea for leaving ro.secure at 0, allowing hobbyists to make better use of the hardware (which in itself is very neat).</p>]]></content:encoded>
			<wfw:commentRss>http://www.compdigitec.com/labs/2012/11/24/rooting-the-ippea/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>A simple su implementation in C</title>
		<link>http://www.compdigitec.com/labs/2012/11/23/a-simple-su-implementation-in-c/</link>
		<comments>http://www.compdigitec.com/labs/2012/11/23/a-simple-su-implementation-in-c/#comments</comments>
		<pubDate>Sat, 24 Nov 2012 01:41:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.compdigitec.com/labs/?p=326</guid>
		<description><![CDATA[Sometimes, you might need to keep things simple. Here is a very simple su implementation written in portable C that can be used on almost any architecture - e.g. Embedded Linux, Android, Windows, etc as long as it supports C. It is licensed under the 3-clause BSD licence so any use is OK as long [...]]]></description>
				<content:encoded><![CDATA[<p>Sometimes, you might need to keep things simple. Here is a very simple su implementation written in portable C that can be used on almost any architecture - e.g. Embedded Linux, Android, Windows, etc as long as it supports C. It is licensed under the 3-clause BSD licence so any use is OK as long as credit is given:</p>
<pre class="brush: cpp; title: ; notranslate">
/*
 * Simple su binary
 * Copyright (C) 2012 Compdigitec
 * http://www.compdigitec.com/labs/2012/11/23/a-simple-su-implementation-in-c/
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 * * Redistributions of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above
 *   copyright notice, this list of conditions and the following disclaimer
 *   in the documentation and/or other materials provided with the
 *   distribution.
 * * Neither the name of Compdigitec nor the names of its
 *   contributors may be used to endorse or promote products derived from
 *   this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

#include &lt;unistd.h&gt;
#include &lt;getopt.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;pwd.h&gt;

#define SHELL &quot;/system/bin/sh&quot;

#define about() do { \
    printf(&quot;Simple crude su binary\n&quot;); \
    printf(&quot;See http://www.compdigitec.com/labs/2012/11/23/a-simple-su-implementation-in-c/\n&quot;); \
    printf(&quot;su [-c &lt;command&gt;] [-h] [-v] [user id to su to, must be integer]\n&quot;); \
    } while(0)

int main(int argc, char* argv[]) {
    char* command = NULL;
    int user = 0; // root
    int group = 0;

    struct option long_opts[] = {
        { &quot;command&quot;,	required_argument,		NULL, 'c' },
        { &quot;help&quot;, 		no_argument,			NULL, 'h' },
        { &quot;shell&quot;,		required_argument,		NULL, 's' },
        { &quot;version&quot;,	no_argument,			NULL, 'v' },
        { NULL, 0, NULL, 0 },
    };

    int c;
    while((c = getopt_long(argc, argv, &quot;+c:hsv&quot;, long_opts, NULL)) != -1) {
        switch(c) {
            case 'c':
                command = strdup(optarg);
                break;
            case 'h':
                about();
                exit(EXIT_SUCCESS);
                break;
            case 'v':
                about();
                exit(EXIT_SUCCESS);
            default:
                fprintf(stderr, &quot;\n&quot;);
                about();
                exit(EXIT_SUCCESS);
        }
    }

    if(command == NULL)
        command = strdup(SHELL);

    if(optind &lt; argc) {
        user = atoi( argv[optind++] );
    }

    // Let's get the group ID as well.
    struct passwd* tempPwdPtr;
#if 0
    struct passwd theentry;
    char* buf = malloc(sysconf(_SC_GETGR_R_SIZE_MAX));
    if(getpwuid_r(user, &amp;theentry, buf, sysconf(_SC_GETGR_R_SIZE_MAX), &amp;tempPwdPtr) == 0) {
        group = theentry.pw_gid;
        free(buf);
    }
#else
    if((tempPwdPtr = getpwuid(user)) != NULL) {
        group = tempPwdPtr-&gt;pw_gid;
    }
#endif

    //printf(&quot;Command: %s, User to run as: %i, GID = %i\n&quot;,command,user,group);
    setgid(group);
    setuid(user);
    system(command);

    free(command);
    return 0;
}
</pre>]]></content:encoded>
			<wfw:commentRss>http://www.compdigitec.com/labs/2012/11/23/a-simple-su-implementation-in-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Modifying Android settings from the filesystem / terminal</title>
		<link>http://www.compdigitec.com/labs/2012/11/05/modifying-android-settings-from-the-disk-terminal/</link>
		<comments>http://www.compdigitec.com/labs/2012/11/05/modifying-android-settings-from-the-disk-terminal/#comments</comments>
		<pubDate>Tue, 06 Nov 2012 01:51:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[settings]]></category>
		<category><![CDATA[sqlite]]></category>

		<guid isPermaLink="false">http://www.compdigitec.com/labs/?p=315</guid>
		<description><![CDATA[(Root access is required for this entire procedure; but root access is usually present on development builds anyway.) Normally, the built-in Settings app can be used on Android to change system settings. But if you&#8217;re on a development build where the settings app is broken and can&#8217;t be used, the Android settings database can be [...]]]></description>
				<content:encoded><![CDATA[<p>(<span style="text-decoration: underline;">Root access is required</span> for this entire procedure; but root access is usually present on development builds anyway.) Normally, the built-in Settings app can be used on Android to change system settings. But if you&#8217;re on a development build where the settings app is broken and can&#8217;t be used, the Android settings database can be found at:</p>
<pre class="brush: plain; title: ; notranslate">/data/data/com.android.providers.settings/databases/settings.db</pre>
<p>Probably, you will need to <em>cp</em> the file to a place that any user can read from (e.g. /sdcard). Then, git pull the file and open it in SQLite Manager or something similar, and you can edit it. The most interesting table will probably be the &#8220;secure&#8221; table, where you can change the system settings.</p>
<p><a href="http://www.compdigitec.com/labs/wp-content/uploads/2012/11/android_settings.png"><img class="aligncenter size-full wp-image-316" title="Android settings.db database" src="http://www.compdigitec.com/labs/wp-content/uploads/2012/11/android_settings.png" alt="" width="742" height="335" /></a></p>
<p>Just use adb push to push the file back on the device, and use mv to move it to /data/data/com.android.providers.settings/databases/.</p>]]></content:encoded>
			<wfw:commentRss>http://www.compdigitec.com/labs/2012/11/05/modifying-android-settings-from-the-disk-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solving &#8220;libtool: Version mismatch error&#8221;</title>
		<link>http://www.compdigitec.com/labs/2012/10/18/solving-libtool-version-mismatch-error/</link>
		<comments>http://www.compdigitec.com/labs/2012/10/18/solving-libtool-version-mismatch-error/#comments</comments>
		<pubDate>Thu, 18 Oct 2012 22:42:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.compdigitec.com/labs/?p=312</guid>
		<description><![CDATA[After ./configure and make, you get this interesting scenario: The solution?]]></description>
				<content:encoded><![CDATA[<p>After ./configure and make, you get this interesting scenario:</p>
<pre class="brush: plain; title: ; notranslate">libtool: Version mismatch error.  This is libtool 2.4.2 Debian-2.4.2-1ubuntu1, but the
libtool: definition of this LT_INIT comes from libtool 2.4.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.2 Debian-2.4.2-1ubuntu1
libtool: and run autoconf again.
make[5]: *** 1 Error 63</pre>
<p>The solution?</p>
<pre class="brush: bash; title: ; notranslate">autoreconf -ivf</pre>]]></content:encoded>
			<wfw:commentRss>http://www.compdigitec.com/labs/2012/10/18/solving-libtool-version-mismatch-error/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quilt responding with &#8220;File series fully applied&#8221; and not working</title>
		<link>http://www.compdigitec.com/labs/2012/10/15/quilt-responding-with-file-series-fully-applied-and-not-working/</link>
		<comments>http://www.compdigitec.com/labs/2012/10/15/quilt-responding-with-file-series-fully-applied-and-not-working/#comments</comments>
		<pubDate>Tue, 16 Oct 2012 03:07:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.compdigitec.com/labs/?p=310</guid>
		<description><![CDATA[The story so far&#8230; File series fully applied (no output) # On branch master nothing to commit (working directory clean) What&#8217;s happening here? Well, it turns out that we need to reset and clean the .pc directory of quilt: Now, let&#8217;s try applying the patches: Applying patch patch-number-one.patch patching file configure.ac Applying patch fix-build.patch patching [...]]]></description>
				<content:encoded><![CDATA[<p><strong>The story so far&#8230;</strong></p>
<pre class="brush: bash; title: ; notranslate">quilt push -a</pre>
<p>File series fully applied</p>
<pre class="brush: bash; title: ; notranslate">git diff</pre>
<p>(no output)</p>
<pre class="brush: bash; title: ; notranslate">git status</pre>
<p># On branch master<br />
nothing to commit (working directory clean)</p>
<p>What&#8217;s happening here? Well, it turns out that we need to reset and clean the .pc directory of quilt:</p>
<pre class="brush: bash; title: ; notranslate">git reset --hard HEAD
git clean -f -d
rm -rf .pc</pre>
<p>Now, let&#8217;s try applying the patches:</p>
<pre class="brush: bash; title: ; notranslate">quilt push -a</pre>
<p>Applying patch patch-number-one.patch<br />
patching file configure.ac</p>
<p>Applying patch fix-build.patch<br />
patching file src/diff.hpp</p>
<p>Now at patch fix-build.patch</p>
<p>Much better, no? And now it brings us to a point where we can now do <strong>dpkg-buildpackage -us -uc -b</strong>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.compdigitec.com/labs/2012/10/15/quilt-responding-with-file-series-fully-applied-and-not-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
