<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<feed xmlns="http://www.w3.org/2005/Atom">

	<title>0xlab</title>
	<link rel="self" href="atom.xml"/>
	<link href="default"/>
	<id>atom.xml</id>
	<updated>2012-02-06T05:00:11+00:00</updated>
	<generator uri="http://www.planetplanet.org/">http://intertwingly.net/code/venus/</generator>

	<entry>
		<title type="html">Development Progress Summary about 0xlab</title>
		<link href="http://jserv.blogspot.com/2012/01/development-progress-summary-about.html"/>
		<id>tag:blogger.com,1999:blog-1795333590425870072.post-7073243080334557768</id>
		<updated>2012-01-04T17:33:36+00:00</updated>
		<content type="html">Last two months, I was so honored and delighted to be invited as the speaker at &lt;a href=&quot;https://events.linuxfoundation.org/events/embedded-linux-conference-europe&quot;&gt;Embedded Linux Conference Europe&lt;/a&gt; and &lt;a href=&quot;http://droidcon.nl/&quot;&gt;droidcon.NL&lt;/a&gt;.  I shared the progress about our development and various improvements for Anroid Open Source Project.  As the developer at &lt;a href=&quot;http://www.linaro.org/&quot;&gt;Linaro&lt;/a&gt;, &lt;a href=&quot;http://0xlab.org/&quot;&gt;0xlab&lt;/a&gt; already contributes some fundamental works, and these eventually become the base for further collaborations.  The topic of the presentation is &quot;Develop Community-based Android Distribution and Upstreaming experience&quot;, and you can check out the presentation material as following:&lt;center&gt;&lt;div style=&quot;width: 425px;&quot; id=&quot;__ss_10773288&quot;&gt; &lt;strong style=&quot;display: block; margin: 12px 0 4px;&quot;&gt;&lt;a href=&quot;http://www.slideshare.net/jserv/dev-androiddistribution&quot; target=&quot;_blank&quot; title=&quot;Develop Community-based Android Distribution and Upstreaming Experience &quot;&gt;Develop Community-based Android Distribution and Upstreaming Experience &lt;/a&gt;&lt;/strong&gt; &amp;lt;iframe frameborder=&quot;0&quot; height=&quot;355&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://www.slideshare.net/slideshow/embed_code/10773288&quot; width=&quot;425&quot;&amp;gt;&amp;lt;/iframe&amp;gt; &lt;div style=&quot;padding: 5px 0 12px;&quot;&gt; View &lt;a href=&quot;http://www.slideshare.net/tag/0xlab&quot;&gt;more presentations&lt;/a&gt; by &lt;a href=&quot;http://0xlab.org/&quot;&gt;0xlab&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/center&gt;&lt;div&gt;Recently, we are quietly improving the performance of Android ICS (4.0.x) and submitting patches to &lt;a href=&quot;http://www.cyanogenmod.com/&quot;&gt;CyanogenMod&lt;/a&gt; as community collaboration.  Most of them are merged in &lt;a href=&quot;http://www.cyanogenmod.com/&quot;&gt;CyanogenMod&lt;/a&gt;, and we are moving forward in more areas to enhance Android software stack.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Look forward to your feedback and the opportunities to work with each other.&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/tracker/1795333590425870072-7073243080334557768?l=jserv.blogspot.com&quot; alt=&quot;&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>jserv</name>
			<email>noreply@blogger.com</email>
			<uri>http://jserv.blogspot.com/</uri>
		</author>
		<source>
			<title type="html">Hacking at 0xlab</title>
			<subtitle type="html">Something hacked by jserv at 0xlab.</subtitle>
			<link rel="self" href="http://www.blogger.com/feeds/1795333590425870072/posts/default"/>
			<id>tag:blogger.com,1999:blog-1795333590425870072</id>
		</source>
	</entry>

	<entry>
		<title type="html">BT LE FindMe profile in Bluez</title>
		<link href="http://i-miss-erin.blogspot.com/2011/09/bt-le-findme-profile-in-bluez.html"/>
		<id>tag:blogger.com,1999:blog-6730068706524524033.post-595233347944784913</id>
		<updated>2011-09-02T14:51:16+00:00</updated>
		<content type="html">There is a &lt;a href=&quot;http://www.spinics.net/lists/linux-bluetooth/msg14969.html&quot;&gt;post&lt;/a&gt; in Bluez mailing list &quot;Current status on BLE development&quot;. It tells us current BT LE status in Bluez and also shows some git repositories with their development. I try to build their kernel and the latest bluez. I made some experiments and understood more about FindMe profile in Bluez.
