<?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>Katastrophos.net Blog &#187; Gadgets</title> <atom:link href="http://katastrophos.net/andre/blog/tag/gadgets/feed/" rel="self" type="application/rss+xml" /><link>http://katastrophos.net/andre/blog</link> <description>Chaotic solutions and random thoughts from the restless mind of a notorious problem solver (TM), by Andre Beckedorf</description> <lastBuildDate>Sat, 17 Jul 2010 16:23:20 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0</generator> <item><title>QScrobbler</title><link>http://katastrophos.net/andre/blog/2007/12/24/qscrobbler/</link> <comments>http://katastrophos.net/andre/blog/2007/12/24/qscrobbler/#comments</comments> <pubDate>Mon, 24 Dec 2007 15:44:59 +0000</pubDate> <dc:creator>Andre Beckedorf</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Gadgets]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Quasar Media Player]]></category> <category><![CDATA[Zaurus]]></category><guid
isPermaLink="false">http://katastrophos.net/andre/blog/2007/12/24/qscrobbler/</guid> <description><![CDATA[Today I&#8217;m releasing QScrobbler: a Last.fm / Audioscrobbler add-on for Quasar Media Player. As with Quasar, I&#8217;ve been using QScrobbler for almost a year now and finally decided it is ready for the public. ;) For more details please visit the project&#8217;s homepage here.]]></description> <content:encoded><![CDATA[<p><a
href="http://katastrophos.net/qscrobbler"><img
src="http://www.katastrophos.net/zaurus/sources/qscrobbler/qscrobbler_logo.png" class="noframe" border="0" style="border: none" alt="QScrobbler" /></a></p><p>Today I&#8217;m releasing <a
href="http://katastrophos.net/qscrobbler">QScrobbler</a>: a <a
href="http://www.last.fm" target="_blank">Last.fm / Audioscrobbler</a> add-on for <a
href="http://katastrophos.net/quasar" target="_blank">Quasar Media Player</a>.</p><p>As with Quasar, I&#8217;ve been using QScrobbler for almost a year now and finally decided it is ready for the public. ;)<br
/> For more details please visit the project&#8217;s homepage <a
href="http://katastrophos.net/qscrobbler">here</a>.</p> ]]></content:encoded> <wfw:commentRss>http://katastrophos.net/andre/blog/2007/12/24/qscrobbler/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Quasar Media Player</title><link>http://katastrophos.net/andre/blog/2007/10/06/quasar-media-player/</link> <comments>http://katastrophos.net/andre/blog/2007/10/06/quasar-media-player/#comments</comments> <pubDate>Sat, 06 Oct 2007 17:10:14 +0000</pubDate> <dc:creator>Andre Beckedorf</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[Gadgets]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Quasar Media Player]]></category> <category><![CDATA[Zaurus]]></category><guid
isPermaLink="false">http://katastrophos.net/andre/blog/2007/10/06/quasar-media-player/</guid> <description><![CDATA[Finally! Almost a year after the first mentioning of my new media player for the Sharp Zaurus and after several development hiati, I&#8217;m today officially releasing the Quasar Media Player for SharpROM- and pdaXrom-based distributions. For more details please visit the project&#8217;s homepage here.]]></description> <content:encoded><![CDATA[<p><a
href="http://katastrophos.net/quasar"><img
src="http://katastrophos.net/zaurus/sources/quasar/quasar_logo.png" class="noframe" border="0" style="border: none" alt="Quasar Media Player" /></a></p><p>Finally! Almost a year after <a
href="http://katastrophos.net/andre/blog/2006/12/19/yet-another-zaurus-media-player-done-differently-phase-1-teasing/">the first mentioning</a> of my new media player for the Sharp Zaurus and after several development hiati, I&#8217;m today officially releasing the Quasar Media Player for SharpROM- and pdaXrom-based distributions.<br
/> For more details please visit the project&#8217;s homepage <a
href="http://katastrophos.net/quasar">here</a>.</p> ]]></content:encoded> <wfw:commentRss>http://katastrophos.net/andre/blog/2007/10/06/quasar-media-player/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Enhanced audio driver for Zaurus SL-C1000/C3x00 available</title><link>http://katastrophos.net/andre/blog/2007/08/09/enhanced-mixer-for-zaurus-sl-c1000c3x00-available/</link> <comments>http://katastrophos.net/andre/blog/2007/08/09/enhanced-mixer-for-zaurus-sl-c1000c3x00-available/#comments</comments> <pubDate>Wed, 08 Aug 2007 22:43:16 +0000</pubDate> <dc:creator>Andre Beckedorf</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Gadgets]]></category> <category><![CDATA[Hack]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Zaurus]]></category><guid
isPermaLink="false">http://katastrophos.net/andre/blog/2007/08/09/enhanced-mixer-for-zaurus-sl-c1000c3x00-available/</guid> <description><![CDATA[Today I&#8217;m officially releasing my extended driver and mixer for the Wolfson WM8750 CODEC / sound chip that comes included in the latest Zaurus models. The driver exposes the following new features: ability to set and control Treble, Bass and 3D stereo sound enhancement; ability to set and control various cut-off frequencies supported by the [...]]]></description> <content:encoded><![CDATA[<p>Today I&#8217;m officially releasing my extended driver and mixer for the <a
href="http://www.wolfsonmicro.com/products/WM8750/" target="_blank">Wolfson WM8750</a> CODEC / sound chip that comes included in the latest Zaurus models.<br
/> The driver exposes the following new features:</p><ul><li>ability to set and control Treble, Bass and 3D stereo sound enhancement;</li><li>ability to set and control various cut-off frequencies supported by the sound chip;</li><li>output source selection (Autodetect, Internal Speaker, Headphone).</li></ul><p>These features can be easily accessed via a Qt based mixer control app or directly via a /proc/driver/wm8750 kernel interface.</p><p><center><a
href="http://katastrophos.net/andre/blog/wp-content/photos/wm8750mixer/wm8750mixer_pdaxrom_screenshot.png" target="_blank" title="{wm8750mixer} WM8750 mixer control app running on pdaXii13 and X11." rel="lightbox[62]"><img
src="http://katastrophos.net/andre/blog/wp-content/photos/wm8750mixer/thumb_wm8750mixer_pdaxrom_screenshot.png" alt="{wm8750mixer} WM8750 mixer control app running on pdaXii13 and X11." width="130" height="97" /></a><a
href="http://katastrophos.net/andre/blog/wp-content/photos/wm8750mixer/wm8750mixer_sharprom_screenshot.png" target="_blank" title="{wm8750mixer} WM8750 mixer control app running on Cacko ROM and Qtopia." rel="lightbox[62]"><img
src="http://katastrophos.net/andre/blog/wp-content/photos/wm8750mixer/thumb_wm8750mixer_sharprom_screenshot.png" alt="{wm8750mixer} WM8750 mixer control app running on Cacko ROM and Qtopia." width="130" height="97" /></a></center></p><p>Both, the driver and the control app are <strong>available for Sharp ROM / Cacko ROM</strong> and <strong>pdaXrom beta 3 / pdaXii13</strong>.</p><p><strong>Kernel patches are available for Sharp&#8217;s Linux kernel 2.4.20 and can be downloaded here:</strong><br
/> <a
href="http://www.katastrophos.net/zaurus/sources/wm8750mixer/" target="_blank">http://www.katastrophos.net/zaurus/sources/wm8750mixer/</a><br
/> (No kernel 2.6.x support yet. Sorry folks.)</p><p>By default the audio driver is compiled into the kernel. Sharp didn&#8217;t compile it as module, so it can&#8217;t be easily replaced. Same goes for most third party ROMs. <strong>You&#8217;ll have to reflash your kernel to install the new driver.</strong><br
/> In case you don&#8217;t want to roll your own kernel, <strong>I&#8217;ve made pre-compiled kernels available for all supported ROMs and models here</strong>:</p><p><a
href="http://www.katastrophos.net/zaurus/kernels/v55/" target="_blank">http://www.katastrophos.net/zaurus/kernels/v55/</a></p><p>The control app and start up scripts are available as IPK here:</p><p><a
class="downloadlink" href="http://www.katastrophos.net/zaurus/sources/wm8750mixer/bin_sharprom/wm8750mixer_0.9_arm.ipk">wm8750mixer_0.9_arm.ipk &#8211; <strong>WM8750 mixer for Sharp ROM / Cacko ROM</strong></a><br
/> <a
class="downloadlink" href="http://www.katastrophos.net/zaurus/sources/wm8750mixer/bin_pdaxrom/wm8750mixer_0.92_armv5tel.ipk">wm8750mixer_0.92_armv5tel.ipk &#8211; <strong>WM8750 mixer for pdaXrom beta 3 / pdaXii13</strong></a></p><p>On a side note, we&#8217;ve been discussing the extended features of the WM8750 audio chip for quite some while in this <a
href="http://www.oesf.org/forums/index.php?showtopic=23984&#038;st=0" target="_blank">thread</a> over at the OESF forums. I have the feeling the driver and the Qt application have received a fair bit of testing. So, that&#8217;s why I am officially releasing it today.</p> ]]></content:encoded> <wfw:commentRss>http://katastrophos.net/andre/blog/2007/08/09/enhanced-mixer-for-zaurus-sl-c1000c3x00-available/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>“Yet Another Zaurus Media Player”… not dead yet: &#8220;Quasar Media Player&#8221;</title><link>http://katastrophos.net/andre/blog/2007/07/28/%e2%80%9cyet-another-zaurus-media-player%e2%80%9d%e2%80%a6-not-dead-yet-quasar-media-player/</link> <comments>http://katastrophos.net/andre/blog/2007/07/28/%e2%80%9cyet-another-zaurus-media-player%e2%80%9d%e2%80%a6-not-dead-yet-quasar-media-player/#comments</comments> <pubDate>Sat, 28 Jul 2007 21:07:33 +0000</pubDate> <dc:creator>Andre Beckedorf</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Gadgets]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Quasar Media Player]]></category> <category><![CDATA[Random]]></category> <category><![CDATA[Zaurus]]></category><guid
isPermaLink="false">http://katastrophos.net/andre/blog/2007/07/28/%e2%80%9cyet-another-zaurus-media-player%e2%80%9d%e2%80%a6-not-dead-yet-quasar-media-player/</guid> <description><![CDATA[Alright, this blog has been very quiet for the last few months. That&#8217;s partially due to me being very busy with other stuff. I&#8217;m slowly picking up pace and getting things done again. So, here is a short update on the media player that I&#8217;m currently developing for my Zaurus. Well, actually it&#8217;s been in [...]]]></description> <content:encoded><![CDATA[<p>Alright, this blog has been very quiet for the last few months. That&#8217;s partially due to me being very busy with other stuff.<br
/> I&#8217;m slowly picking up pace and getting things done again.</p><p>So, here is a short update on the media player that I&#8217;m currently developing for my Zaurus. Well, actually it&#8217;s been in long-term testing mode for ages now&#8230; :)<br
/> I finally have a name for it. It will be called &#8220;Quasar Media Player&#8221; &#8211; or shorter &#8220;Quasar&#8221;. Below are some screenshots of the current development version running on Qtopia. I hope to have a release ready soon.</p><p><a
href="http://katastrophos.net/andre/blog/wp-content/photos/Quasar/quasar001.png" target="_blank" title="{Quasar} Shown is the new toolbar and play list selector." rel="lightbox[61]"><img
src="http://katastrophos.net/andre/blog/wp-content/photos/Quasar/thumb_quasar001.png" alt="{Quasar} Shown is the new toolbar and play list selector." width="130" height="97" /></a><a
href="http://katastrophos.net/andre/blog/wp-content/photos/Quasar/quasar002.png" target="_blank" title="{Quasar} The new play info screen. Cover art is supported and rendered in this funky view. Any Satch fans out there? ;)" rel="lightbox[61]"><img
src="http://katastrophos.net/andre/blog/wp-content/photos/Quasar/thumb_quasar002.png" alt="{Quasar} The new play info screen. Cover art is supported and rendered in this funky view. Any Satch fans out there? ;)" width="130" height="97" /></a><a
href="http://katastrophos.net/andre/blog/wp-content/photos/Quasar/quasar003.png" target="_blank" title="{Quasar} More eyecandy." rel="lightbox[61]"><img
src="http://katastrophos.net/andre/blog/wp-content/photos/Quasar/thumb_quasar003.png" alt="{Quasar} More eyecandy." width="130" height="97" /></a><a
href="http://katastrophos.net/andre/blog/wp-content/photos/Quasar/quasar004.png" target="_blank" title="{Quasar} Normal list view filtered." rel="lightbox[61]"><img
src="http://katastrophos.net/andre/blog/wp-content/photos/Quasar/thumb_quasar004.png" alt="{Quasar} Normal list view filtered." width="130" height="97" /></a></p> ]]></content:encoded> <wfw:commentRss>http://katastrophos.net/andre/blog/2007/07/28/%e2%80%9cyet-another-zaurus-media-player%e2%80%9d%e2%80%a6-not-dead-yet-quasar-media-player/feed/</wfw:commentRss> <slash:comments>22</slash:comments> </item> <item><title>“Yet Another Zaurus Media Player”… done differently . (Phase 2.1: Development progress 2)</title><link>http://katastrophos.net/andre/blog/2007/01/06/%e2%80%9cyet-another-zaurus-media-player%e2%80%9d%e2%80%a6-done-differently-phase-21-development-progress-2/</link> <comments>http://katastrophos.net/andre/blog/2007/01/06/%e2%80%9cyet-another-zaurus-media-player%e2%80%9d%e2%80%a6-done-differently-phase-21-development-progress-2/#comments</comments> <pubDate>Sat, 06 Jan 2007 03:48:38 +0000</pubDate> <dc:creator>Andre Beckedorf</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Gadgets]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Quasar Media Player]]></category> <category><![CDATA[Random]]></category> <category><![CDATA[Zaurus]]></category><guid
isPermaLink="false">http://katastrophos.net/andre/blog/2007/01/06/%e2%80%9cyet-another-zaurus-media-player%e2%80%9d%e2%80%a6-done-differently-phase-21-development-progress-2/</guid> <description><![CDATA[Yet another short update on the development of my still untitled media player for the Zaurus. In the meantime it&#8217;s called YAZMP. Again, I&#8217;ve been working on improving performance &#8211; this time on the performance when loading playlists. Before I continue, let me give a brief overview of the structure: Library -> Playlists < -> [...]]]></description> <content:encoded><![CDATA[<p>Yet another short update on the development of my <em>still untitled</em> media player for the Zaurus. In the meantime it&#8217;s called YAZMP.</p><p>Again, I&#8217;ve been working on improving performance &#8211; this time on the performance when loading playlists.<br
/> Before I continue, let me give a brief overview of the structure:</p><p><strong><strike>Library</strike> -> Playlists < -> Media Cache</strong></p><p>YAZMP doesn&#8217;t manage a library similar to i*Tunes. Instead it solely relies on playlists. Metadata (title, artist, album, etc.) is kept in the database and will be associated to once the playlist is loaded. The reason for this is pretty simple: Scanning audio files (and media files in general) each and every time a playlist is loaded will definitely take a lot of time. So, for every file the gathered metadata will be saved in the DB. Think of it as a cache.<br
/> <span
id="more-58"></span><br
/> <a
href="http://atty.skr.jp/zplayer/" target="_blank">ZPlayer</a>, which YAZMP is based on, follows a similar approach. However, in my opinion it&#8217;s ill-conceived in the current version. It keeps the media cache in memory all the time. With lots of files this can get very expensive. Also, ZPlayer isn&#8217;t very efficient at saving the media cache to disk. It does so for the whole cache, not just changed entries. Furthermore, when saving the cache on quitting, ZPlayer sometimes simply truncates the cache file and all metadata is lost. So, next time you open it, it has to scan all files again&#8230;<br
/> Perhaps I&#8217;m nitpicking, perhaps I&#8217;m an optimization dork, whatever it is, please forgive my harsh words for the otherwise excellent work atty and Atmark have done in ZPlayer!</p><p><strong>Technical ramblings</strong></p><p>For YAZMP I rewrote the metadata cache management from scratch and extended it to do a lot more.<br
/> As I already mentioned above, YAZMP doesn&#8217;t manage any library, it only knows about filenames in playlist files.<br
/> For that to work correctly and efficient especially in combination with the media cache, there are four cases that need to be taken care of:</p><ol><li><strong>A new file has been added to the playlist which doesn&#8217;t exist in the media cache.</strong><br
/> This case is very simple: The player has to scan the file no matter what.</li><li><strong>A file has been physically removed and it&#8217;s metadata is still in the cache.</strong><br
/> In this case the player has junk entries in its database, which need to be cleaned once in a while.</li><li><strong>A file has been renamed, that is, it&#8217;s basename changed</strong></li><li><strong>A file or a whole directory / sub-tree of files have moved to another location.</strong><br
/> In a naive implementation both cases would trigger a lengthy rescan of the file(s) that are about to be added in the playlist, because new location can&#8217;t be associated with any data in the cache.<br
/> For YAZMP I&#8217;ll use several approaches + fallbacks to try to limit the impact. The following messy pseudo-code illustrates this:</p><pre>
  <strong>get attributes</strong> <em>filename</em>, <em>directory</em> <strong> from current playlist item to be added</strong>
  <strong>get attributes</strong> <em>filesize</em>, <em>lastmoddate</em> <strong>for file</strong> (<em>directory</em> + <em>filename</em>)

  <font color="#080">// NOTE: check via checksum / hash for faster lookup</font>
  <strong>if exactly one</strong> entry <strong>by hash value of</strong> (<em>directory</em> + <em>filename</em>) <strong>in DB then</strong>
    <font color="#080">// NOTE: did the file change since the last scan?</font>
    <strong>if</strong> entry.filesize <strong>not equal</strong> <em>filesize</em> <strong>or</strong> entry.lastmoddate <strong>not equal</strong> <em>lastmoddate</em> <strong>in FS then</strong>
      <strong>rescan file</strong> (<em>directory</em> + <em>filename</em>) <strong>and update</strong> entry <strong>in DB</strong>
    <strong>return</strong> entry
  <strong>else if exactly one</strong> entry <strong>by tuple of</strong> (<em>filename</em>, <em>filesize</em>, <em>lastmoddate</em>) <strong>in DB then</strong>
    <font color="#080">// Was the file moved to a new directory? (case 4)
    // If so, check for other files in the old directory and change them
    // to the new location...
    // NOTE: this is purely predictive. It might not always yield a benefit.</font>
    <strong>if directory by value of</strong> entry.location <strong>not in FS then</strong>
      <strong>change every</strong> siblingentry <strong>in DB where</strong> siblingentry.location <strong>is</strong> entry.location
        <strong>set</strong> siblingentry.location to <em>directory</em>
        <strong>set</strong> siblingentry.locationHash <strong>to hash value of</strong> (<em>directory</em> + siblingentry.filename)
      <strong>until no</strong> siblingentry <strong>is left</strong>
    <font color="#080">// NOTE: did the file change since the last scan?</font>
    <strong>if</strong> entry.filesize <strong>not equal</strong> <em>filesize</em> <strong>or</strong> entry.lastmoddate <strong>not equal</strong> <em>lastmoddate</em> <strong>in FS then</strong>
      <strong>rescan file</strong> (<em>directory</em> + <em>filename</em>) <strong>and update</strong> entry <strong>in DB</strong>
    <strong>return</strong> entry
  <font color="#080">// NOTE: For case 3 one could check for a smaller tuple of (filesize, lastmoddate)</font>
  <font color="#080">// which would result in the almost the same code as above</font>
  <font color="#080">// The likeness of wrong results is a lot higher though.</font>
  <strong>else</strong>
    <strong>scan file</strong> (<em>directory</em> + <em>filename</em>) <strong>as</strong> newentry <strong>and add</strong> newentry <strong>to DB</strong>
    <strong>return</strong> newentry
