iTunes server on Tonido Plug

Support for your TonidoPlug
User avatar
scott_mebust
Super Tonidoid
Super Tonidoid
Posts: 28
Joined: Sat Aug 29, 2009 9:43 am

iTunes server on Tonido Plug

Postby scott_mebust » Sun Aug 30, 2009 9:58 am

I'm actually amazed to see that other software can be installed using apt-get. I'm mildly surprised this will void the warranty (http://www.tonido.com/support/TonidoPlug_How_To_Advance) but this doesn't bother me. I certainly wouldn't expect support for any software configuration other than the original, out of the box one. Though, I'm betting many people will want to get inside and at least examine, if not modify, the Plug.

It would be nice if an iTunes server was available along side the DLNA / UPnP (media streaming) server. It isn't but it does appear that an iTunes server is available for installation as package:

root@ginger:~# apt-cache search mt-daap
mt-daapd - iTunes-compatible DAAP server

Has anyone out there installed and tried this yet? Any issues to be aware of?

Scott

P.S. The /etc/apt/sources.list is configured for the Ubuntu Jaunty Jackalope (9.04) package repository but one of the other General Support postings mentioned that you have to create a subdirectory for apt as follows:

mkdir -p /var/cache/apt/archives/partial

User avatar
scott_mebust
Super Tonidoid
Super Tonidoid
Posts: 28
Joined: Sat Aug 29, 2009 9:43 am

Re: iTunes server on Tonido Plug

Postby scott_mebust » Sun Aug 30, 2009 6:25 pm

Installing mt-daapd appears to have worked and required installation of 38 other new packages and used a total of 12.7 MB of space. Mt-daapd runs its own webserver on port 3689 (default) for administration purposes. I was able to connect to that web server but not (yet) able to have iTunes recognize the mt-daapd (Firefly) server. The mt-daapd server logs indicate some problems but the server appears to be running. Some (or all) of the problems are detailed here: https://bugs.launchpad.net/ubuntu/+source/mt-daapd/+bug/343069

But on the Tonido, the server did not segfault and is running. BTW, the default runlevel (http://en.wikipedia.org/wiki/Runlevel) for the Tonido is 2 and the mt-daapd link is appropriately installed in /etc/rc2.d.

User avatar
scott_mebust
Super Tonidoid
Super Tonidoid
Posts: 28
Joined: Sat Aug 29, 2009 9:43 am

Re: iTunes server on Tonido Plug

Postby scott_mebust » Tue Sep 01, 2009 11:45 am

For the curious, I'm including the mt-daapd log below. I haven't had time to follow up on this but there's definitely a direction of research indicated in the log.

2009-08-30 16:28:27 (41050c10): Firefly Version svn-1696: Starting with debuglevel 2
2009-08-30 16:28:27 (41050c10): Error loading plugin /usr/lib/mt-daapd/plugins/ssc-ffmpeg.so: /usr/lib/mt-daapd/plugins/ssc-ffmpeg.so: undefined symbol: avcodec_decode_audio
2009-08-30 16:28:27 (41050c10): Error loading plugin /usr/lib/mt-daapd/plugins/ssc-script.so: plugin declined to load
2009-08-30 16:28:27 (41050c10): Plugin loaded: rsp/svn-1696
2009-08-30 16:28:27 (41050c10): Plugin loaded: daap/svn-1696
2009-08-30 16:28:27 (41050c10): Starting signal handler
2009-08-30 16:28:27 (41050c10): Starting rendezvous daemon
2009-08-30 16:28:27 (41050c10): Client connecting
2009-08-30 16:28:27 (41050c10): Error: enum_begin failed (error 1): Misc SQL Error: no such table: config
2009-08-30 16:28:27 (41050c10): Can't get db version. New database?
2009-08-30 16:28:27 (41050c10): Initializing database
2009-08-30 16:28:27 (41050c10): Error: enum_begin failed (error 1): ?
2009-08-30 16:28:27 (41050c10): Error: enum_begin failed (error 1): ?
2009-08-30 16:28:27 (41050c10): Full reload...
2009-08-30 16:28:27 (41050c10): Starting mp3 scan
2009-08-30 16:29:06 (41050c10): Starting playlist scan
2009-08-30 16:29:06 (41050c10): Updating playlists
2009-08-30 16:29:06 (41050c10): Scanned 6330 songs in 39 seconds
2009-08-30 16:29:06 (41050c10): Starting web server from /usr/share/mt-daapd/admin-root on port 3689
2009-08-30 16:29:06 (41050c10): Registering rendezvous names
2009-08-30 16:29:06 (41050c10): Could not create AvahiEntryGroup: Bad state
2009-08-30 16:29:06 (41050c10): Could not create AvahiEntryGroup: Bad state
2009-08-30 16:29:06 (41050c10): Could not create AvahiEntryGroup: Bad state
2009-08-30 16:29:06 (41050c10): Serving 6330 songs. Startup complete in 39 seconds
2009-08-30 17:53:51 (428c1480): Thread 0: Entering ws_returnerror (401: Unauthorized)
2009-08-30 17:54:45 (428c1480): Thread 1: Entering ws_returnerror (302: Moved)
2009-08-30 17:54:45 (430c1480): Cannot resolve /usr/share/mt-daapd/admin-root//favicon.ico
2009-08-30 17:54:45 (430c1480): Thread 7: Entering ws_returnerror (404: Not found)
2009-08-30 17:54:48 (430c1480): Cannot resolve /usr/share/mt-daapd/admin-root//favicon.ico
2009-08-30 17:54:48 (430c1480): Thread 8: Entering ws_returnerror (404: Not found)
2009-08-31 16:29:13 (41050c10): Rescanning database
2009-08-31 16:29:13 (41050c10): Query: create temp table updated (id int)
2009-08-31 16:29:13 (41050c10): Error: unable to open database file
2009-08-31 16:29:13: Aborting
2009-08-31 22:48:42 (41050c10): Firefly Version svn-1696: Starting with debuglevel 2
2009-08-31 22:48:42 (41050c10): Error loading plugin /usr/lib/mt-daapd/plugins/ssc-ffmpeg.so: /usr/lib/mt-daapd/plugins/ssc-ffmpeg.so: undefined symbol: avcodec_decode_audio
2009-08-31 22:48:42 (41050c10): Error loading plugin /usr/lib/mt-daapd/plugins/ssc-script.so: plugin declined to load
2009-08-31 22:48:42 (41050c10): Plugin loaded: rsp/svn-1696
2009-08-31 22:48:42 (41050c10): Plugin loaded: daap/svn-1696
2009-08-31 22:48:42 (41050c10): Starting signal handler
2009-08-31 22:48:42 (41050c10): Starting rendezvous daemon
2009-08-31 22:48:42 (41050c10): Client connecting
2009-08-31 22:48:42 (41050c10): Initializing database
2009-08-31 22:48:42 (418c1480): Client registering
2009-08-31 22:48:43 (41050c10): Query: vacuum
2009-08-31 22:48:43 (41050c10): Error: unable to open database file
2009-08-31 22:48:43: Aborting

User avatar
scott_mebust
Super Tonidoid
Super Tonidoid
Posts: 28
Joined: Sat Aug 29, 2009 9:43 am

Re: iTunes server on Tonido Plug

Postby scott_mebust » Wed Sep 02, 2009 7:23 pm

No, not a dumb question. I believe all explicit dependencies have been met. However, I think it's possible that it could be a problem with sqlite not being installed. I haven't yet had time to investigate further.

root@ginger:~# dpkg -l '*avahi*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-========================-========================-================================================================
un avahi-autoipd <none> (no description available)
ii avahi-daemon 0.6.23-4ubuntu4 Avahi mDNS/DNS-SD daemon
ii libavahi-client3 0.6.23-4ubuntu4 Avahi client library
ii libavahi-common-data 0.6.23-4ubuntu4 Avahi common data files
un libavahi-common0 <none> (no description available)
ii libavahi-common3 0.6.23-4ubuntu4 Avahi common library
un libavahi-core3 <none> (no description available)
ii libavahi-core5 0.6.23-4ubuntu4 Avahi's embeddable mDNS/DNS-SD library

root@ginger:/var/log# dpkg -l '*sqlite*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-========================-========================-================================================================
un libaprutil1-dbd-sqlite3 <none> (no description available)
ii libsqlite3-0 3.6.10-1 SQLite 3 shared library
ii libsqlite3-dev 3.6.10-1 SQLite 3 development files
un sqlite3-doc <none> (no description available)

User avatar
scott_mebust
Super Tonidoid
Super Tonidoid
Posts: 28
Joined: Sat Aug 29, 2009 9:43 am

Re: iTunes server on Tonido Plug

Postby scott_mebust » Wed Sep 02, 2009 8:02 pm

I'm not sure if that was the problem either. Firefly (mt-daapd) was configured to use sqlite3 and I thought it only needed the shared library (already installed) and nothing more. Regardless, i installed the sqlite3 command line interface.

Then, I checked the location of the sqlite database and the permissions on the containing directory (/var/cache/mt-daapd) because of this error:

2009-09-02 20:35:51 (41050c10): Error: unable to open database file


Everything seemed fine, so I blew away the database and restarted. Things might be OK now, I haven't yet checked:

2009-09-02 20:49:31 (41050c10): Firefly Version svn-1696: Starting with debuglevel 2
2009-09-02 20:49:31 (41050c10): Error loading plugin /usr/lib/mt-daapd/plugins/ssc-ffmpeg.so: /usr/lib/mt-daapd/plugins/ssc-ffmpeg.so: undefined symbol: avcodec_decode_audio
2009-09-02 20:49:31 (41050c10): Error loading plugin /usr/lib/mt-daapd/plugins/ssc-script.so: plugin declined to load
2009-09-02 20:49:31 (41050c10): Plugin loaded: rsp/svn-1696
2009-09-02 20:49:31 (41050c10): Plugin loaded: daap/svn-1696
2009-09-02 20:49:31 (41050c10): Starting signal handler
2009-09-02 20:49:32 (41050c10): Starting rendezvous daemon
2009-09-02 20:49:32 (41050c10): Client connecting
2009-09-02 20:49:32 (41050c10): Error: enum_begin failed (error 1): Misc SQL Error: no such table: config
2009-09-02 20:49:32 (41050c10): Can't get db version. New database?
2009-09-02 20:49:32 (41050c10): Initializing database
2009-09-02 20:49:32 (41050c10): Error: enum_begin failed (error 1): ?
2009-09-02 20:49:32 (41050c10): Error: enum_begin failed (error 1): ?
2009-09-02 20:49:32 (41050c10): Full reload...
2009-09-02 20:49:32 (41050c10): Starting mp3 scan
2009-09-02 20:49:32 (418c1480): Client registering
2009-09-02 20:49:33 (418c1480): Client running
2009-09-02 20:50:05 (41050c10): Starting playlist scan
2009-09-02 20:50:05 (41050c10): Updating playlists
2009-09-02 20:50:05 (41050c10): Scanned 6330 songs in 33 seconds
2009-09-02 20:50:05 (41050c10): Starting web server from /usr/share/mt-daapd/admin-root on port 3689
2009-09-02 20:50:05 (41050c10): Registering rendezvous names
2009-09-02 20:50:06 (41050c10): Serving 6330 songs. Startup complete in 34 seconds

User avatar
scott_mebust
Super Tonidoid
Super Tonidoid
Posts: 28
Joined: Sat Aug 29, 2009 9:43 am

Re: iTunes server on Tonido Plug

Postby scott_mebust » Wed Sep 02, 2009 8:54 pm

Well, now it's working. I have a feeling that the only problem was, perhaps, a corrupt database that just needed to be deleted. :D

Tuxedo
Tonido Team
Tonido Team
Posts: 1458
Joined: Wed Jan 28, 2009 11:30 pm

Re: iTunes server on Tonido Plug

Postby Tuxedo » Wed Sep 02, 2009 9:02 pm

Scott,
Thatz cool. Can you please make a new post summarizing the steps for getting iTunes server up and running. It will be useful for other users.

User avatar
scott_mebust
Super Tonidoid
Super Tonidoid
Posts: 28
Joined: Sat Aug 29, 2009 9:43 am

Re: iTunes server on Tonido Plug

Postby scott_mebust » Wed Sep 02, 2009 9:47 pm

Hah. That's like assuming I kept notes, which I didn't. Basically, just install mt-daapd like:

Code: Select all

root@ginger:/# apt-get install mt-daapd
root@ginger:/# cd /etc
root@ginger:/etc# cp mt-daapd.conf mt-daapd.conf.orig

Then edit /etc/mt-daapd.conf. I made the following changes:

Code: Select all

root@ginger:/etc# diff mt-daapd.conf.orig  mt-daapd.conf
50c50
< admin_pw = mt-daapd
---
> admin_pw = ************
84c84
< mp3_dir = /home/media/music
---
> mp3_dir = /media/usb0/Music
207c207
< #logfile = /var/log/mt-daapd.log
---
> logfile = /var/log/mt-daapd.log
226c226
< #rescan_interval = 300
---
> rescan_interval = 86400
237c237
< # always_scan = 0
---
> always_scan = 1

Obviously, the password above was actually set to something. You can make your own decisions about the various options.

Examine the mt-daapd log (mine is /var/log/mt-daapd.log, as designated in the config file above). You might see some errors, etc.

I checked the runlevel (turned out to be 2, see below), and then checked to make sure that there was a link in runlevel 2 (/etc/rc2.d) for the daemon/server (/etc/init.d/mt-daapd). Like this:

Code: Select all

root@ginger:/etc# runlevel
N 2
root@ginger:/etc# ls -l /etc/init.d/mt-daapd
-rwxr-xr-x 1 root root 1777 Mar 10 04:23 /etc/init.d/mt-daapd
root@ginger:/etc# ls -l /etc/rc2.d/*mt-daapd
lrwxrwxrwx 1 root root 18 Aug 30 13:45 /etc/rc2.d/S25mt-daapd -> ../init.d/mt-daapd

You can then either stop/restart the daemon, if necessary, like this:

Code: Select all

root@ginger:/etc/init.d# /etc/init.d/mt-daapd restart

or reboot if you'd like. At some point, I think my database got corrupted so I stopped the server, deleted the database, and restarted:

Code: Select all

root@ginger:/var/cache/mt-daapd# /etc/init.d/mt-daapd stop
root@ginger:/var/cache/mt-daapd# rm /var/cache/mt-daapd/songs3.db
root@ginger:/var/cache/mt-daapd# /etc/init.d/mt-daapd start

Or something to that effect. I did install the command line for sqlite3 but I don't think that had anything to do with it.

Code: Select all

apt-get install sqlite3

If someone else has a clean system, perhaps they can try these steps and correct, refine, or elaborate on them.

After mucking around like this, I checked the logs (see previous post) and then checked with an iTunes client (under Windows). The server showed up in the share as Firefly... as set in the mt-daapd configuration file.

Good luck!

alex_ncus
Rookie Tonidoid
Rookie Tonidoid
Posts: 5
Joined: Wed Sep 02, 2009 12:29 pm

Re: iTunes server on Tonido Plug

Postby alex_ncus » Wed Sep 09, 2009 9:03 am

Works awesome ! Thanks.

albertw
Rookie Tonidoid
Rookie Tonidoid
Posts: 3
Joined: Thu Dec 17, 2009 2:16 pm

Re: iTunes server on Tonido Plug

Postby albertw » Sun Dec 20, 2009 8:12 pm

scott_mebust wrote:Then, I checked the location of the sqlite database and the permissions on the containing directory (/var/cache/mt-daapd) because of this error:

2009-09-02 20:35:51 (41050c10): Error: unable to open database file


Everything seemed fine, so I blew away the database and restarted. Things might be OK now, I haven't yet checked:


I was getting that error also each time I tried a rescan. It looks as though mt-daapd is trying to do write in /var/tmp and failing during a rescan:

Code: Select all

read(8, "\0\0\0\v\0\0\0\0\0\0\0\0\0\0\0\0"..., 16) = 16
fcntl64(8, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}, 0xbee3b280) = 0
stat64("/var/tmp", {st_mode=S_IFDIR|0755, st_size=160, ...}) = 0
[b]access("/var/tmp", R_OK|W_OK|X_OK)      = -1 EACCES (Permission denied)
[/b]stat64("/usr/tmp", 0xbee3aeb0)          = -1 ENOENT (No such file or directory)
stat64("/tmp", {st_mode=S_IFDIR|0755, st_size=840, ...}) = 0
access("/tmp", R_OK|W_OK|X_OK)          = -1 EACCES (Permission denied)
stat64(".", {st_mode=S_IFDIR|0755, st_size=1384, ...}) = 0
access(".", R_OK|W_OK|X_OK)             = -1 EACCES (Permission denied)
access("./etilqs_TYHQgteh98lgVpl", F_OK) = -1 ENOENT (No such file or directory)
open("./etilqs_TYHQgteh98lgVpl", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE|O_NOFOLLOW, 0600) = -1 EACCES (Permission denied)
gettimeofday({1261357199, 327459}, NULL) = 0
send(4, "<25>Dec 21 00:59:59 mt-daapd[6700"..., 78, MSG_NOSIGNAL) = 78
gettimeofday({1261357199, 328264}, NULL) = 0
write(3, "2009-12-21 00:59:59 (41050c10): Q"..., 74) = 74
gettimeofday({1261357199, 328735}, NULL) = 0
send(4, "<25>Dec 21 00:59:59 mt-daapd[6700"..., 72, MSG_NOSIGNAL) = 72
gettimeofday({1261357199, 329313}, NULL) = 0
write(3, "2009-12-21 00:59:59 (41050c10): E"..., 68) = 68
write(3, "2009-12-21 00:59:59: Aborting\n"..., 30) = 30
[b]write(2, "Error: unable to open database fi"..., 36) = 36
[/b]write(2, "Aborting\n"..., 9)            = 9
exit_group(1)                           = ?


'chmod 777 /var/tmp' seems to have fixed it for me.


Return to “TonidoPlug Support”

Who is online

Users browsing this forum: No registered users and 5 guests