&lt;br /&gt;
&lt;br /&gt;* Unstable kernel with Interleaved Discovery, RSSI Threshold monitor,
&lt;br /&gt;LE scanning and remaining SM patches
&lt;br /&gt;[1] http://git.infradead.org/users/vcgomes/linux-2.6.git (branch
&lt;br /&gt;proximity-integration)
&lt;br /&gt;
&lt;br /&gt;* BlueZ Userspace
&lt;br /&gt;[2] git://git.infradead.org/users/cktakahasi/bluez.git proximity-devel
&lt;br /&gt;
&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Experiment I:&lt;/span&gt; prepare one LE device only(Key Fob/Reporter/GATT Server) and one dual mode LE/BR/EDR device (Monitor/GATT Client) in Ubuntu machine. Key Fob runs immediate alert service. Bluez register the monitor service and it can write Alert Level to reporter. If Alert Level is mild or high, the Key Fob would ring. Then user can find where is the Key Fob. Reference to &lt;a href=&quot;https://developer.bluetooth.org/gatt/services/Pages/ServiceViewerOrig.aspx?u=org.bluetooth.service.immediate_alert.xml&quot;&gt;Immediate Alert Service&lt;/a&gt; (UUID: 0x1802) page and &lt;a href=&quot;https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.alert_level.xml&quot;&gt;Alert Level&lt;/a&gt;(UUID:0x2a06) page.
&lt;br /&gt;
&lt;br /&gt;Reference from Bluetooth.org site:
&lt;br /&gt;The Immediate Alert service is instantiated as a Primary Service. There is only one instance of the Immediate Alert service on a device. There is only one instance of the Alert Level characteristic in an Immediate Alert service. This alert continues until one of following conditions occurs: 
&lt;br /&gt;•	An implementation specific timeout 
&lt;br /&gt;•	User interaction on this device 
&lt;br /&gt;•	A new alert level is written 
&lt;br /&gt;•	The physical link is disconnected
&lt;br /&gt;
&lt;br /&gt;Examples:
&lt;br /&gt;If the written alert level is “No Alert”, no alerting is done on this device.
&lt;br /&gt;If the written alert level is “Mild Alert”, the device alerts.
&lt;br /&gt;If the written alert level is “High Alert”, the device alerts in the strongest possible way.
&lt;br /&gt;
&lt;br /&gt;How to demo it:
&lt;br /&gt;1. set Key Fob to advertising mode
&lt;br /&gt;2. try LE scan from Ubuntu
&lt;br /&gt;&lt;div class=&quot;highlight&quot;&gt;
&lt;br /&gt;erin@sundays:/project/upstream/bluez$ sudo hcitool -i hci0 lescan
&lt;br /&gt;LE Scan ...
&lt;br /&gt;C0:FF:EE:C0:AA:06
&lt;br /&gt;C0:FF:EE:C0:AA:06
&lt;br /&gt;C0:FF:EE:C0:AA:06
&lt;br /&gt;C0:FF:EE:C0:AA:06
&lt;br /&gt;C0:FF:EE:C0:AA:06
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;3. create LE connection
&lt;br /&gt;&lt;div class=&quot;highlight&quot;&gt;
&lt;br /&gt;erin@sundays:/project/upstream/bluez$ sudo hcitool -i hci0 lecc C0:FF:EE:C0:AA:06
&lt;br /&gt;Connection handle 32
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;4. use gatttool to browse the service of LE device 
&lt;br /&gt;&lt;div class=&quot;highlight&quot;&gt;
&lt;br /&gt;erin@sundays:/project/upstream/bluez$ sudo gatttool -i hci0 -b C0:FF:EE:C0:AA:06 -m 48 --interactive
&lt;br /&gt;[   ][C0:FF:EE:C0:AA:06][LE]&amp;gt; connect
&lt;br /&gt;[CON][C0:FF:EE:C0:AA:06][LE]&amp;gt; primary
&lt;br /&gt;[CON][C0:FF:EE:C0:AA:06][LE]&amp;gt; 
&lt;br /&gt;attr handle: 0x0001, end grp handle: 0x000b uuid: 00001800-0000-1000-8000-00805f9b34fb
&lt;br /&gt;attr handle: 0x000c, end grp handle: 0x000e uuid: 00001801-0000-1000-8000-00805f9b34fb
&lt;br /&gt;attr handle: 0x000f, end grp handle: 0x0011 uuid: 00001803-0000-1000-8000-00805f9b34fb
&lt;br /&gt;attr handle: 0x0012, end grp handle: 0x0014 uuid: 00001802-0000-1000-8000-00805f9b34fb
&lt;br /&gt;attr handle: 0x0015, end grp handle: 0x0017 uuid: 00001804-0000-1000-8000-00805f9b34fb
&lt;br /&gt;attr handle: 0x0018, end grp handle: 0x001e uuid: 0000ffb0-0000-1000-8000-00805f9b34fb
&lt;br /&gt;attr handle: 0x001f, end grp handle: 0x0031 uuid: 0000ffa0-0000-1000-8000-00805f9b34fb
&lt;br /&gt;attr handle: 0x0032, end grp handle: 0x0036 uuid: 0000ffe0-0000-1000-8000-00805f9b34fb
&lt;br /&gt;[CON][C0:FF:EE:C0:AA:06][LE]&amp;gt; characteristics 0x0012 0x0014
&lt;br /&gt;[CON][C0:FF:EE:C0:AA:06][LE]&amp;gt; 
&lt;br /&gt;handle: 0x0013, char properties: 0x08, char value handle: 0x0014, uuid: 00002a06-0000-1000-8000-00805f9b34fb
&lt;br /&gt;[CON][C0:FF:EE:C0:AA:06][LE]&amp;gt; char-desc 0x0012 0x00014
&lt;br /&gt;[CON][C0:FF:EE:C0:AA:06][LE]&amp;gt; 
&lt;br /&gt;handle: 0x0012, uuid: 2800
&lt;br /&gt;handle: 0x0013, uuid: 2803
&lt;br /&gt;handle: 0x0014, uuid: 2a06
&lt;br /&gt;[CON][C0:FF:EE:C0:AA:06][LE]&amp;gt; char-read-uuid 2a06
&lt;br /&gt;[CON][C0:FF:EE:C0:AA:06][LE]&amp;gt; 
&lt;br /&gt;handle: 0x0011 	 value: 00 
&lt;br /&gt;[CON][C0:FF:EE:C0:AA:06][LE]&amp;gt; char-write-cmd 0x0011 02
&lt;br /&gt;[CON][C0:FF:EE:C0:AA:06][LE]&amp;gt; char-read-uuid 2a06
&lt;br /&gt;[CON][C0:FF:EE:C0:AA:06][LE]&amp;gt; 
&lt;br /&gt;handle: 0x0011 	 value: 02 
&lt;br /&gt;[CON][C0:FF:EE:C0:AA:06][LE]&amp;gt; disconnect
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;5. Key Fob would start to ring
&lt;br /&gt;
&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Experiment II:&lt;/span&gt; prepare two BT BR/EDR devices. One is my Ubuntu laptop (daydreamer) and the other is my Ubuntu Desktop (Sundays). Daydreamer is a Key Fob (Client) and Sundays is a Monitor (Server).
&lt;br /&gt;
&lt;br /&gt;1. Fake Immediate Alert profile and Link Loss profile in local data files. 
&lt;br /&gt;&lt;div class=&quot;highlight&quot;&gt;
&lt;br /&gt;erin@sundays:/project/vcgomes/linux-2.6$ cat /var/lib/bluetooth/00\:13\:EF\:F0\:C4\:46/profiles 
&lt;br /&gt;78:DD:08:A3:A7:52 0000110a-0000-1000-8000-00805f9b34fb 0000110c-0000-1000-8000-00805f9b34fb 0000110e-0000-1000-8000-00805f9b34fb 00001112-0000-1000-8000-00805f9b34fb 0000111f-0000-1000-8000-00805f9b34fb 00001800-0000-1000-8000-00805f9b34fb 00001801-0000-1000-8000-00805f9b34fb 00001802-0000-1000-8000-00805f9b34fb 00001803-0000-1000-8000-00805f9b34fb
&lt;br /&gt;erin@sundays:/project/vcgomes/linux-2.6$ cat /var/lib/bluetooth/00\:13\:EF\:F0\:C4\:46/primary 
&lt;br /&gt;78:DD:08:A3:A7:52 0011#0013#00001802-0000-1000-8000-00805f9b34fb 0009#000b#00001803-0000-1000-8000-00805f9b34fb
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;2. use dbus-send to change Alert Service value
&lt;br /&gt;&lt;div class=&quot;highlight&quot;&gt;
&lt;br /&gt;erin@sundays:~$ dbus-send --system --type=method_call --print-reply --dest=org.bluez /org/bluez/2617/hci1/dev_78_DD_08_A3_A7_52 org.bluez.Proximity.GetProperties
&lt;br /&gt;method return sender=:1.62 -&amp;gt; dest=:1.91 reply_serial=2
&lt;br /&gt;   array [
&lt;br /&gt;      dict entry(
&lt;br /&gt;         string &quot;LinkLossAlertLevel&quot;
&lt;br /&gt;         variant             string &quot;none&quot;
&lt;br /&gt;      )
&lt;br /&gt;      dict entry(
&lt;br /&gt;         string &quot;ImmediateAlertLevel&quot;
&lt;br /&gt;         variant             string &quot;none&quot;
&lt;br /&gt;      )
&lt;br /&gt;   ]
&lt;br /&gt;
&lt;br /&gt;erin@sundays:~$ dbus-send --system --type=method_call --print-reply --dest=org.bluez /org/bluez/2617/hci1/dev_78_DD_08_A3_A7_52 org.bluez.Proximity.SetProperty string:ImmediateAlertLevel variant:string:high
&lt;br /&gt;method return sender=:1.62 -&amp;gt; dest=:1.92 reply_serial=2
&lt;br /&gt;
&lt;br /&gt;erin@sundays:~$ dbus-send --system --type=method_call --print-reply --dest=org.bluez /org/bluez/2617/hci1/dev_78_DD_08_A3_A7_52 org.bluez.Proximity.GetProperties
&lt;br /&gt;method return sender=:1.62 -&amp;gt; dest=:1.93 reply_serial=2
&lt;br /&gt;   array [
&lt;br /&gt;      dict entry(
&lt;br /&gt;         string &quot;LinkLossAlertLevel&quot;
&lt;br /&gt;         variant             string &quot;none&quot;
&lt;br /&gt;      )
&lt;br /&gt;      dict entry(
&lt;br /&gt;         string &quot;ImmediateAlertLevel&quot;
&lt;br /&gt;         variant             string &quot;high&quot;
&lt;br /&gt;      )
&lt;br /&gt;   ]
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;3. use gatttool to check the Alert Level value
&lt;br /&gt;&lt;div class=&quot;highlight&quot;&gt;
&lt;br /&gt;erin@sundays:~$ dbus-send --system --type=method_call --print-reply --dest=org.bluez /org/bluez/2617/hci1/dev_78_DD_08_A3_A7_52 org.bluez.Proximity.SetProperty string:LinkLossAlertLevel variant:string:mild
&lt;br /&gt;method return sender=:1.62 -&amp;gt; dest=:1.96 reply_serial=2
&lt;br /&gt;
&lt;br /&gt;erin@sundays:/project/upstream/bluez$ sudo gatttool -i hci0 -b 78:DD:08:A3:A7:52 -p 31 -m 48 --interactive
&lt;br /&gt;[   ][78:DD:08:A3:A7:52][BR]&amp;gt; connect
&lt;br /&gt;[CON][78:DD:08:A3:A7:52][BR]&amp;gt; char-read-uuid 2a06
&lt;br /&gt;[CON][78:DD:08:A3:A7:52][BR]&amp;gt; 
&lt;br /&gt;handle: 0x000b 	 value: 01 
&lt;br /&gt;handle: 0x0013 	 value: 00 
&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/tracker/6730068706524524033-595233347944784913?l=i-miss-erin.blogspot.com&quot; alt=&quot;&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>erin</name>
			<email>noreply@blogger.com</email>
			<uri>http://i-miss-erin.blogspot.com/search/label/0xlab</uri>
		</author>
		<source>
			<title type="html">Reading, Writing and Arithmetic</title>
			<link rel="self" href="http://www.blogger.com/feeds/6730068706524524033/posts/default/-/0xlab"/>
			<id>tag:blogger.com,1999:blog-6730068706524524033</id>
		</source>
	</entry>

	<entry>
		<title type="html">0xlab 一年來的開發狀態更新</title>
		<link href="http://jserv.blogspot.com/2011/08/0xlab.html"/>
		<id>tag:blogger.com,1999:blog-1795333590425870072.post-1694409666580367729</id>
		<updated>2011-08-14T09:42:55+00:00</updated>
		<content type="html">&lt;a href=&quot;http://4.bp.blogspot.com/-zM_0kEepAUo/TkeKXt7wfpI/AAAAAAAABQY/C8Tf5w78afs/s1600/0xlab-mwc2011.jpg&quot;&gt;&lt;img src=&quot;http://4.bp.blogspot.com/-zM_0kEepAUo/TkeKXt7wfpI/AAAAAAAABQY/C8Tf5w78afs/s320/0xlab-mwc2011.jpg&quot; alt=&quot;&quot; style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 240px; height: 320px;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5640629198376697490&quot; /&gt;&lt;/a&gt;忙碌的日子總是過得比較快，這一年來，&lt;a href=&quot;http://0xlab.org/&quot;&gt;0xlab&lt;/a&gt; 歷經頗多轉變，主要有以下三方面：
