Twonky Server database issues & fix

Whilst it’s scanning, I took a look in the /CacheVolume/twonkymedia/db directory.

There are lots of .wpl files, and, looking at a few, I notice that they’re derived from .m3u files left behind by my ripping process.  I can make MediaMonkey ignore these when it scans for media.

Is there a way of making Twonky ignore them, or do I need to delete them, as I suspect that it may be confusing the scanner, making it think create soft links to files mentioned in the .m3u files (that aren’t usually there, because they’ve been format converted and re-named).  I leave the .m3u files behind when ripping with EAC, as a record of the rip process.  But if they’re upsetting or confusing Twonky, I’m happy to delete or move them all into a sub-directory I can then exclude from Twonky searches.

I used Kinksy on the PC to browse the Twonky server.  Here are the properties of one file:

Type                  object.item.audioItem.musicTrack
Title                   Track01
Album               Learn French Disc 1
Artist                  Linguaphone
Genre                Unknown
Release Year   2012
Original Track No.    1
Duration           2:55
Size                   14MB
Mime Type        audio/x-flac
Protocol Info    http-get:*:audio/x-flac:*
Uri                      http://192.168.1.69:9000/disk/NON-DLNA-OP01-FLAGS01700000/O0$1$8I39937.flac
Artwork Uri        http://192.168.1.69:9000/disk/DLNA-PNJPEG_TN-OP01-CI1-FLAGS00d00000/defaultalbumart/a_u_d_i_o.jpg/O0$1$8I39937.jpg?scale=160x160

Hmm URI ‘NON-DLNA-…flac’?

Well, after a few server restarts, it looks like I’m no longer getting an error, so whatever it was that was causing that seems to have been fixed by the System Restore.

Shame that Twonky seems to have reverted to its behaviour before all this started, which is not serving media.

I guess it’s time to give up with Twonky and try yet another DLNA server.  MiniDLNA here we come.  Wish me luck…

I think the final proof that things aren’t well with my Twonky is to go to its own media browser, in the top right of the web UI.

If I select any music, it comes back as file not found.  If I browse photos, I see thumbnails but, again, it comes back as “404 file not found The requested URL was not found on this server” when I double-click on the thumbnail.

Not good.

I thought I might try to get some support from Twonky.  So I clicked on the ‘help center’ button on the Twonky UI.

“Sorry, the community that you’re looking for has been retired and is no longer available. If you need help, please contact the company you’re looking for directly.”

Hmmm…

So I clicked on the twonky.com link:

http://twonky.com/

Looks like they just want me to buy more stuff.

So I googled ‘twonky user manual’, and the first hit was

http://twonky.com/help/

Hmmm… why isn’t this page visible from twonky.com…?

I clicked on the ‘Twonky FAQ’ button

http://twonkyforum.com/questions/popular

“The requested URL /questions/popular was not found on this server.”

Hmmm…

I clicked on the ‘Known Issues’ button

http://twonkyforum.com/problems/active

“The requested URL /problems/active was not found on this server.”

I clicked on the ‘Support’ button.

A pop-up appeared, 'Powered by GetSatisfaction"

This has a title “To post or comment, please sign in”.  I briefly saw something flash up that looked like a login page, but then the pop-up reverted to a lot of what looks like Javascript diagnostics…

Just to make sure I was looking at the rgiht page, I clicked on the ‘Twonky Server’ at the top of the page

http://twonky.com/store-old/

Only to get another Error 404 PNF message…

I clicked on the ‘Visit Twonky Support Community’ button

http://twonkyforum.com/

Hooray!  Some actual content at last…

Browsing through the Twonky Server section, I found this:

http://twonkyforum.com/viewtopic.php?f=2&t=11746

Could it be that all this trouble is because, for some reason, the ‘Media Streaming’ option had been turned off in the Dashboard/Shares page…?  Would it not be a good idea to check this setting if a user enables media streaming on the Settings/Media page…?  This thread also suggests that there’s a conflict between the WD Dashboard and the Twonky UI, so that settings changed under the Twonky UI are trashed by the WD Dashboard.  This seems less than optimal, too.  I might follow the advice to disable the WS script that trashes the Twonky settings. Or just never restart Twonky from the WD Dashboard.

