{"id":937,"date":"2013-03-20T21:53:48","date_gmt":"2013-03-20T13:53:48","guid":{"rendered":"http:\/\/www.computersolutions.cn\/blog\/?p=937"},"modified":"2013-03-20T21:53:48","modified_gmt":"2013-03-20T13:53:48","slug":"music-please-forked-daapd-issues-solution","status":"publish","type":"post","link":"https:\/\/www.computersolutions.cn\/blog\/2013\/03\/music-please-forked-daapd-issues-solution\/","title":{"rendered":"Music please! &#8211; forked-daapd issues \/ solution"},"content":{"rendered":"<p>I usually do most of my work these days on an Air. While its decent, it is rather dinky spacewise, and I tend to keep it empty of music so I have (barely) enough space for my dev stuff, and various embedded cross compile environments.<\/p>\n<p>I still like listening to music though, so I keep that on secondary and even tertiary storage. This typically is one of the fine HP N36L \/ N40L NAS devices that I&#8217;m fond of buying. I have a few HP N36\/N40L nas boxen in various places, some of which contain my music, but most of which contain backups, onsite, and offsite, as you can never be too careful!<\/p>\n<p>I know this quite intimately, as the very machine I&#8217;m typing this on had a catastrophic SSD failure only a week ago.<br \/>\nLuckily I didn&#8217;t lose too much work!<\/p>\n<p>Enough with the background, and back to the plot.<\/p>\n<p>As I was saying, I needed some tunes to <span style=\"text-decoration: line-through;\">harass the staff with<\/span> listen to at work.<\/p>\n<p>I looked at a couple of solutions, and decided on forked-daapd, as that allegedly could share music to iTunes from the NAS music folder without too many headaches.<\/p>\n<p>Most instructions were of the sort:<\/p>\n<p><code>apt-get install forked-daapd<\/p>\n<p>pico \/etc\/forked-daapd.conf<\/p>\n<p>[edit music folder, save file]<\/p>\n<p>\/etc\/init.d\/forked-daapd restart<\/code><\/p>\n<p>In my case it didn&#8217;t work.<br \/>\nIt also didn&#8217;t really give much clue that it wasn&#8217;t working, and their website didn&#8217;t have much to go on.<br \/>\nI looked at compiling from scratch, but the guy making it uses Clang and Java stuff to build, and it just looked like too much hassle.<\/p>\n<p>So, I had to troubleshoot even though I didn&#8217;t really want to spend the time.<\/p>\n<p>My initial issue was something like the below:<\/p>\n<p>forked-daapd wouldn&#8217;t run successfully (but it also didn&#8217;t complain, sigh).  I could see that it wasn&#8217;t running on any port specified, and checking kern.log showed it was crapping out silently.<\/p>\n<p><code>Mar 20 21:03:09 officenas kernel: [ 3392.026612] forked-daapd[9848] trap invalid opcode ip:7f8d8772958e sp:7f8d8176bf60 error:0 in libdispatch.so.0.0.0[7f8d87722000+c000]<\/code><\/p>\n<p>Running it in the foreground showed it was having issues creating the mDNS bits.<\/p>\n<p><code>mdns: Failed to create service browser: Bad state<\/code><\/p>\n<p>This eventually worked out to editing \/etc\/nsswitch.conf, adding the following to the host lines:<\/p>\n<p><code>hosts:          files  mdns4_minimal dns mdns4<\/code><\/p>\n<p>then restarting avahi <\/p>\n<p><code>\/etc\/init.d\/avahi-daemon restart<\/code> <\/p>\n<p>This got me past the bad state error, but then it was bombing out with a missing symbol avl_alloc_tree error.<\/p>\n<p>I did an strace on the thing and found it was looking for libav under \/lib vs under \/var\/lib<\/p>\n<p>This was also documented here &#8211; <a href=\"http:\/\/blog.openmediavault.org\/?p=552&#038;cpage=1#comment-8376\">http:\/\/blog.openmediavault.org\/?p=552&#038;cpage=1#comment-8376<\/a>, although sadly not until I found out myself.<\/p>\n<p>Looks like the zfsonlinux is the culprit here, as that puts libav files in that folder.  Tsk tsk.<\/p>\n<p>I removed those libav files &#8211; rm \/lib\/libav*    <strong>****as I know what I&#8217;m doing****<\/strong> (don&#8217;t randomly erase stuff unless you&#8217;re 3000% sure!), and sure enough, forked-daapd started up, and started blatting tons of output to the logs in a happy manner.<br \/>\niTunes was also finally happy, and could see my music.  Yay.<\/p>\n<p>Took me about 2 hours to figure out sadly, but at least I sorted it out.<\/p>\n<p>Hopefully this will save someone else the headache when they google for the error(s)!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I usually do most of my work these days on an Air. While its decent, it is rather dinky spacewise, and I tend to keep it empty of music so I have (barely) enough space for my dev stuff, and various embedded cross compile environments. I still like listening to music though, so I keep [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[25],"tags":[440,258,439,441],"class_list":["post-937","post","type-post","status-publish","format-standard","hentry","category-technical-mumbo-jumbo","tag-bug","tag-debian","tag-forked-daapd","tag-zfs"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/comments?post=937"}],"version-history":[{"count":1,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/937\/revisions"}],"predecessor-version":[{"id":938,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/937\/revisions\/938"}],"wp:attachment":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/media?parent=937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/categories?post=937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/tags?post=937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}