&lt;br /&gt;&lt;ul&gt;&lt;li&gt;技術涵蓋： 為了加速 Android 系統整合與優化，我們建構了若干工具與提供一些創新的方法，比方說快速啟動 Android，詳情可見 &lt;a href=&quot;http://0xlab.org/technology.html&quot;&gt;0xlab::Technology&lt;/a&gt;&lt;/li&gt;&lt;li&gt;與知名專案與開源團隊的合作：除了過去已合作的 &lt;a href=&quot;http://www.android-x86.org/&quot;&gt;android-x86&lt;/a&gt; 與 &lt;a href=&quot;http://www.cyanogenmod.com/&quot;&gt;CyanogenMod&lt;/a&gt; 專案外 (主要是 Graphics 與 ARM 相關效能優化)，我們也投入 &lt;a href=&quot;http://www.linaro.org/&quot;&gt;Linaro&lt;/a&gt; 的開發，建立 &lt;a href=&quot;https://wiki.linaro.org/Platform/Android&quot;&gt;Android platform&lt;/a&gt; 與 LAVA (&lt;a href=&quot;https://wiki.linaro.org/Platform/Validation/LAVA&quot;&gt;Linaro Automated Validation Architecture&lt;/a&gt;) 的基礎&lt;/li&gt;&lt;li&gt;建立與主要 SoC 廠商的聯繫及協同開發：與兩家重要的 SoC 廠商 (排名 Top 20 半導體公司) 密切合作開發，在 Android 的基礎上，透過若干開源的創新，加強 SoC 競爭力，並導入產品設計&lt;/li&gt;&lt;/ul&gt;即使比過往忙碌，不過我們仍持續貢獻於開放原始碼的世界，以下是從去年發表「&lt;a href=&quot;http://jserv.blogspot.com/2010/09/0xlab.html&quot;&gt;簡介 0xlab 新的開放原始碼專案&lt;/a&gt;」之後的更新：
&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/0xdroid/&quot;&gt;0xdroid&lt;/a&gt; :作為 &lt;a href=&quot;http://0xlab.org/&quot;&gt;0xlab&lt;/a&gt; 的 Android 參考優化與客製化設計，其成果不僅為 &lt;a href=&quot;http://beagleboard.org/&quot;&gt;Beagleboard&lt;/a&gt; 社群所熟知，許多內部的改進也廣泛用於 &lt;a href=&quot;http://www.cyanogenmod.com/&quot;&gt;CyanogenMod&lt;/a&gt;，間接使許多裝置與公司團體受惠。可參考 &lt;a href=&quot;http://code.google.com/p/0xdroid/wiki/Roadmap&quot;&gt;0xdroid::Roadmap&lt;/a&gt; 以得知細部的演進，簡單來說，在高解析度的環境，提昇了 Android 使用者體驗 (software curosr, on-screen keyboard, launcher)，另外就是進一步的 ARM 優化，從 skia, zlib, libcore, libc, 到 libagl (libGLES_android) 都有&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/0xbench/&quot;&gt;0xbench&lt;/a&gt; : 仍是截至目前為止，我們所知的最完整 Android 開放原始碼系統效能評測工具，與上個版本相較，追加了 Web/JavaScript 效能評測、LAVA 的資料格式 (bundle)、重新啟用 &lt;a href=&quot;http://hub.opensolaris.org/bin/view/Project+libmicro/WebHome&quot;&gt;libMicro&lt;/a&gt; 等等，詳情可見 &lt;a href=&quot;http://code.google.com/p/0xbench/wiki/Benchmarks&quot;&gt;0xbench::Benchmarks&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://wiki.linaro.org/&quot;&gt;Linaro&lt;/a&gt; : 經 &lt;a href=&quot;http://www.arm.com/&quot;&gt;ARM&lt;/a&gt; 的支持，&lt;a href=&quot;http://0xlab.org/&quot;&gt;0xlab&lt;/a&gt; 投入 &lt;a href=&quot;http://www.linaro.org/&quot;&gt;Linaro&lt;/a&gt; 開發，共同為改善開發原始碼軟體品質而努力。我們涉及的項目稍微繁雜些，從整合 Linaro toolchain、改善 Android runtime、強化 LAVA 的整合，到多媒體驗證都有
&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/aster/&quot;&gt;aster&lt;/a&gt; : 全名是 &quot;Android System Testing Environment and Runtime&quot;，著眼於 Android 系統中許多無法透過 API 呼叫所作的 black-box test，一旦 adb daemon 正常啟動後，這個系統就可依據指定的 test case 去逐一執行並驗證，此系統也允許使用者編輯操作案例&lt;/li&gt;&lt;li&gt;Android 快速開機: 利用優化過的 ARM hibernation (suspend-to-disk)，大幅縮減 Android 系統從 HW reset 到使用者得以操作的時間，可參考展示影片 &quot;&lt;a href=&quot;http://www.youtube.com/watch?v=pvcQiiikJDU&quot;&gt;Android Fast Booting with CarHome&lt;/a&gt;&quot;，相關的原始碼也一併釋出，可見 &lt;a href=&quot;http://gitorious.org/0xlab-kernel&quot;&gt;0xlab-kernel&lt;/a&gt;，儘管仍有頗大的進步空間，但這是完全可運作且開源的解決方案
&lt;br /&gt;&lt;/li&gt;&lt;li&gt;AMBER : 這是我們提供的第一個完整的應用系統，概念非常簡單，考量到現有 Android 裝置相當多元，可能是手機、筆記型電腦、平板電腦、電子書，或者數位電子，這之間要進行媒體 (media/content) 的交換往往很沒效率，而且使用者還得被繁複且多樣的多媒體格式所困擾，若無適度的轉換，通常就無法在手機或者較陽春的平板上播放。我們提出的解法，就是將動作縮減為 &quot;push&quot; 與 &quot;pull&quot;，自動偵測媒體的格式與屬性，無論在近距 (家用或小範圍) 或遠距 (透過雲端或者防火牆)，挑選最合適的途徑，讓使用者盡情觀賞與交換。同樣的，這也是開放原始碼，內建於 &lt;a href=&quot;http://2.bp.blogspot.com/-c76vtJcvYkY/TkeU2hqihII/AAAAAAAABQg/0qEW6ZM89Wo/s1600/amber.png&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://gitorious.org/0xdroid&quot;&gt;0xdroid&lt;/a&gt;&lt;img src=&quot;http://2.bp.blogspot.com/-c76vtJcvYkY/TkeU2hqihII/AAAAAAAABQg/0qEW6ZM89Wo/s320/amber.png&quot; alt=&quot;&quot; style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 320px; height: 138px;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5640640722775475330&quot; /&gt;&lt;/li&gt;&lt;li&gt;Toolchain : 除了改善 &lt;a href=&quot;https://wiki.linaro.org/Platform/Android/AndroidToolchainBenchmarking/&quot;&gt;Linaro Toolchain for Android&lt;/a&gt; 外，我們還改善了 Android ELF prelink，大幅縮減執行時期需要解析的 ELF 符號數量，也縮減了載入時間，近期內會提交到 AOSP&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://review.source.android.com/&quot;&gt;Android Open Source Project&lt;/a&gt; : 已被 Google Android 計畫正式收錄 37 個修改/貢獻
&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;其他項目就要看合作夥伴的狀況了，先提到這邊。歡迎透過以下方式，與我們聯繫與交流：
&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Twitter: &lt;a href=&quot;http://twitter.com/0xlab&quot;&gt;http://twitter.com/0xlab&lt;/a&gt;&lt;/li&gt;&lt;li&gt;郵件論壇: &lt;a href=&quot;http://groups.google.com/group/0xlab-devel&quot;&gt;0xlab-devel&lt;/a&gt; (系統開發) ; &lt;a href=&quot;http://groups.google.com/group/0xlab-discuss&quot;&gt;0xlab-discuss&lt;/a&gt; (一般討論)&lt;/li&gt;&lt;li&gt;YouTube: &lt;a href=&quot;http://www.youtube.com/0xlab&quot;&gt;http://www.youtube.com/0xlab&lt;/a&gt;&lt;/li&gt;&lt;li&gt;有源碼有真相: &lt;a href=&quot;http://gitorious.org/+0xlab&quot;&gt;gitorious&lt;/a&gt;, &lt;a href=&quot;https://github.com/0xlab&quot;&gt;github&lt;/a&gt;
&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;一如過往，我們今年也會在台灣最大的開放原始碼研討會 &lt;a href=&quot;http://coscup.org/2011/&quot;&gt;COSCUP&lt;/a&gt; 發布最新的專案與社群計畫，期待您的指教，謝謝！
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/tracker/1795333590425870072-1694409666580367729?l=jserv.blogspot.com&quot; alt=&quot;&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>jserv</name>
			<email>noreply@blogger.com</email>
			<uri>http://jserv.blogspot.com/</uri>
		</author>
		<source>
			<title type="html">Hacking at 0xlab</title>
			<subtitle type="html">Something hacked by jserv at 0xlab.</subtitle>
			<link rel="self" href="http://www.blogger.com/feeds/1795333590425870072/posts/default"/>
			<id>tag:blogger.com,1999:blog-1795333590425870072</id>
		</source>
	</entry>

	<entry>
		<title type="html">Android 2.3 Introduction &amp;amp; Statistics</title>
		<link href="http://kanru.info/blog/archives/2010/12/29/android23-introduction/"/>
		<id>urn:uuid:e84c0855-25f2-5058-bf1a-ba693dc97127</id>
		<updated>2011-06-29T13:33:30+00:00</updated>
		<content type="html" xml:lang="en">&lt;p&gt;如果你有收看 LWN.net 的話，大概知道每次 linux kernel 有新的 release 前都會有一次針對這次 release 的統計資料，看看主要的貢獻是由哪些人，哪些公司完成。藉由這次跟 0xlab 分享 Android 2.3 新特性的時候，我學 LWN.net