I’ll let it finish the scan, and see whether it allows me to see and use the media.  I’ll report back.

As for manuals, well, there’s one for Twonky V6:

http://www.mswhs.com/2010/07/twonkyserver-6-0-user-guide/

Does this seem an appropriate level of support for a product (from Twonky or WD)?  I certainly don’t think so.  At the very minimum, there ought to be a downloadable user manual.  Actually, I thought that was mandated by US law; manuals for products sold in the US must be available online (not that I’m in the US, but it has been quite helpful in the past…).

1 Like

Well, it looks like I now have a working Twonky Server, and it was those Twonky forum threads provided the answer.  I still have some tweaks to do, such as finding out why it is finding picutres in my Shared Music directory, even though I’ve told it to only look for music there (i.e. I don’t want album art appearing in ‘Photos’).

Essentially, I had three problems:

  1. Unscheduled power down caused some issue with the services provided by MyCloud, so Twonky kept generating errors.  A System Restore fixed this problem.  A saved Configuration file helps with System Restore.

  2. For some reason, I had Media Streaming disabled on the Public share. Twonky started up looking for media on the Public share, catalogued it, but then wasn’t allowed to access it for playback.  I suspect it also realised that it wasn’t allowed access, and cleared its database.

  3. There’s a conflict between the WD and Twonky UI control interfaces over which of them is ‘in charge’ of the which directories are to be searched.  Thus, turning Twonky off and on via the WD Dashboard resets the search back to default.  This can be prevented by disabling the WD script that modifies the twonkyserver.ini file: see the Twonky forum thread in the post above for details.

Many thanks to Nazar78 for taking the time to respond.

Well, after some considerable experimentation and frustration at getting Twonky to look for different media types in each of the different shared Media folders, I’ve come to a fairly unsurprising conclusion.

The MyCloud _ insists _ on creating the following folders for shared media:

/Public/Shared Music

/Public/Shared Pictures

/Public/Shared Videos

[edit] 2015/02/24: Actually, it’s Twonky that creates these folders.

I shouldn’t have put my media in the ‘Shared Media’ folders; these appear to be intended for Twonky to store media it copies from other libraries when working on ‘AutoCopy Aggregation’ mode.  The trouble is that these appear the first time the MyCloud is turned on, so it looks like that’s where your supposed to put your media: you’re not…

Using the following folders to store my media seems to make it work properly:

         /Public/Music        All
         /Public/Pictures    Photos
         /Public/Videos      Videos

[/edit] 

If you rename them, it re-creates them whenever it re-starts*.  This annoyed me when I first got the MyCloud.  But, whilst I generally like to be in control of what my filesystems are called, I gave in, and accepted this enforced structure.

However, I note the space in the path name.  Now, the NAS is a Linux box.  And Twonky runs under Linux.  And Unix of all flavours is well known for its dislike of spaces in pathnames.  So I began to expect that this space was the root cause of all the problems I was having.

My experience of setting Twonky’s shares to search for media as follows:

/Public/Shared Music - Music only

/Public/Shared Pictures - Photos only

/Public/Shared Videos - Videos only

was that it would go off and create the database, but if you tried to stream any of that media, it refused, and eventually, the list of content dropped back to zero.  Something was confused, and it could not be corrected without an SSH login & deletion of the entire /CacheVolume/twonkymedia directory.  I wrote a script to save the .ini, delete the directory, make a new one and copy the saved .ini back.  Yes; I was doing it that often whilst experimenting…

So I created another folder to test this theory:

/Public/Shared_Videos

I put a few videos in it, and set Twonky to search it for videos.

Bingo!  No more problems!

So I’ve now renamed the folders to remove the pointless 'Shared ’ part (since it’s on ‘/Public’, it’s obviously shared…), and fully expect Twonky to behave from now on.

It’s searching /Public/Music at the moment, and I’m still able to stream media.