</pre></li></ol><p><strong>Conclusion</strong></p><p>What that means is pretty simple: You can move your media files to a different location, perhaps a SD-Card, and the player will still be able to associate the new location in the playlist file with the data it has in cache. And that means: No useless scanning of files and fast playlist load times.</p><p><strong>Yet another feature&#8230;</strong></p><p>I tend to copy several albums to my Zaurus for listening on the road. So, once I&#8217;ve copied new stuff, it&#8217;s always the same mindless and inconvenient procedure in most players: Clear the playlist, add files or directories, play stuff.<br
/> And that brings me straight to another new feature: Dynamic Playlists<br
/> In general the idea is pretty simple: Instead of just listing every file&#8217;s location in a playlist file, one may also list folders that are automatically scanned for audio or video files. Here is an example:</p><p>Music.dynplaylist</p><pre>
/hdd3/Music/test1.mp3
/mnt/card/Music/Mozart/
/hdd3/Music/Beethoven/**
</pre><p>This will add a single file &#8220;test1.mp3&#8243;, all files in &#8220;/mnt/card/Music/Mozart/&#8221; and all files in &#8220;/hdd3/Music/Beethoven/&#8221; including all files in its sub-directories.</p><p><strong>Conclusion</strong></p><p>Instead of adding files, you just define what the layout of the playlist should look like and the player does the rest automatically. It can even rescan for changes. It&#8217;s all wrapped up in a nice UI.<br
/> Combined with the flexibility of the metadata cache and the fact that one isn&#8217;t forced into this library thing, I think this makes for a pretty unique solution. What do you think?</p> ]]></content:encoded> <wfw:commentRss>http://katastrophos.net/andre/blog/2007/01/06/%e2%80%9cyet-another-zaurus-media-player%e2%80%9d%e2%80%a6-done-differently-phase-21-development-progress-2/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>SQLite performance tuning and optimization on embedded systems</title><link>http://katastrophos.net/andre/blog/2007/01/04/sqlite-performance-tuning-and-optimization-on-embedded-systems/</link> <comments>http://katastrophos.net/andre/blog/2007/01/04/sqlite-performance-tuning-and-optimization-on-embedded-systems/#comments</comments> <pubDate>Thu, 04 Jan 2007 06:28:10 +0000</pubDate> <dc:creator>Andre Beckedorf</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Gadgets]]></category> <category><![CDATA[Quasar Media Player]]></category> <category><![CDATA[Random]]></category> <category><![CDATA[Zaurus]]></category><guid
isPermaLink="false">http://katastrophos.net/andre/blog/2007/01/04/sqlite-performance-tuning-and-optimization-on-embedded-systems/</guid> <description><![CDATA[Based on the experience I gained while developing my Zaurus media player, here is a short compendium of optimization rules, tweaks and hints when using SQLite on an embedded system (may apply to other systems as well): Simplify the database schema as much as possible &#8211; even if that means redundant data or illogical structure [...]]]></description> <content:encoded><![CDATA[<p>Based on the experience I gained while <a
href="http://www.katastrophos.net/andre/blog/index.php?s=Yet+Another+Zaurus+Media+Player" target="_blank">developing my Zaurus media player</a>, here is a short compendium of optimization rules, tweaks and hints when using <a
href="http://www.sqlite.org" target="_blank">SQLite</a> <strong>on an embedded system</strong> (may apply to other systems as well):</p><ul><li><strong>Simplify the database schema</strong> as much as possible &#8211; even if that means redundant data or illogical structure</li><li><strong>Don&#8217;t generalize the database schema</strong> &#8211; generalization will mostly sacrifice performance and one can&#8217;t afford that on an embedded system with its tight restrictions, even if it is more convenient for the developer.</li><li><strong>Only use relations</strong> (via IDs etc.) <strong>where absolutely necessary</strong>. The overhead for lookup and joining tables is considerable, even with an index on the relation.</li><li><strong>Order the tables correctly in SELECTs</strong>. Put a table left-most if it is lacking an index on the relation. More details are <a
href="http://www.sqlite.org/cvstrac/wiki?p=PerformanceTuning" target="_blank">here.</a><br
/> <strong>In general:</strong> Check the order of tables in the SELECT statement. <strong>A different permutation may be more optimal</strong>. <strong><a
href="http://katastrophos.net/andre/blog/2007/01/04/sqlite-simple-timing-profiler-patch/" target="_blank">Profile</a>.</strong></li><li><strong>Prepare your statements and bind values</strong> where applicable. This way you can get rid of the parser and VM creation overhead in tight loops (e.g. when inserting and updating).</li><li><strong>Use transactions</strong> &#8211; even if you&#8217;re just reading the data. This may yield a few milliseconds.</li><li><strong>Use temporary tables for intermediate results</strong>. They are fast and stay in cache most of the time. Depending on how your SQLite instance is set up, data will only be swapped into an external file if the cache is saturated.</li><li>Try to <strong>avoid using views</strong> for data you&#8217;re constantly accessing. If you can afford it, create temporary tables and insert data there. This will eliminate the overhead imposed by the view evaluation.</li><li><strong>Avoid sub-queries</strong> since they tend to create temporary tables and insertion of the intermediate results into those tables may be expensive.</li><li>Try to <strong>use indices only on static data</strong> or data that changes rarely. Building an index on live or temporary data can be expensive performance-wise. Only do so if the time required for the data lookup considerably outweights the time required for building the index.</li><li><strong>Alternative to indices: hashkeys</strong> &#8211; Instead of using indices on very long strings, you may store the hash values of those strings as keys in the same table. A lookup via hash values may be a whole lot more efficient. This method is also very effective when you can&#8217;t afford the creation of an index due to performance reasons. Downside: You have to take care of the hashkeys. (See remarks in the comments below.)</li><li><strong>No useless indices</strong>. Create indices only if your queries actually use the indices on the table (check with <a
href="http://www.sqlite.org/lang_explain.html" target="_blank">EXPLAIN</a>). Having useless indices around may pollute otherwise precious database cache space.</li><li><strong>Be cache-friendly</strong>. Depending on the memory conditions, creating temporary tables and indices may bash the cache. Reloading data back into the cache is expensive.</li><li><strong>Double-check your queries and <a
href="http://katastrophos.net/andre/blog/2007/01/04/sqlite-simple-timing-profiler-patch/" target="_blank">profile them</a></strong>. The SQLite optimizer doesn&#8217;t perform as well as the optimizers of big DBs (Firebird / Interbase, PostgreSQL, Oracle etc.).</li><li><strong>Check compiler settings</strong>. A higher optimization setting in your C-compiler may very well yield a few tens of milliseconds. Make sure to inline functions (-O3 for GCC 2.95.x, -O2 for GCC 3.x.x and higher). Optimize for architecture and CPU. Omit stack frame pointers (-fomit-frame-pointer) if you&#8217;re not producing executables with debug symbols. This may free an additional register for the compiler to use.</li><li><strong>Disable unused SQLite features</strong>. This helps to reduce binary size and may also affect performance.</li></ul><p>Here are some additional docs to consider:</p><p><a
href="http://www.sqlite.org/cvstrac/wiki?p=PerformanceTuning" target="_blank">http://www.sqlite.org/cvstrac/wiki?p=PerformanceTuning</a><br
/> <a
href="http://www.sqlite.org/cvstrac/wiki?p=PerformanceTuningWindows" target="_blank">http://www.sqlite.org/cvstrac/wiki?p=PerformanceTuningWindows</a><br
/> <a
href="http://www.sqlite.org/cvstrac/wiki?p=PerformanceConsiderations" target="_blank">http://www.sqlite.org/cvstrac/wiki?p=PerformanceConsiderations</a><br
/> <a
href="http://www.sqlite.org/optoverview.html" target="_blank">http://www.sqlite.org/optoverview.html</a><br
/> <a
href="http://web.utk.edu/~jplyon/sqlite/SQLite_optimization_FAQ.html" target="_blank">http://web.utk.edu/~jplyon/sqlite/SQLite_optimization_FAQ.html</a></p> ]]></content:encoded> <wfw:commentRss>http://katastrophos.net/andre/blog/2007/01/04/sqlite-performance-tuning-and-optimization-on-embedded-systems/feed/</wfw:commentRss> <slash:comments>9</slash:comments> </item> <item><title>“Yet Another Zaurus Media Player”… done differently . (Phase 2: Development progress, no release yet.)</title><link>http://katastrophos.net/andre/blog/2007/01/04/%e2%80%9cyet-another-zaurus-media-player%e2%80%9d%e2%80%a6-done-differently-phase-2-development-progress-no-release-yet/</link> <comments>http://katastrophos.net/andre/blog/2007/01/04/%e2%80%9cyet-another-zaurus-media-player%e2%80%9d%e2%80%a6-done-differently-phase-2-development-progress-no-release-yet/#comments</comments> <pubDate>Thu, 04 Jan 2007 04:40:47 +0000</pubDate> <dc:creator>Andre Beckedorf</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Gadgets]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Quasar Media Player]]></category> <category><![CDATA[Random]]></category> <category><![CDATA[Zaurus]]></category><guid
isPermaLink="false">http://katastrophos.net/andre/blog/2007/01/04/%e2%80%9cyet-another-zaurus-media-player%e2%80%9d%e2%80%a6-done-differently-phase-2-development-progress-no-release-yet/</guid> <description><![CDATA[So, like I&#8217;ve already mentioned in my previous comment, I&#8217;ve got some free time to work on my pet project here. Development progress I&#8217;ve been optimizing a lot under the hood. Tons of blood, sweat and tears have already run into optimizing the core parts. Coming from a different background in programming, namely a desktop [...]]]></description> <content:encoded><![CDATA[<p>So, like I&#8217;ve already mentioned in <a
href="http://katastrophos.net/andre/blog/2006/12/19/yet-another-zaurus-media-player-done-differently-phase-1-teasing/#comment-2356" target="_blank">my previous comment</a>, I&#8217;ve got some free time to work on <a
href="http://katastrophos.net/andre/blog/2006/12/19/yet-another-zaurus-media-player-done-differently-phase-1-teasing/" target="_blank">my pet project</a> here.</p><p><strong>Development progress</strong></p><p>I&#8217;ve been optimizing a lot under the hood. Tons of blood, sweat and tears have already run into optimizing the core parts.<br
/> Coming from a different background in programming, namely a desktop background, doing embedded development is a whole new experience for me. And let me say this: it&#8217;s definitely a refreshing one.<br
/> Development for embedded devices can be quite challenging if you have hard memory limitations and performance restrictions CPU-wise. These limitations go even further than the ones I&#8217;m used to when doing component or graphics development. And I&#8217;m doing quite a lot of that&#8230;</p><p>Just so you get the idea:<br
/> <em>My essential requirement for this project is that the player is able to cope with thousands of files in a playlist.</em></p><p>With that being said, I&#8217;ve already rewritten the playlist management four times. :)<br
/> The first approach was fast but ate RAM for breakfast. Incremental searching on a playlist was fast but also required additional memory. The second approach was more memory-friendly, but searching was slow. Besides, some Qt widgets make development a real pain &#8211; at least in Qt/E 2.3.x. For instance, QListView can pose an incredible hog on performance. I&#8217;m currently using several hacks to speed things up. However, I&#8217;m still thinking about replacing the whole component or doing some custom coding to improve it&#8230;</p><p>Anyway, since I couldn&#8217;t really get rid of the memory problems, I finally decided to give <a
href="http://www.sqlite.org" target="_blank">SQLite</a> a try. SQLite offers very sophisticated caching, which helps getting rid of the RAM problem. I really could use the enhanced features of a SQL database. And let me say this: SQLite is awesome. And it&#8217;s as fast as it could be on such a small device &#8211; that is, if you know how to use it&#8230;</p><p>With that being said, different rules in database design apply for embedded systems:<br
/> In the third approach I already created a pretty decent database schema. Something I naturally would have done on a desktop system. Keeping the layout clean, using relations where applicable, minimizing data storage requirements.<br
/> On a desktop system dereferencing and joining tables is fast. However, not so on my Zaurus: Simple left-joins over three tables would take up to a few hundred milliseconds. In contrast, these queries are almost unmeasurable on my desktop system, meaning they were faster than 10 ms.<br
/> Now add a few other equally expensive queries to that and imagine, you&#8217;re doing a search on your playlist with 2000 items. Do you want to wait 3 seconds or longer for the result? That&#8217;s not what I call interactive.<br
/> So, I had a nice profiling, optimizing and testing marathon last weekend. To make a long story short, after analyzing the bottlenecks and also having a lengthy discussion with a DB-guru friend, I ended up simplifying the database schema in a direction I wouldn&#8217;t normally take on a desktop system. It&#8217;s not totally ugly now, but it&#8217;s just not as relational as you might expect a SQL database to be. Also, some data is redundantly held in temporary tables, which isn&#8217;t nice either, but helps performance A LOT.<br
/> In order to do the profiling I made some changes to the SQLite codebase, which I will post shortly along with some optimization hints. <strong>Update:</strong> Hints <a
href="http://katastrophos.net/andre/blog/2007/01/04/sqlite-performance-tuning-and-optimization-on-embedded-systems/" target="_blank">here</a>, patch <a
href="http://katastrophos.net/andre/blog/2007/01/04/sqlite-simple-timing-profiler-patch/" target="_blank">here</a>.</p><p><strong>Screenshots</strong></p><p>No release yet, sorry! I have to finalize some features first.<br
/> However, here are some new screenshots that show the new overview feature in action. The design of the application is temporary, stay tuned! :)</p><p><a
href="http://katastrophos.net/andre/blog/wp-content/photos/ZeQueMP/screen1004.png" target="_blank" title="{YAZMPDD} YAZMPDD - Work In Progress Screenshot 4: Overview feature with multi-selection in action." rel="lightbox[55]"><img
src="http://katastrophos.net/andre/blog/wp-content/photos/ZeQueMP/thumb_screen1004.png" alt="{YAZMPDD} YAZMPDD - Work In Progress Screenshot 4: Overview feature with multi-selection in action." width="130" height="97" /></a><a
href="http://katastrophos.net/andre/blog/wp-content/photos/ZeQueMP/screen1005.png" target="_blank" title="{YAZMPDD} YAZMPDD - Work In Progress Screenshot 5: Search filter + Overview filter" rel="lightbox[55]"><img
src="http://katastrophos.net/andre/blog/wp-content/photos/ZeQueMP/thumb_screen1005.png" alt="{YAZMPDD} YAZMPDD - Work In Progress Screenshot 5: Search filter + Overview filter" width="130" height="97" /></a><a
href="http://katastrophos.net/andre/blog/wp-content/photos/ZeQueMP/screen1006.png" target="_blank" title="{YAZMPDD} YAZMPDD - Work In Progress Screenshot 6: Portrait window mode. Note: This is the contrast skin, which will change in the future." rel="lightbox[55]"><img
src="http://katastrophos.net/andre/blog/wp-content/photos/ZeQueMP/thumb_screen1006.png" alt="{YAZMPDD} YAZMPDD - Work In Progress Screenshot 6: Portrait window mode. Note: This is the contrast skin, which will change in the future." width="97" height="130" /></a></p> ]]></content:encoded> <wfw:commentRss>http://katastrophos.net/andre/blog/2007/01/04/%e2%80%9cyet-another-zaurus-media-player%e2%80%9d%e2%80%a6-done-differently-phase-2-development-progress-no-release-yet/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>&#8220;Yet Another Zaurus Media Player&#8221;&#8230; done differently . (Phase 1: Teasing)</title><link>http://katastrophos.net/andre/blog/2006/12/19/yet-another-zaurus-media-player-done-differently-phase-1-teasing/</link> <comments>http://katastrophos.net/andre/blog/2006/12/19/yet-another-zaurus-media-player-done-differently-phase-1-teasing/#comments</comments> <pubDate>Tue, 19 Dec 2006 00:37:38 +0000</pubDate> <dc:creator>Andre Beckedorf</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Gadgets]]></category> <category><![CDATA[Quasar Media Player]]></category> <category><![CDATA[Zaurus]]></category><guid
isPermaLink="false">http://katastrophos.net/andre/blog/2006/12/19/yet-another-zaurus-media-player-done-differently-phase-1-teasing/</guid> <description><![CDATA[Tell me what you think. I won&#8217;t comment on anything though. This is work in progress &#8211; it&#8217;s not finished. I won&#8217;t publish any additional features besides what you can read below. Here is the information I can give right now: Yes, this is derived from ZPlayer, however, the core is different. Right now, please [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://katastrophos.net/andre/blog/wp-content/photos/ZeQueMP/screen1001.png" target="_blank" title="{YAZMPDD} YAZMPDD - Work In Progress Screenshot 1: Whole library loaded. Contrast mode, perfect for car usage." rel="lightbox[54]"><img
src="http://katastrophos.net/andre/blog/wp-content/photos/ZeQueMP/thumb_screen1001.png" alt="{YAZMPDD} YAZMPDD - Work In Progress Screenshot 1: Whole library loaded. Contrast mode, perfect for car usage." width="130" height="97" /></a><a
href="http://katastrophos.net/andre/blog/wp-content/photos/ZeQueMP/screen1002.png" target="_blank" title="{YAZMPDD} YAZMPDD - Work In Progress Screenshot 2: Playing a file..." rel="lightbox[54]"><img
src="http://katastrophos.net/andre/blog/wp-content/photos/ZeQueMP/thumb_screen1002.png" alt="{YAZMPDD} YAZMPDD - Work In Progress Screenshot 2: Playing a file..." width="130" height="97" /></a><a
href="http://katastrophos.net/andre/blog/wp-content/photos/ZeQueMP/screen1003.png" target="_blank" title="{YAZMPDD} YAZMPDD - Work In Progress Screenshot 3: Library view filtered..." rel="lightbox[54]"><img
src="http://katastrophos.net/andre/blog/wp-content/photos/ZeQueMP/thumb_screen1003.png" alt="{YAZMPDD} YAZMPDD - Work In Progress Screenshot 3: Library view filtered..." width="130" height="97" /></a></p><p>Tell me what you think. I won&#8217;t comment on anything though. This is work in progress &#8211; it&#8217;s not finished. I won&#8217;t publish any additional features besides what you can read below.</p><p>Here is the information I can give right now:<br
/> Yes, this is derived from ZPlayer, however, the core is different. Right now, please don&#8217;t ask any question why I&#8217;m not contributing to Kino or ZPlayer. This is a whole different thing here and I&#8217;ll comment once I release.</p><p>Does it handle large amounts of music? YES.<br
/> Are you serious about the *Tunes look? YES.<br
/> Is that fullscreen? Yes.<br
/> What&#8217;s the name? No title yet. If you have a good one, don&#8217;t hesitate to mail me.</p><p>In the meantime wait for more information and the next phase&#8230; :)</p> ]]></content:encoded> <wfw:commentRss>http://katastrophos.net/andre/blog/2006/12/19/yet-another-zaurus-media-player-done-differently-phase-1-teasing/feed/</wfw:commentRss> <slash:comments>13</slash:comments> </item> <item><title>Zaurus ARM Cross Compiler on OS X (Intel)</title><link>http://katastrophos.net/andre/blog/2006/11/15/zaurus-arm-cross-compiler-on-os-x-intel/</link> <comments>http://katastrophos.net/andre/blog/2006/11/15/zaurus-arm-cross-compiler-on-os-x-intel/#comments</comments> <pubDate>Tue, 14 Nov 2006 23:51:08 +0000</pubDate> <dc:creator>Andre Beckedorf</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Gadgets]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[OS X]]></category> <category><![CDATA[Zaurus]]></category><guid
isPermaLink="false">http://katastrophos.net/andre/blog/2006/11/15/zaurus-arm-cross-compiler-on-os-x-intel/</guid> <description><![CDATA[Andreas Junghans has an excellent tutorial on how to set up a Zaurus ARM cross compiler on OS X. However, there is one problem: It will only compile on PowerPC. So, here is my patchset for compiling on Intel: gcc-patches.tgz Use this file instead of the one offered on his page and just follow his [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://www.lucid-cake.net" target="_blank">Andreas Junghans</a> has an <a
href="http://www.lucid-cake.net/osx_arm/index_en.html" target="_blank">excellent tutorial</a> on how to set up a Zaurus ARM cross compiler on OS X. However, there is one problem: It will only compile on PowerPC.<br
/> So, here is my patchset for compiling on Intel:</p><p><a
href="http://katastrophos.net/downloads/gcc-patches.tgz" class="downloadlink">gcc-patches.tgz</a></p><p>Use this file instead of the one offered on his page and just follow his instructions.<br
/> The fix is really simple in nature: I&#8217;ve just added one file, namely xm-openstep.h in gcc/config/i386. This does the trick.</p> ]]></content:encoded> <wfw:commentRss>http://katastrophos.net/andre/blog/2006/11/15/zaurus-arm-cross-compiler-on-os-x-intel/feed/</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>Apple Cube Biohazard graphics card mod</title><link>http://katastrophos.net/andre/blog/2006/11/02/apple-cube-biohazard-graphics-card-mod/</link> <comments>http://katastrophos.net/andre/blog/2006/11/02/apple-cube-biohazard-graphics-card-mod/#comments</comments> <pubDate>Thu, 02 Nov 2006 04:40:05 +0000</pubDate> <dc:creator>Andre Beckedorf</dc:creator> <category><![CDATA[Cube]]></category> <category><![CDATA[Gadgets]]></category> <category><![CDATA[Hack]]></category><guid
isPermaLink="false">http://katastrophos.net/andre/blog/2006/11/02/apple-cube-biohazard-graphics-card-mod/</guid> <description><![CDATA[Since I&#8217;m in the mood to document various hardware modifications, here is a link for the archives: http://www.katastrophos.net/macosx/9000pro-mod.html This is a tutorial written in German for a mod I did way back. It describes how to modify the case of an Apple Cube to actually insert a better graphics card along with proper cooling of [...]]]></description> <content:encoded><![CDATA[<p>Since I&#8217;m in the mood to document various hardware modifications, here is a link for the archives:<br
/> <a
href="http://www.katastrophos.net/macosx/9000pro-mod.html">http://www.katastrophos.net/macosx/9000pro-mod.html</a><br
/> This is a tutorial written in German for a mod I did way back. It describes how to modify the case of an Apple Cube to actually insert a better graphics card along with proper cooling of the components.<br
/> Much of the article deals with how to relocate the DC/DC board to the inside of the Cube to make way for the bigger graphics card. It goes on to describe how to modify the graphics card with a better heatsink. Finally, it shows how to cut the outer casing for proper cooling.</p><p>You might ask, why this is called Biohazard mod. Check out <a
href="http://www.cubeowner.com/gallery/biohazard">this</a> and <a
href="http://www.cubeowner.com/forums//index.php?act=ST&#038;f=1&#038;t=1997&#038;hl=&#038;s=eece547b10a169cdbe5415bb6cb370e2">that</a>.</p> ]]></content:encoded> <wfw:commentRss>http://katastrophos.net/andre/blog/2006/11/02/apple-cube-biohazard-graphics-card-mod/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching using disk
Object Caching 714/878 objects using disk

Served from: katastrophos.net @ 2010-09-07 15:06:09 -->