做了一些小統計，還滿有趣的。&lt;/p&gt;

&lt;h2&gt;Most active Android 2.3 organizations (by changesets)&lt;/h2&gt;

&lt;table&gt;
&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;4204 google.com
1354 android.com
98 sonyericsson.com
71 gmail.com
39 codeaurora.org
39 samsung.com
38 intel.com
32 nokia.com
32 holtmann.org
&lt;strong&gt;29 0xlab.org&lt;/strong&gt;
25 trusted-logic.com
17 openbossa.org
11 nxp.com
&lt;strong&gt;11 linux.org.tw&lt;/strong&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;
&lt;pre&gt;10 ti.com
10 acer.com.tw
8 themaw.net
8 garmin.com
7 snpe.rs
7 motorola.com
7 mc.pp.se
7 googlemail.com
5 invensense.com
4 mirbsd.org
3 windriver.com
3 realvnc.com
2 teleca.com
2 sharp.co.jp&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;
&lt;pre&gt;2 nvidia.com
2 motoya.co.jp
2 lge.com
2 broadcom.com
1 yahoo-inc.com
1 xs4all.nl
1 wdsglobal.com
1 uwevoelker.de
1 strongswan.org
1 stericsson.com
1 signove.com
1 saftware.de
1 richlowe.net
1 pv.com&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;
&lt;pre&gt;1 promwad.com
1 pcc.me.uk
1 padovan.org
1 osbeck.com
1 nii.net
1 martin.st
1 ilovelinux.de
1 happydroid.com
1 droidmod.org
1 cpeterso.com
1 big.or.jp
1 arm.com&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;h2&gt;Most active Android 2.3 developers (by lines changed)&lt;/h2&gt;

&lt;table&gt;
&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;Jesse Wilson
Eric Laurent
Dianne Hackborn
David 'Digit' Turner
Nick Pelly
Mathias Agopian
Nick Kralevich
Brian Carlstrom
Eric Fischer
Andreas Huber&lt;/pre&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;pre&gt;386588
364359
260033
205494
160707
124119
103004
83492
61646
61233&lt;/pre&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;pre&gt;12.8708%
12.13%
8.65%
6.84% 
5.35%
4.13%
3.42%
2.77%
2.05%
2.03%&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;

&lt;hr /&gt;

&lt;div style=&quot;width: 425px;&quot; id=&quot;__ss_6395491&quot; class=&quot;center&quot;&gt;&amp;lt;object height=&quot;355&quot;&quot; id=&quot;__sse6395491&quot; width=&quot;425&quot;&quot;&amp;gt;&amp;lt;param name=&quot;movie&quot; value=&quot;//static.slidesharecdn.com/swf/ssplayer2.swf?doc=android23intro-101229014534-phpapp02&amp;amp;amp;rel=0&amp;amp;amp;stripped_title=android23intro&amp;amp;amp;userName=kanru&quot;/&amp;gt;&amp;lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;/&amp;gt;&amp;lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;/&amp;gt;&amp;lt;embed allowfullscreen=&quot;true&quot; allowscriptaccess=&quot;always&quot; height=&quot;355&quot;&quot; name=&quot;__sse6395491&quot; src=&quot;http://kanru.info//static.slidesharecdn.com/swf/ssplayer2.swf?doc=android23intro-101229014534-phpapp02&amp;amp;amp;rel=0&amp;amp;amp;stripped_title=android23intro&amp;amp;amp;userName=kanru&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;412&quot;&quot;&amp;gt;&amp;lt;/embed&amp;gt;&amp;lt;/object&amp;gt;&lt;/div&gt;

&lt;p&gt;投影片中還研究了一下各主要開發者主要研究的方向，看 log 的時候依照這個順序去看，有一定的脈絡可尋 :)&lt;/p&gt;</content>
		<author>
			<name>Kanru's Adventure Journal</name>
			<uri>http://kanru.info/blog/tags/0xlab/</uri>
		</author>
		<source>
			<title type="html">Kanru @ 0xlab</title>
			<subtitle type="html">Kanru's Adventure Journal</subtitle>
			<link rel="self" href="http://kanru.info/blog/tags/0xlab/index.atom"/>
			<id>http://kanru.info/blog/tags/0xlab/</id>
		</source>
	</entry>

	<entry>
		<title type="html">Android: Wakelocks and TuxOnIce</title>
		<link href="http://kanru.info/blog/archives/2011/06/29/android-wakelocks-n-tuxonice/"/>
		<id>urn:uuid:e95626a2-2d2e-5067-9a84-1af70508ef83</id>
		<updated>2011-06-29T13:02:58+00:00</updated>
		<content type="html" xml:lang="en">&lt;p&gt;最近為了把 &lt;a href=&quot;http://tuxonice.net/&quot;&gt;TuxOnIce&lt;/a&gt; 整到 &lt;a href=&quot;https://gitorious.org/0xlab-kernel/kernel/commits/toi/linaro-android.38&quot;&gt;Android 上面&lt;/a&gt;，著實把 Linux 的電源管理系統中關於 suspend 與 hibernation 的部份研究了一下。而 Android 為了增加待機時間加入了 wakelock 的機制，讓情況變得更加複雜。&lt;/p&gt;

&lt;h2&gt;TuxOnIce&lt;/h2&gt;

&lt;h3&gt;TOI Patch&lt;/h3&gt;

&lt;p&gt;TuxOnIce 簡稱 TOI，前身是 Software Suspend 2，是一個長期在 linux
upstream 以外耕耘的一個休眠補釘，相較於早期整合到 linux kernel 內的
swsusp，TOI 的功能非常豐富，可以指定把記憶體內容儲存到多種不同的位置，如檔案或置換空間，還可以選擇不同的壓縮方法。&lt;/p&gt;

&lt;p&gt;首先幫 ARM 平台加上基本的休眠功能，使用 Hiroshi DOYU 的 patch:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://article.gmane.org/gmane.linux.power-management.general/20543&quot;&gt;http://article.gmane.org/gmane.linux.power-management.general/20543&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;然後到 TOI 網站下載最新的 3.2 補釘，打上去的時候會有一些衝突但是都還滿容易解決，要注意的是某些衝突是看不出來的，例如因為函式移動位置而造成重複定義，要小心檢查。&lt;/p&gt;

&lt;p&gt;然後因為 TOI 對於非 x86 平台有一些假設現在已經不適用，所以需要修改&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gitorious.org/0xlab-kernel/kernel/commit/e551caf&quot;&gt;https://gitorious.org/0xlab-kernel/kernel/commit/e551caf&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;OMAPFB&lt;/h3&gt;

&lt;p&gt;使用 Pandaboard 加上 Android 測試才發現從休眠醒來後 LCD 不會自動點亮，通常在 x86 平台上有 pm-utils 或是 hibernate script 來幫忙處理這種關閉打開 LCD 的問題，這次我是先在 kernel 內幫 OMAPFB 加上一個電源管理的呼叫，讓 kernel 醒來的時候自己重新設定 LCD。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gitorious.org/0xlab-kernel/kernel/commit/21e0f14&quot;&gt;https://gitorious.org/0xlab-kernel/kernel/commit/21e0f14&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Pandaboard &amp;amp; Beagleboard xM&lt;/h3&gt;

&lt;p&gt;在 Pandaboard 或 Beagleboard xM 上面沒有 NAND 可以當作儲存空間，所以一般都是把檔案放在MMC 上面，第一個 patch 讓 kernel 在開機的時候不要初始化不存在的 NAND 空間&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gitorious.org/0xlab-kernel/kernel/commit/3ae6b4c&quot;&gt;https://gitorious.org/0xlab-kernel/kernel/commit/3ae6b4c&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;然後因為 MMC 的 probe 需要時間，第二個 patch 讓 TOI 等待指定的 resume
device 已經偵測到之後才開始進行 resume&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gitorious.org/0xlab-kernel/kernel/commit/1078bd7&quot;&gt;https://gitorious.org/0xlab-kernel/kernel/commit/1078bd7&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Wakelock&lt;/h2&gt;

&lt;p&gt;wakelock 是 Android 為了讓裝置可以更積極的休眠又不妨礙正常工作的進行而加入的機制，究竟是好是壞已經在 LKML 與 LWN 上面討論過非常多次，可以參考：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://lwn.net/Articles/318611/&quot;&gt;Wakelocks and the embedded problem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://lwn.net/Articles/388131/&quot;&gt;Blocking suspend blockers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://thread.gmane.org/gmane.linux.kernel/985471&quot;&gt;Suspend block api (version 7)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;失眠症&lt;/h3&gt;

&lt;p&gt;開始測試 TOI 的效果時遇到的第一個問題就是失眠症，因為 wakelock 從中作梗，導致每次休眠到一半就被取消掉。原來是因為 TOI 的休眠途徑會先強制檔案系統把內容寫回，而 MMC 子系統會在寫入/讀取一段時間後嘗試進入低耗電模式，偏偏 Android 在這裡安插了一個 wakelock，導致之後要凍結所有執行緒的時候失敗。&lt;/p&gt;