Frankly, it’s a schoolboy error to create folders with pathnames containing spaces on a linux system, without protecting them with quotes.  But then, so is failing to back up twonkyserver.ini before a firmware upgrade, and restore it after the upgrade, before restarting Twonky.  But that’s exactly what the MyCloud firmware upgrade process does…  I may seek out the upgrade script and try to bend it to my will (i.e. do the right thing and save/restore the Twonky ini file).  I’ve turned off automatic updates in the meantime.

* Ha! I just went back to /Public to create empty /Shared Media folders to keep MyCloud happy.  Only to find that it had already recreated its beloved folders…  I’ll just have to accept that it leaves unwanted droppings on MY filesystem.

My conclusion to this episode?  This:

[edit 2015/02/24]

Some better explanation of how Twonky works is probably needed, to stop people putting their media where it seems ‘sensible’.  See my FAQ link in the edit of the first post.

[/edit]

This is something WD needs to address in a future Firmware upgrade. I run linux based software at work that has been ported to Windows … and no Filename or Directory can have spaces within their naming convention, we always use an “_” underscore. WD has to be aware of this … wouldn’t you think? :confounded:

Linux/unix do allow spaces in names, they need to be quoted and a difficult to use and NOT recommended

they can actually contain most charcters even control characters. I have had a few cases over the years where I have had to delete by inode number as I couldn’t delete the file from a terminal session. no idea how the user created the files

This is something WD needs to address in a future Firmware upgrade. 

I fear that this is unlikely to happen.  There are now so many systems out there with the default media directories:

Public/Shared Music

Public/Shard Pictures

Pulbic/Shared Videos

that changing those default names to include underscores would cause chaos on a firmware upgrade…

The best we can hope for is that WD do a proper integration job on Twonky, and stop the conflict between the Dashboard UI and Twonky UI, so that users can actually use the increased versatility of the Twonky UI without having their settings trashed by MyCloud.  I spotted last night that WD have snuck in a caveat on their Twonky server help page:

http://wdc.custhelp.com/app/answers/detail/a_id/3299/~/how-to-access-the-twonky-media-server-on-a-wd…

Actually, a simpler alternative might be to stop enforcing the Public folder names, but recommend them as (rather stupid) defaults, and allow the user to choose their own names.  Rather like I’ve done by removing the 'Shared ’ prefix from my media folders.

For completeness, my findings on the many ways in which MyCloud trashes Twonky are as follows:

i) Stopping and restarting media streaming via the Dashboard destroys any settings made via Twonky UI

ii) MyCloud firmware upgrade destroys any settings made via Twonky UI

iii) MyCloud firmware upgrade probably changes one or two ‘magic numbers’ in the Twonky config file, so saving and restoring a Twonky config around a firmware upgrade will cause Twonky to give Error -2, and not work

iv) System Restore appears to disable media serving on Shares, so, even if Twonky restarts and catalogues your media, it finds it cannot play it, and deletes it from its database.  This appears as the database building normally, and then dropping back to empty when it’s finished…

v) the default media folder names are incompatible with non-trivial database searches (those spaces stop you selecting anything other than ‘search /Public for all media types’)

Ideally, a proper integration would look for an existing Twonky config file, and do any necessary inline edits to it to support new MyCloud firmware.  And it wouldn’t trash the config file when media streaming is stopped and restarted under the dashboard.  This latter can be prevented by stopping the script that overwrites the Twonky config file:

cd /usr/local/sbin
mv writeTwonkyContentDir.sh writeTwonkyContentDir.sh.old

You’ll need to SSH in to MyCloud Linux shell do this.

It wouldn’t be that hard for this script to check for the existence of a Twonky config file, and leave it alone when restarting media sharing (I might go an edit it to do just that… only for it to be trashed again by a firmware upgrade).

Twonky isn’t integrated into MyCloud; it’s just sitting on top of it, struggling for survival…  WD Support tried to refer me to the twonky.com website, apparently blissfully unware of my observations of 11-20-2014 08:35 PM (i.e. the website provides no support for Twonky).  The fact that WD don’t provide an up-to-date manual for the version of Twonky shipped in WD’s product is also very poor; they seem to be saying “not our problem, mate; Twonky is nothing to do with us”.  Whereas I think it is their problem, since it’s a feature of their product, prominently advertised on the MyCloud packaging.

1 Like