{"id":55,"date":"2007-01-04T06:40:47","date_gmt":"2007-01-04T04:40:47","guid":{"rendered":"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\/"},"modified":"2007-09-23T13:32:52","modified_gmt":"2007-09-23T11:32:52","slug":"%e2%80%9cyet-another-zaurus-media-player%e2%80%9d%e2%80%a6-done-differently-phase-2-development-progress-no-release-yet","status":"publish","type":"post","link":"https:\/\/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\/","title":{"rendered":"\u00e2\u20ac\u0153Yet Another Zaurus Media Player\u00e2\u20ac\u009d\u00e2\u20ac\u00a6 done differently . (Phase 2: Development progress, no release yet.)"},"content":{"rendered":"<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>\n<p><strong>Development progress<\/strong><\/p>\n<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 \/>\nComing 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 \/>\nDevelopment 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>\n<p>Just so you get the idea:<br \/>\n<em>My essential requirement for this project is that the player is able to cope with thousands of files in a playlist.<\/em><\/p>\n<p>With that being said, I&#8217;ve already rewritten the playlist management four times. :)<br \/>\nThe 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>\n<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>\n<p>With that being said, different rules in database design apply for embedded systems:<br \/>\nIn 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 \/>\nOn 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 \/>\nNow 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 \/>\nSo, 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 \/>\nIn 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>\n<p><strong>Screenshots<\/strong><\/p>\n<p>No release yet, sorry! I have to finalize some features first.<br \/>\nHowever, here are some new screenshots that show the new overview feature in action. The design of the application is temporary, stay tuned! :)<\/p>\n<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.\"><img loading=\"lazy\" decoding=\"async\" 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\"><img loading=\"lazy\" decoding=\"async\" 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.\"><img loading=\"lazy\" decoding=\"async\" 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>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[20,4,11,24,15,6],"class_list":["post-55","post","type-post","status-publish","format-standard","hentry","tag-development","tag-gadgets","tag-linux","tag-quasar","tag-random","tag-zaurus"],"_links":{"self":[{"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/posts\/55"}],"collection":[{"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/comments?post=55"}],"version-history":[{"count":0,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/posts\/55\/revisions"}],"wp:attachment":[{"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/media?parent=55"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/categories?post=55"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/tags?post=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}