&lt;p&gt;解法，首先因為休眠的後半段路徑其實就是要準備進行關機，而一般來說休眠都是人為啟動，因此可以假設此時使用者了解工作可能還未完成，可以忽略
wakelock，所以第一個 patch 就是讓休眠的路徑不去檢查 wakelock，避免像
MMC 這樣的問題。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gitorious.org/0xlab-kernel/kernel/commit/3bb5d6f&quot;&gt;https://gitorious.org/0xlab-kernel/kernel/commit/3bb5d6f&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;接下來是一般的待機路徑，似乎是因為新的 kernel 會積極的嘗試把 MMC 變成低耗電模式，但 OMAP 預設的 MMC timeout 是 100 毫秒，把工作放在 Queue
裡面反而不斷鎖住 wakelock 讓 Android 無法休眠，第二個 patch 就是讓 MMC
子系統在準備休眠的時候就不要作無謂的掙扎，直接進入低耗電模式。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gitorious.org/0xlab-kernel/kernel/commit/88823b9&quot;&gt;https://gitorious.org/0xlab-kernel/kernel/commit/88823b9&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;嗜睡症&lt;/h3&gt;

&lt;p&gt;解決了失眠症沒想到接下來遇到嗜睡症，因為手機插著 USB 的時候是不會真正睡著的，所以一直沒機會觀察 Android 睡著是怎麼樣，原來只把 kernel 叫醒是沒用的，Android 還會檢查目前的 input event 是否屬於 user activity 的範圍，是的話才會把整個系統帶醒，不然因為 wakelock 的機制，馬上就會又睡著。&lt;/p&gt;

&lt;p&gt;參考：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.elinux.org/Android_Power_Management&quot;&gt;Android Power Management&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
		<author>
			<name>Kanru's Adventure Journal</name>
			<uri>http://kanru.info/blog/tags/0xlab/</uri>
		</author>
		<source>
			<title type="html">Kanru @ 0xlab</title>
			<subtitle type="html">Kanru's Adventure Journal</subtitle>
			<link rel="self" href="http://kanru.info/blog/tags/0xlab/index.atom"/>
			<id>http://kanru.info/blog/tags/0xlab/</id>
		</source>
	</entry>

	<entry>
		<title type="html" xml:lang="en">Slides of the Android System Development Forum</title>
		<link href="http://asleepfromday.wordpress.com/2011/05/26/slides-of-the-android-system-development-forum/"/>
		<id>http://asleepfromday.wordpress.com/?p=205</id>
		<updated>2011-05-26T10:49:01+00:00</updated>
		<content type="html" xml:lang="en">&lt;p&gt;These are some of the slides from the technical speakers of the &lt;a href=&quot;http://www.digitimes.com.tw/seminar/android_1000428.htm&quot;&gt;Android System Development Forum&lt;/a&gt; on April 28th, 2011. Copyrights belong to their perspective owners and distributed under their permission.&lt;/p&gt;
&lt;p&gt;Android RenderScript on LLVM&lt;br /&gt;
by 廖世偉 博士&lt;br /&gt;
&amp;lt;iframe height=&quot;525&quot; src=&quot;http://www.slideshare.net/slideshow/embed_code/8103150&quot; width=&quot;640&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
&lt;p&gt;Is parallel programming hard? And if so, what can you do about it?&lt;br /&gt;
by Paul McKenney&lt;br /&gt;
&amp;lt;iframe height=&quot;525&quot; src=&quot;http://www.slideshare.net/slideshow/embed_code/8103031&quot; width=&quot;640&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
&lt;p&gt;Guides To Analyzing WebKit Performance&lt;br /&gt;
by Holger Freyther and Jim (jserv) Huang 黃敬群&lt;br /&gt;
&amp;lt;iframe height=&quot;525&quot; src=&quot;http://www.slideshare.net/slideshow/embed_code/8042012&quot; width=&quot;640&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
&lt;p&gt;Linaro and Android Kernel&lt;br /&gt;
by Andy Green&lt;br /&gt;
&amp;lt;iframe height=&quot;525&quot; src=&quot;http://www.slideshare.net/slideshow/embed_code/8109213&quot; width=&quot;640&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
&lt;p&gt;There are still some slides missing and I’ll keep updating here.&lt;/p&gt;
&lt;br /&gt;Filed under: &lt;a href=&quot;http://asleepfromday.wordpress.com/category/0xlab/&quot;&gt;0xlab&lt;/a&gt;, &lt;a href=&quot;http://asleepfromday.wordpress.com/category/android/&quot;&gt;Android&lt;/a&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/asleepfromday.wordpress.com/205/&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://feeds.wordpress.com/1.0/comments/asleepfromday.wordpress.com/205/&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.wordpress.com/1.0/godelicious/asleepfromday.wordpress.com/205/&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://feeds.wordpress.com/1.0/delicious/asleepfromday.wordpress.com/205/&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.wordpress.com/1.0/gofacebook/asleepfromday.wordpress.com/205/&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://feeds.wordpress.com/1.0/facebook/asleepfromday.wordpress.com/205/&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.wordpress.com/1.0/gotwitter/asleepfromday.wordpress.com/205/&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://feeds.wordpress.com/1.0/twitter/asleepfromday.wordpress.com/205/&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.wordpress.com/1.0/gostumble/asleepfromday.wordpress.com/205/&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://feeds.wordpress.com/1.0/stumble/asleepfromday.wordpress.com/205/&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.wordpress.com/1.0/godigg/asleepfromday.wordpress.com/205/&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://feeds.wordpress.com/1.0/digg/asleepfromday.wordpress.com/205/&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.wordpress.com/1.0/goreddit/asleepfromday.wordpress.com/205/&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://feeds.wordpress.com/1.0/reddit/asleepfromday.wordpress.com/205/&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;img src=&quot;http://stats.wordpress.com/b.gif?host=asleepfromday.wordpress.com&amp;amp;blog=1401761&amp;amp;post=205&amp;amp;subd=asleepfromday&amp;amp;ref=&amp;amp;feed=1&quot; alt=&quot;&quot; height=&quot;1&quot; border=&quot;0&quot; width=&quot;1&quot; /&gt;</content>
		<author>
			<name>John</name>
			<uri>http://asleepfromday.wordpress.com</uri>
		</author>
		<source>
			<title type="html">Asleep from Day » 0xlab</title>
			<subtitle type="html">Geeks are boring</subtitle>
			<link rel="self" href="http://asleepfromday.wordpress.com/category/0xlab/feed/"/>
			<id>http://asleepfromday.wordpress.com</id>
		</source>
	</entry>

	<entry>
		<title type="html">OBEX Message Access Profile introduction</title>
		<link href="http://i-miss-erin.blogspot.com/2011/04/obex-message-access-profile.html"/>
		<id>tag:blogger.com,1999:blog-6730068706524524033.post-601259890149752317</id>
		<updated>2011-05-06T11:03:04+00:00</updated>
		<content type="html">Have you ever tried to push a SMS message from a laptop to an Android phone via Bluetooth? It's very similar to OPP (object push profile) and it is to use OBEX to exchange data too. I found some patches in &lt;a href=&quot;https://www.codeaurora.org/contribute/projects/qaep&quot;&gt;Aurora&lt;/a&gt; about supporting MAP (message access profile) in Android two months ago. Finally, I got some time to play with it.&lt;br /&gt;&lt;br /&gt;What is &lt;a href=&quot;http://www.bluetomorrow.com/bluetooth-glossary/message-access-profile-map.html&quot;&gt;MAP&lt;/a&gt;? MAP defines a set of features and procedures to exchange messages between devices. It is especially tailored for the automotive Hands-Free use case where an onboard terminal device (typically a Car-Kit installed in the car) takes advantage of the messaging capability of a communication device (typically a mobile phone). This profile can however also be used for other use cases that require the exchange of messages between two devices. &lt;br /&gt;&lt;br /&gt;I have no Car-Kit to verify this profile and I cannot find any platform to support it either. Therefore, I use python lightblue and  write few lines to verify this function. I have one samsung smdkv210 platform and one ubuntu laptop. Below is the list about MAP profile from &lt;a href=&quot;https://www.codeaurora.org/gitweb/quic/la/&quot;&gt;Aurora git repository&lt;/a&gt;. If you are using gingerbread, you could apply their patches easily. Also, it's just a simple list and we should review git log to retrieve more patches related to MAP profile.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;native bluez&lt;/span&gt;&lt;br /&gt;Bluetooth : Add MAP service records into SDP tool&lt;br /&gt;https://www.codeaurora.org/gitweb/quic/la/?p=platform/external/bluetooth/bluez.git;a=commit;h=7f52e048879c74a35a212ed4a0ce2f14133e2806&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;android frameworks&lt;/span&gt;&lt;br /&gt;frameworks/bluetooth: Changes for enabling Bluetooth MAP profile&lt;br /&gt;https://www.codeaurora.org/gitweb/quic/la/?p=platform/frameworks/base.git;a=commit;h=a7d9bf26766e420be997d2858fc7b73b42868860&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Bluetooth UI application&lt;/span&gt;&lt;br /&gt;Bluetooth: Adding MAP Profile implementation&lt;br /&gt;https://www.codeaurora.org/gitweb/quic/la/?p=platform/packages/apps/Bluetooth.git;a=commit;h=e900ed4897561fbb317a8c1488ac84c0fb051068&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Email UI application&lt;/span&gt;&lt;br /&gt;Email: Changes to trigger Email app to update its mailbox from Bluetooth MAP Profile&lt;br /&gt;https://www.codeaurora.org/gitweb/quic/la/?p=platform/packages/apps/Email.git;a=commit;h=e11f384228e44cb8b718247436fc0501bb81673a&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;MMS UI application&lt;/span&gt;&lt;br /&gt;Mms: Enable MMS app to push a MMS added to outbox by Bluetooth MAP profile&lt;br /&gt;https://www.codeaurora.org/gitweb/quic/la/?p=platform/packages/apps/Mms.git;a=commit;h=703e2c2ae82f973954c539cd8e55470e4d6c3873&lt;br /&gt;&lt;br /&gt;Add MAS service from init.rc file and then we can see MAP record from sdptool.&lt;br /&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;br /&gt;#cat /root/init.rc&lt;br /&gt;service map /system/bin/sdptool add --channel=16 MAS&lt;br /&gt;    user bluetooth&lt;br /&gt;    group bluetooth net_bt_admin&lt;br /&gt;    disabled&lt;br /&gt;    oneshot&lt;br /&gt;&lt;br /&gt;# sdptool browse local&lt;br /&gt;Service Name: OBEX Message Access&lt;br /&gt;Service RecHandle: 0x10008&lt;br /&gt;Service Class ID List:&lt;br /&gt;  &quot;&quot; (0x1132)&lt;br /&gt;Protocol Descriptor List:&lt;br /&gt;  &quot;L2CAP&quot; (0x0100)&lt;br /&gt;  &quot;RFCOMM&quot; (0x0003)&lt;br /&gt;    Channel: 16&lt;br /&gt;  &quot;OBEX&quot; (0x0008)&lt;br /&gt;Profile Descriptor List:&lt;br /&gt;  &quot;&quot; (0x1134)&lt;br /&gt;    Version: 0x0100&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;I use ipython to write my scripts to demo MAP function. I create an OBEX Client from my Ubuntu machine and use it to connect with Android device. It send a 'get' request to retrieve the first slot of SMS.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;prettyprint&quot;&gt;&lt;br /&gt;import lightblue&lt;br /&gt;host=&quot;12:60:41:7F:03:11&quot;&lt;br /&gt;port=16&lt;br /&gt;client = lightblue.obex.OBEXClient(host,port)&lt;br /&gt;client.connect()&lt;br /&gt;f=file('/home/erin/Desktop/temp','w+')&lt;br /&gt;client.get({'type':&quot;x-bt/message&quot;,'name':'1'},f)&lt;br /&gt;f.seek(0)&lt;br /&gt;f.read()&lt;br /&gt;f.close()&lt;br /&gt;client.disconnect()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-FDQuogiepDM/TcPUz2uw1UI/AAAAAAAAHM4/vQKD5QM-TTE/s1600/device003.png&quot;&gt;&lt;img src=&quot;http://1.bp.blogspot.com/-FDQuogiepDM/TcPUz2uw1UI/AAAAAAAAHM4/vQKD5QM-TTE/s400/device003.png&quot; alt=&quot;&quot; style=&quot;cursor: pointer; cursor: hand; width: 400px; height: 240px;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5603556348709098818&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-E3G-xgGs8L4/TcPUzyqAqhI/AAAAAAAAHMw/B-JN1y0rvHg/s1600/Screenshot-2.png&quot;&gt;&lt;img src=&quot;http://1.bp.blogspot.com/-E3G-xgGs8L4/TcPUzyqAqhI/AAAAAAAAHMw/B-JN1y0rvHg/s400/Screenshot-2.png&quot; alt=&quot;&quot; style=&quot;cursor: pointer; cursor: hand; width: 400px; height: 216px;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5603556347615422994&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/tracker/6730068706524524033-601259890149752317?l=i-miss-erin.blogspot.com&quot; alt=&quot;&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>erin</name>
			<email>noreply@blogger.com</email>
			<uri>http://i-miss-erin.blogspot.com/search/label/0xlab</uri>
		</author>
		<source>
			<title type="html">Reading, Writing and Arithmetic</title>
			<link rel="self" href="http://www.blogger.com/feeds/6730068706524524033/posts/default/-/0xlab"/>
			<id>tag:blogger.com,1999:blog-6730068706524524033</id>
		</source>
	</entry>

	<entry>
		<title type="html">Beagleboard Hibernation DEMO</title>
		<link href="http://matthsu-abacus.blogspot.com/2011/04/seeing-is-believing.html"/>
		<id>tag:blogger.com,1999:blog-8469912421183119143.post-6595112817597864867</id>
		<updated>2011-04-13T06:36:00+00:00</updated>
		<content type="html">I gave a talk in &lt;a href=&quot;http://osdc.tw/schedule.html&quot;&gt;OSDC&lt;/a&gt;. But I did not provide _visible_ demo by that time.&lt;br /&gt;Now, seeing is believing.&lt;br /&gt;&lt;br /&gt;&amp;lt;iframe allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot; height=&quot;390&quot; src=&quot;http://www.youtube.com/embed/pvcQiiikJDU&quot; title=&quot;YouTube video player&quot; width=&quot;390&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;&lt;br /&gt;The idea behind this technology is not something new. It's based on hibernation.&lt;br /&gt;Special thanks for walkingice's help out on filming this, &lt;a href=&quot;http://www.catcan.com.tw/&quot;&gt;CATCAN&lt;/a&gt;'s sponsor on LCD expansion board.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/tracker/8469912421183119143-6595112817597864867?l=matthsu-abacus.blogspot.com&quot; alt=&quot;&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>matt</name>
			<email>noreply@blogger.com</email>
			<uri>http://matthsu-abacus.blogspot.com/search/label/0xlab</uri>
		</author>
		<source>
			<title type="html">Game Changer</title>
			<link rel="self" href="http://www.blogger.com/feeds/8469912421183119143/posts/default/-/0xlab"/>
			<id>tag:blogger.com,1999:blog-8469912421183119143</id>
		</source>
	</entry>

	<entry>
		<title type="html" xml:lang="en">Android System Development Forum</title>
		<link href="http://asleepfromday.wordpress.com/2011/04/01/android-system-development-forum/"/>
		<id>http://asleepfromday.wordpress.com/?p=197</id>
		<updated>2011-04-01T08:28:18+00:00</updated>
		<content type="html" xml:lang="en">&lt;p&gt;By coincidence, the abbreviation of this is ASDF, which is kind of geeky…&lt;/p&gt;
&lt;p&gt;0xlab is going to co-host this event on 2011/04/28. Please refer to&lt;br /&gt;
&lt;a href=&quot;http://www.digitimes.com.tw/seminar/android_1000428.htm&quot;&gt;http://www.digitimes.com.tw/seminar/android_1000428.htm&lt;/a&gt;&lt;br /&gt;
for more information. The introduction page is in Traditional Chinese, but some of the sessions are in English.&lt;/p&gt;
&lt;p&gt;We think there are quite some Android summits out there, but most of them are about application development and business trends. We want to focus on the system development aspect from a more technical point of view.&lt;/p&gt;
&lt;p&gt;Oh by the way, did I mention it’s free of charge?&lt;/p&gt;
&lt;br /&gt;Filed under: &lt;a href=&quot;http://asleepfromday.wordpress.com/category/0xlab/&quot;&gt;0xlab&lt;/a&gt;, &lt;a href=&quot;http://asleepfromday.wordpress.com/category/android/&quot;&gt;Android&lt;/a&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/asleepfromday.wordpress.com/197/&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://feeds.wordpress.com/1.0/comments/asleepfromday.wordpress.com/197/&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.wordpress.com/1.0/godelicious/asleepfromday.wordpress.com/197/&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://feeds.wordpress.com/1.0/delicious/asleepfromday.wordpress.com/197/&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.wordpress.com/1.0/gofacebook/asleepfromday.wordpress.com/197/&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://feeds.wordpress.com/1.0/facebook/asleepfromday.wordpress.com/197/&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.wordpress.com/1.0/gotwitter/asleepfromday.wordpress.com/197/&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://feeds.wordpress.com/1.0/twitter/asleepfromday.wordpress.com/197/&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.wordpress.com/1.0/gostumble/asleepfromday.wordpress.com/197/&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://feeds.wordpress.com/1.0/stumble/asleepfromday.wordpress.com/197/&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.wordpress.com/1.0/godigg/asleepfromday.wordpress.com/197/&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://feeds.wordpress.com/1.0/digg/asleepfromday.wordpress.com/197/&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.wordpress.com/1.0/goreddit/asleepfromday.wordpress.com/197/&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://feeds.wordpress.com/1.0/reddit/asleepfromday.wordpress.com/197/&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;img src=&quot;http://stats.wordpress.com/b.gif?host=asleepfromday.wordpress.com&amp;amp;blog=1401761&amp;amp;post=197&amp;amp;subd=asleepfromday&amp;amp;ref=&amp;amp;feed=1&quot; alt=&quot;&quot; height=&quot;1&quot; border=&quot;0&quot; width=&quot;1&quot; /&gt;</content>
		<author>
			<name>John</name>
			<uri>http://asleepfromday.wordpress.com</uri>
		</author>
		<source>
			<title type="html">Asleep from Day » 0xlab</title>
			<subtitle type="html">Geeks are boring</subtitle>
			<link rel="self" href="http://asleepfromday.wordpress.com/category/0xlab/feed/"/>
			<id>http://asleepfromday.wordpress.com</id>
		</source>
	</entry>

	<entry>
		<title type="html">Alternative use of Openmoko  debug board</title>
		<link href="http://matthsu-abacus.blogspot.com/2011/03/alternative-use-of-openmoko-debug-board.html"/>
		<id>tag:blogger.com,1999:blog-8469912421183119143.post-1502547502008886243</id>
		<updated>2011-03-29T10:54:27+00:00</updated>
		<content type="html">If you have an &lt;a href=&quot;http://wiki.openmoko.org/wiki/Debug_Board_v3&quot;&gt;openmoko debug board&lt;/a&gt;, don't throw it away as recycling.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-By17kco19z0/TZG0XlqaLFI/AAAAAAAAAGQ/GxxR_b5ixm4/s1600/IMG_20110329_181001.jpg&quot;&gt;&lt;img src=&quot;http://4.bp.blogspot.com/-By17kco19z0/TZG0XlqaLFI/AAAAAAAAAGQ/GxxR_b5ixm4/s200/IMG_20110329_181001.jpg&quot; alt=&quot;&quot; style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 200px; height: 150px;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5589446929883475026&quot; /&gt;&lt;/a&gt;&lt;br /&gt;By combining om-debugboard and MOSFET drivers, you can issue commands to power on/off your device. But why do so?&lt;br /&gt;&lt;br /&gt;Sometimes, when a system such as android is in development, system library would be crashed from time to time. Even adbd is down. At this moment, what you can do is to reset the device through power on/off. But this usually requires manual operation. Think about another scenario, if you want to run CTS on android device, you of course prefer everything is automatic. You definitely need an approach to shutdown the power of your device or turn it on.&lt;br /&gt;&lt;br /&gt;The keyword is openmoko debug board, relay leg and &lt;a href=&quot;http://www.blogger.com/ww1.microchip.com/downloads/en/DeviceDoc/21420d.pdf&quot;&gt;MOSEFT drivers&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Thanks my bro's help out and his lab from NTUST. The corresponding circuit is simple enough. I will make  schematic later. Since my TODO list can't be added any more options recently.  :(&lt;br /&gt;&lt;br /&gt;The way to control the GPIO on debugboard is easy. &lt;a href=&quot;http://www.intra2net.com/en/developer/libftdi/&quot;&gt;libftdi &lt;/a&gt;provides many features on this. The easiest approach is to enable bitbang mode. I implemented a simple program to control GPIO(TDO pin) output.&lt;br /&gt;You can download it here:&lt;br /&gt;&lt;br /&gt;http://www.0xlab.org/~matt/om-debugb-gpio.tar.bz2&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/tracker/8469912421183119143-1502547502008886243?l=matthsu-abacus.blogspot.com&quot; alt=&quot;&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>matt</name>
			<email>noreply@blogger.com</email>
			<uri>http://matthsu-abacus.blogspot.com/search/label/0xlab</uri>
		</author>
		<source>
			<title type="html">Game Changer</title>
			<link rel="self" href="http://www.blogger.com/feeds/8469912421183119143/posts/default/-/0xlab"/>
			<id>tag:blogger.com,1999:blog-8469912421183119143</id>
		</source>
	</entry>

	<entry>
		<title type="html">Introducing 0xBench</title>
		<link href="http://o0o.cse.tw/post/947075375"/>
		<id>http://o0o.cse.tw/post/947075375</id>
		<updated>2010-08-13T12:24:00+00:00</updated>
		<content type="html">Today (Aug 14) we are announcing the release of 0xBench, an open source Android benchmarking app...</content>
		<author>
			<name>[bizkit|張至] good coders code, great steal.</name>
			<uri>http://o0o.cse.tw/</uri>
		</author>
		<source>
			<title type="html">[bizkit|張至] good coders code, great steal.</title>
			<subtitle type="html">var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-345192-17']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();</subtitle>
			<link rel="self" href="http://o0o.cse.tw/tagged/0xlab/rss"/>
			<id>http://o0o.cse.tw/</id>
		</source>
	</entry>

	<entry>
		<title type="html">Eclair Libgralloc Deadlock Problem</title>
		<link href="http://linuxocarina.blogspot.com/2010/06/ecliar-libgralloc-deadlock-problem.html"/>
		<id>tag:blogger.com,1999:blog-4272939767197667332.post-1466910094907380095</id>
		<updated>2010-06-10T01:50:15+00:00</updated>
		<content type="html">As we are developing &lt;a href=&quot;http://gitorious.org/0xdroid&quot;&gt;0xdroid&lt;/a&gt; beagle-eclair branch, we occasionally encounter screen flipping issue. This issue rarely happens however it bothers the user experience very much when running some resource eating applications. Last week in the Computex Taipei 2010 show, we demoed 0xdroid beagle-eclair connecting wireless modules and played games. I noticed that this issue happens very often while playing a game called &quot;&lt;a href=&quot;http://www.frozen-bubble.org/&quot;&gt;Frozen Bubble&lt;/a&gt;&quot;. (It's a good game, we all love this game a lot, and spent a lot of time on it. ;-) ) It's kind of embarrassing when the screen keeps flipping on the show. Therefore I decided to dig out this issue.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&amp;lt;object height=&quot;385&quot; width=&quot;480&quot;&amp;gt;&amp;lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/AO_A7AnLpvY&amp;amp;amp;hl=zh_TW&amp;amp;amp;fs=1&amp;amp;amp;&quot;/&amp;gt;&amp;lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;/&amp;gt;&amp;lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;/&amp;gt;&amp;lt;embed allowfullscreen=&quot;true&quot; allowscriptaccess=&quot;always&quot; height=&quot;385&quot; src=&quot;http://www.youtube.com/v/AO_A7AnLpvY&amp;amp;amp;hl=zh_TW&amp;amp;amp;fs=1&amp;amp;amp;&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;480&quot;&amp;gt;&amp;lt;/embed&amp;gt;&amp;lt;/object&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Beside of 0xdroid on &lt;a href=&quot;http://beagleboard.org/&quot;&gt;beagleboard&lt;/a&gt; and &lt;a href=&quot;http://www.timll.com/&quot;&gt;Devkit8000&lt;/a&gt;, I tested some other platforms and find out actually almost all of them having this problem. Therefore I suspected it's not a hardware related problem. Maybe a framework or HAL issue. We noticed that when the screen is flipping, the logcat message will complain as following&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre class=&quot;prettyprint&quot;&gt;E/SurfaceFlinger(  768): eglSwapBuffers: EGL error 0x3002 (EGL_BAD_ACCESS)&lt;br /&gt;E/gralloc (  768): handle 0x13f8c0 not locked&lt;br /&gt;~E/gralloc (  768): handle 0x13f8c0 already locked for write&lt;br /&gt;E/libagl  (  768): eglSwapBuffers() failed to lock buffer 0x1368e0 (640x480)&lt;br /&gt;E/SurfaceFlinger(  768): eglSwapBuffers: EGL error 0x3002 (EGL_BAD_ACCESS)&lt;br /&gt;E/gralloc (  768): handle 0x13f8c0 not locked&lt;br /&gt;E/gralloc (  768): handle 0x13f8c0 already locked for write&lt;br /&gt;E/libagl  (  768): eglSwapBuffers() failed to lock buffer 0x1368e0 (640x480)&lt;br /&gt;E/SurfaceFlinger(  768): eglSwapBuffers: EGL error 0x3002 (EGL_BAD_ACCESS)&lt;br /&gt;E/gralloc (  768): handle 0x13f8c0 not locked&lt;br /&gt;E/gralloc (  768): handle 0x13f8c0 already locked for write&lt;br /&gt;E/libagl  (  768): eglSwapBuffers() failed to lock buffer 0x1368e0 (640x480)&lt;br /&gt;E/SurfaceFlinger(  768): eglSwapBuffers: EGL error 0x3002 (EGL_BAD_ACCESS)&lt;br /&gt;E/gralloc (  768): handle 0x13f8c0 not locked&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;Therefore I checked the libgralloc and adding some debug message. The libgralloc plugin 0xdroid used is branched from original eclair source tree. I took few hours created the omap3/libgralloc at the first day when I got eclair source code months ago. Since it works well for the most of time, I didn't pay too much attention to it, until I found the deadlock issue goes crazy on frozen bubble.&lt;br /&gt;After noticing the lock log and swap error, I took a close look of the gralloc_lock and gralloc_unlock in hardware/omap3/libgralloc/mapper.c&lt;/div&gt;&lt;br /&gt;&lt;pre class=&quot;prettyprint&quot;&gt;int gralloc_lock(gralloc_module_t const* module,&lt;br /&gt;        buffer_handle_t handle, int usage,&lt;br /&gt;        int l, int t, int w, int h,&lt;br /&gt;        void** vaddr)&lt;br /&gt;{&lt;br /&gt;    if (private_handle_t::validate(handle) &amp;lt; 0)&lt;br /&gt;        return -EINVAL;&lt;br /&gt;&lt;br /&gt;    int err = 0;&lt;br /&gt;    private_handle_t* hnd = (private_handle_t*)handle;&lt;br /&gt;    int32_t current_value, new_value;&lt;br /&gt;    int retry;&lt;br /&gt;&lt;br /&gt;    do {&lt;br /&gt;        current_value = hnd-&amp;gt;lockState;&lt;br /&gt;        new_value = current_value;&lt;br /&gt;&lt;br /&gt;        if (current_value &amp;amp; private_handle_t::LOCK_STATE_WRITE) {&lt;br /&gt;            // already locked for write &lt;br /&gt;            LOGE(&quot;handle %p already locked for write&quot;, handle);&lt;br /&gt;            return -EBUSY;&lt;br /&gt;        } else if (current_value &amp;amp; private_handle_t::LOCK_STATE_READ_MASK) {&lt;br /&gt;            // already locked for read&lt;br /&gt;            if (usage &amp;amp; (GRALLOC_USAGE_SW_WRITE_MASK | GRALLOC_USAGE_HW_RENDER)) {&lt;br /&gt;                LOGE(&quot;handle %p already locked for read&quot;, handle);&lt;br /&gt;                return -EBUSY;&lt;br /&gt;            } else {&lt;br /&gt;                // this is not an error&lt;br /&gt;                //LOGD(&quot;%p already locked for read... count = %d&quot;, &lt;br /&gt;                //        handle, (current_value &amp;amp; ~(1&amp;lt;&amp;lt;31)));&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        // not currently locked&lt;br /&gt;        if (usage &amp;amp; (GRALLOC_USAGE_SW_WRITE_MASK | GRALLOC_USAGE_HW_RENDER)) {&lt;br /&gt;            // locking for write&lt;br /&gt;            new_value |= private_handle_t::LOCK_STATE_WRITE;&lt;br /&gt;        }&lt;br /&gt;        new_value++;&lt;br /&gt;&lt;br /&gt;        retry = &lt;b&gt;android_atomic_cmpxchg&lt;/b&gt;(current_value, new_value, &lt;br /&gt;    } while (retry);&lt;br /&gt;&lt;br /&gt;    if (new_value &amp;amp; private_handle_t::LOCK_STATE_WRITE) {&lt;br /&gt;        // locking for write, store the tid&lt;br /&gt;        hnd-&amp;gt;writeOwner = gettid();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    if (usage &amp;amp; (GRALLOC_USAGE_SW_READ_MASK | GRALLOC_USAGE_SW_WRITE_MASK)) {&lt;br /&gt;        if (!(current_value &amp;amp; private_handle_t::LOCK_STATE_MAPPED)) {&lt;br /&gt;            // we need to map for real&lt;br /&gt;            pthread_mutex_t* const lock = &amp;amp;sMapLock;&lt;br /&gt;            pthread_mutex_lock(lock);&lt;br /&gt;            if (!(hnd-&amp;gt;lockState &amp;amp; private_handle_t::LOCK_STATE_MAPPED)) {&lt;br /&gt;                err = gralloc_map(module, handle, vaddr);&lt;br /&gt;                if (err == 0) {&lt;br /&gt;                    android_atomic_or(private_handle_t::LOCK_STATE_MAPPED,&lt;br /&gt;                            (volatile int32_t*)&amp;amp;(hnd-&amp;gt;lockState));&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            pthread_mutex_unlock(lock);&lt;br /&gt;        }&lt;br /&gt;        *vaddr = (void*)hnd-&amp;gt;base;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    return err;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int gralloc_unlock(gralloc_module_t const* module, &lt;br /&gt;        buffer_handle_t handle)&lt;br /&gt;{&lt;br /&gt;    if (private_handle_t::validate(handle) &amp;lt; 0)&lt;br /&gt;        return -EINVAL;&lt;br /&gt;&lt;br /&gt;    private_handle_t* hnd = (private_handle_t*)handle;&lt;br /&gt;    int32_t current_value, new_value;&lt;br /&gt;&lt;br /&gt;    do {&lt;br /&gt;        current_value = hnd-&amp;gt;lockState;&lt;br /&gt;        new_value = current_value;&lt;br /&gt;&lt;br /&gt;        if (current_value &amp;amp; private_handle_t::LOCK_STATE_WRITE) {&lt;br /&gt;            // locked for write&lt;br /&gt;            &lt;b&gt;if (hnd-&amp;gt;writeOwner == gettid()) {&lt;br /&gt;                hnd-&amp;gt;writeOwner = 0;&lt;br /&gt;                new_value &amp;amp;= ~private_handle_t::LOCK_STATE_WRITE;&lt;br /&gt;            }&lt;/b&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        if ((new_value &amp;amp; private_handle_t::LOCK_STATE_READ_MASK) == 0) {&lt;br /&gt;            LOGE(&quot;handle %p not locked&quot;, handle);&lt;br /&gt;            return -EINVAL;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        new_value--;&lt;br /&gt;&lt;br /&gt;    } while (&lt;b&gt;android_atomic_cmpxchg&lt;/b&gt;(current_value, new_value, &lt;br /&gt;            (volatile int32_t*)&amp;amp;hnd-&amp;gt;lockState));&lt;br /&gt;&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;The code looks reasonably for the first look. Lock and unlock pair looks good. However there is a very tricky part &quot;&lt;b&gt;android_atomic_cmpxchg may fail&lt;/b&gt;&quot;. Understanding this, it is not hard to see there is a potential bug in gralloc_unlock.  If android_atomic_cmpxchg fails, it will run the do while loop for more than once. However for the first run, the &lt;b&gt;hnd-&amp;gt;writeOwner will be changed to 0&lt;/b&gt;.  And then the new_value will not be changed anymore. This lock will goes crazy here after.&lt;br /&gt;&lt;br /&gt;The &lt;a href=&quot;http://www.gitorious.org/0xdroid/hardware_omap3_libgralloc/commit/2741d2b66221750bb27c692cf6615e2d42499690&quot;&gt;patch&lt;/a&gt; solves this problem.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;prettyprint&quot;&gt;diff --git a/mapper.cpp b/mapper.cpp&lt;br /&gt;index 16ebcc2..1f3e722 100644&lt;br /&gt;--- a/mapper.cpp&lt;br /&gt;+++ b/mapper.cpp&lt;br /&gt;@@ -267,13 +267,13 @@ int gralloc_unlock(gralloc_module_t const* module,&lt;br /&gt;         if (current_value &amp;amp; private_handle_t::LOCK_STATE_WRITE) {&lt;br /&gt;             // locked for write&lt;br /&gt;             if (hnd-&amp;gt;writeOwner == gettid()) {&lt;br /&gt;-                hnd-&amp;gt;writeOwner = 0;&lt;br /&gt;                 new_value &amp;amp;= ~private_handle_t::LOCK_STATE_WRITE;&lt;br /&gt;             }&lt;br /&gt;         }&lt;br /&gt; &lt;br /&gt;         if ((new_value &amp;amp; private_handle_t::LOCK_STATE_READ_MASK) == 0) {&lt;br /&gt;             LOGE(&quot;handle %p not locked&quot;, handle);&lt;br /&gt;+            hnd-&amp;gt;writeOwner = 0;&lt;br /&gt;             return -EINVAL;&lt;br /&gt;         }&lt;br /&gt; &lt;br /&gt;@@ -282,5 +282,6 @@ int gralloc_unlock(gralloc_module_t const* module,&lt;br /&gt;     } while (android_atomic_cmpxchg(current_value, new_value, &lt;br /&gt;             (volatile int32_t*)&amp;amp;hnd-&amp;gt;lockState));&lt;br /&gt; &lt;br /&gt;+    hnd-&amp;gt;writeOwner = 0;&lt;br /&gt;     return 0;&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It make sure the value hnd-&amp;gt;writeOwner is the same as the first loop, if android_atomic_cmpxchg fails. &lt;br /&gt;&lt;br /&gt;This issue comes from the original eclair source tree, and it is still&lt;a href=&quot;http://android.git.kernel.org/?p=platform/hardware/libhardware.git;a=blob;f=modules/gralloc/mapper.cpp;h=e2caf79e73b9c7e2d9cf3a7980df16156e703813;hb=HEAD#l266&quot;&gt; there&lt;/a&gt;, and had been inherited to many different platforms.  If you encounter two frames crazily flipping and having the lock message, you may try to take a look of your libgralloc.  &lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/tracker/4272939767197667332-1466910094907380095?l=linuxocarina.blogspot.com&quot; alt=&quot;&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>Tick</name>
			<email>noreply@blogger.com</email>
			<uri>http://linuxocarina.blogspot.com/search/label/0xlab</uri>
		</author>
		<source>
			<title type="html">Linux &amp;amp; Ocarina</title>
			<subtitle type="html">Tick's personal blog. According what he saw, what he was thinking about, and some geek stuff. 

Articles may be written in English or Chinese. 

Have fun. :)</subtitle>
			<link rel="self" href="http://www.blogger.com/feeds/4272939767197667332/posts/default/-/0xlab"/>
			<id>tag:blogger.com,1999:blog-4272939767197667332</id>
		</source>
	</entry>

</feed>

