How To Fix Twonky Issues in 3.0 Patch 2

by Alex Kuretz on March 4, 2010 · 92 comments

Yesterday I reported on the availability of the 3.0 Patch 2 software we discovered on the HP web site, and gave instructions on how to install it. Since performing the initial install I’ve spent some more time with my EX495 running the update and have encountered a couple of issues.

The first was a problem where I experienced the high CPU utilization caused by Twonky. I eventually narrowed this down to a single video file in my library and have worked around the problem, however this is very frustrating since I did not experience this issue prior to installing Patch 2, and the updated 5.1.1 version of Twonky was specifically supposed to contain the resolution for this issue.

I don’t have a magic fix for this, unfortunately, but I can tell you how I investigated the problem. I watched the Twonky status in the “Media Server” tab of the server console, and noticed that it had indexed a lot of my content but the Last Database Update status showed that it was “In progress” and appeared to be stuck indexing a specific directory.

I started moving files out of that directory and into the Public share, telling Twonky to rebuild the database each time. This didn’t resolve the issue, so I moved up a directory and continued. Eventually the indexing completed and I was able to determine which file was problematic.

Update: I’ve found an easy way to identify the exact file that is causing Twonky to freeze, keep reading for the details.

First, download the free “handle” utility from SysInternals here. Copy the zip file to your server Software share, and then log onto your server via Remote Desktop. Copy the zip file from the Software share to your server Desktop, unblock it, and then extract it.

Start a command prompt (Start->Run and type “cmd” with no quotes then hit Enter). Type the following into the command prompt window.

cd desktop\handle
handle -p twonky

You should see output similar to the below, including the name of the media file that has Twonky “stuck” while indexing. I’ve highlighted the offending file on my system below in red. You’ll need to stop Twonky (the Stop Sharing button the Media Server tab works for me), then move this file out of the Twonky indexed folders (I moved mine to the Public share). Start Twonky again and hope that it doesn’t get stuck on another file. You may have to perform this multiple times if there are more than one file causing issues for Twonky.

Use handle.exe to troubleshoot Twonky

I do not know why this file caused a problem, it plays fine on my computer and its metadata can be read by MediaInfo. A reader of this site named marco also experienced this same issue and was able to resolve the problem the same way I did.

The second problem had to do with the Remote Media Streaming feature. I experienced very poor performance while using the Music streaming feature, with the system exhibiting the following symptoms.

  • Songs would take tens of seconds or longer to begin playing
  • When a song completed, playback would not continue to the next track in the album
  • Terrible, low resolution sound quality for some songs

Basically, one of the features that I use the most had just become unusable.

In the course of investigating the issue, I uncovered some interesting details. Twonky was now transcoding and caching versions of my music library when I would attempt to play them via Remote Media Streaming. Most files were converted to 96kbit bitrate, which was acceptable but not great quality. Files that were encoded at a high bitrate (320kbit, for example), were converted to 32kbit which sounds worse to me than AM radio. This was a new behavior, so I started comparing the new system with my recently upgraded EX487 that is running the 3.0 software update, and discovered an important difference in the Audio Transcoding configuration file.

If you experience this problem, here is how you can fix it.

UPDATE:HP has released 3.0 Patch 3 which corrects the mis-configured file I describe below. If you experience the above issues with streaming music, make sure you’ve performed a Software Update of the HP software to get Patch 3 before you make the below change.

First, access your server via Remote Desktop, and navigate to C:\TwonkyMedia\cgi-bin.

Make a backup copy of the audtranscode-mp3.desc file, and then open the original with notepad. The configuration file contains the following entries which cause the poor streaming performance for me.

# Audtranscode: Transcode/transrate audio (aac, mp4, wav, wma etc. to mp3)
#(c) 2009 by PacketVideo
exec: audtranscode $infile $outfile -br $outbitrate
# capabilities
from=audio/all
bitrate>96000
defaultbitrate=96000
to=audio/mpeg
asynchronous
priority=idle

You will want to entirely replace the contents of the file with the settings that were originally in place prior to the upgrade to Patch 2.

# transcode audio (mp4, wav, wma to mp3)
#(c) 2008 by PacketVideo
exec: audtranscode $infile $outfile -br 128000 -sps 44100
# capabilities
from=audio/all
to=audio/mpeg
asynchronous
priority=idle

Save the modified config file, restart Twonky via the Server Console “Media Server” tab of the Server Console, and your Remote Media Streaming for music should be back to the way it was before the Patch 2 upgrade. Basically this sets the transcoder to stream your music at 128kbit, whereas the “bad” configuration allows some other logic (which is obviously incorrect) to encode at whatever bitrate it wants. Though it is supposed to default to 96kbit, as I experienced some files are handled improperly.

I’ve worked with long-time forum member and co-host of The Home Server Show “Diehard” to verify this behavior, and we confirmed both the problem and the solution on his system as well.

Nigel “Cougar” Wilks helped me investigate the Twonky installer package included in the Patch 2 update, and found that the offending configuration file is included in their package. The 3.0 Patch 2 installer contains logic to only install this new version of Twonky if it does not yet exist on the server, which explains why my upgraded EX487 was working correctly. So there’s no need to worry about the Patch 2 update once you have upgraded your EX47x or EX48x to the 3.0 software update. There is still an open question about why this issue doesn’t exist in the 3.0 Software Update systems since they are supposed to be running this same version of Twonky.

I’ve passed both of these issues along to the Twonky and HP support teams with the intent of helping them improve their products. However, given the slow timeframe that we see updates from these companies, I wanted to share the fix with you for any users that are currently impacted by the problem.



Article by Alex Kuretz

I'm Alex Kuretz, and I'm the founder of MediaSmartServer.net. I was the Lead Test and Integration Engineer at HP for the MediaSmart Server until April 2008 when I moved on to other opportunities outside HP. I've kept active in the Windows Home Server community, creating several add-ins and helping users make the most of their Home Servers.


{ 88 comments… read them below or add one }

Peter K March 27, 2010 at 7:35 am

Maybe annoying but this site and Alex’s patch saved my butt. Now after much activity yesterday and overnight CPU is idling nicely at 8-12% . So I am ready to unleash the beast and start the Twonky service and re-enable media sharing. Thank you to everyone for their posts and suggestions. The pig has moved out and my server is back (with 3.3.1.35433).

Anthony O March 27, 2010 at 11:15 am

The pig indeed has left the building!
My issues with Twonky were the result of BeyondTV videos edited with VideoReDo. I had my connector up and an RDP window with Services and Handle going simultaneously. Whenever I noticed Media Server “stuck” on the db update, I would switch into the RDP, stop the Twonky service, run the HANDLE cmd and delete the offending TV recording. I would then start the service again (via RDP) and rebuild the database, thereby repeating the process.

Righteous!

Andreassen, Odd March 27, 2010 at 3:04 pm

Dear Alex Kuretz,
Just wanted to give you my gratitude!
I recently bought a (to me) new HP ex 490, and i could not figure out why the twonkymediaserver process kept hogging the CPU.

I narrowed it down to the indexing/building of its db, but i could not figure out why it never completed and would stay at 98-100% for days.

Initially i saw a few forum threads/posts saying that this was the expected behavior when adding a large amount of media (i did add a few TBs), and that it would finish its indexing after a few hours/days depending on the amount of data added.

So i waited a few days, just about a week i would say, but twonky would just keep on staying at 100%.

With the help of this post and the “handle” tool, i was able to find 3 files that for some strange reason couldn’t be indexed, and after stopping/starting the twonkymedia service a few times, removing the files the db was re-built in just an hour or so.

Again thanks.

Regards,

Odd

Glen Ebbage March 28, 2010 at 5:48 am

Bloody brilliant…fixed it for me…..was stuck on only one file. Thanks so much !!

Glen.

Steve March 30, 2010 at 2:35 pm

I had a total of 9 files (all .mpg) that would cause twonky to go wonky. They range in size from 3.5mb to about 500mb. The posts seem sketchy if twonkyvision is working on or has a fix for this; does anyone know for sure? I could upload my smallest mpg for testing if needed….

Alex Kuretz March 30, 2010 at 2:47 pm

@Steve – Thanks for sharing your story. According to Twonky, they have supplied HP with 5.1.3 which fixes the high CPU load issue, however HP continues to ship 5.1.1 so from my understanding HP needs to deliver us an updated version. I gave Twonky my test file and they confirmed it is not a problem in the newer version.

Derek March 31, 2010 at 11:18 pm

Hey there Alex,

Do you know if HP will release the Twonky update anytime soon? This issue is causing my server console to lock-up real bad. I’ve tried fixing the issue remotely with zero success. Thanks!

Alex Kuretz April 1, 2010 at 12:15 am

Sorry, I don’t have any further info from HP.

Marcel April 7, 2010 at 2:02 am

Dear Alex Kuretz
A question for you if you dont mind.

I am looking over the internet for a solution for my ex470,it wil not update i have tryed the update 3.0 patch 2 but it wants the previous version so i tryed 3.0 patch 1 then HPMSS 2.5 this one wants the 2.1 so on.
My server still holds the 10.16.2007 date on update.

thank’s

Christophe April 7, 2010 at 3:02 am

My issue with Twonky is that when I play a song, it takes more than 20 seconds to play. The 3.0 patch 2 fixed my problem with mp3 files but not with AAC.
All AAc files are transcoded to mp3 and cached (it take a lot of space for nothing, my twonky cache is more than 7Go and still grows).
When AAC files are cached : they are played instantly.
My server is a Datavault x510.

Thank’s

Tim Hodgson April 7, 2010 at 4:29 am

Cristophe

My system does the same, perhaps a bit less than 20 secs ( I have upgraded my processor) and depending on the size of the aac file. Interestingly the iPhone app looks ahead so that this only occurs on the first track. I am not sure there is much we can do about this.

Alex Kuretz April 7, 2010 at 9:06 am

@Marcel – these patches are only for systems that are already upgraded to 3.0. See here for more info on ordering the 3.0 update for your EX470.
http://www.mediasmartserver.net/2010/02/22/hp-mediasmart-server-3-0-software-update-available-this-week/

Alex Kuretz April 7, 2010 at 9:08 am

@Christophe – As Tim mentions, the server must transcode your AAC file, and this takes some time. The bug in this article was that the server was transcoding MP3 files that it shouldn’t be transcoding, causing delays and low encoding rates for some files.

Christophe April 7, 2010 at 1:41 pm

Ok but I have also a Twonkymedia 5.1.3 installed on my PC and when I stream music from this PC to my NP2900 it is immediate, AAC files are not transcoded and not cached.

Alex Kuretz April 7, 2010 at 1:46 pm

Ok, could be a difference in 5.1.3 or a difference in the Config files. I describe them above, you could compare them and see.

Marcel April 9, 2010 at 6:44 am

Thank you for your time Alex Kuretz ,i will try it out.

brad April 11, 2010 at 10:19 pm

Folks,

Can’t help but add that i’ve also got these issues and it as really bugging me. Being a new owner I inevitably had the added concern of wondering what I had just put my money down for.

Relieved that I’ve found this page and that it’s a known issue. Can’t wait to try the fixes and have a proper read of this site!

Alex Kuretz April 11, 2010 at 11:03 pm

Thanks Brad, definitely let us know how it works out and post in the forums if you need further assistance than what is covered in the article here.

aphid April 22, 2010 at 9:55 am

Alex,

Thanks for the pointer to “handle” and for the instructions for how to fix that issue. My EX-490 had been experiencing 100% CPU utilization from Twonky whenever it rebooted, leading to slow responsiveness on the UI, constant fan noise, and excessive heat. I had to manually log in and kill Twonky from the Task Manager, but deleting the file has fixed it.

Much appreciated!

-alan

Alex Kuretz April 22, 2010 at 10:06 am

I’m glad the article helped, thanks for sharing your story! :)

aphid April 23, 2010 at 9:14 am

By the way, the file Twonky was having trouble with was an ancient .mpeg file (dated 2002). According to the get-info on my mac, it’s “MPEG Layer 2, MPEG-1 Video.” Plays fine in Quicktime X from local space.

aphid April 23, 2010 at 9:16 am

Oh, and I’m on Patch 3, so the bug hasn’t been eliminated in all cases.

Alex Kuretz April 23, 2010 at 9:24 am

Yeah, Patch 3 resolved the streaming transcode/transrate issue but had no fixes for the high CPU load issue, unfortunately.

dschoemaker1 April 23, 2010 at 1:00 pm

I had this problem, called tech support and they acknowledged the problem, and said they just don’t have a solution for it yet. What they had me do is download the toolkit and use a “handle” program from windows to identify what the hang up was. I then pulled that file into a folder on the server NOT being scanned by twonky. My CPU usage dropped like a rock and the computer was able to process the files correctly…it created the media stream database for songs and photos, which it had not done to date.

There were two ripped movies causing the problem. Jumper and Die Harder. The tech acknowledged this wasn’t the perfect solution, but admitted they didn’t have a perfect slution yet. I’d recommend trying it if your stucks. I was able to find Die Harder was a problem by just going to the Media Collector screen and reading what Twonky was processing. It was stuck on it for quite a while, moving it over worked without going into Toolkit.

I’m going to start converting again and hopefully this won’t happen again.

Don.

Alex Kuretz April 23, 2010 at 1:23 pm

Don, that is the same process I describe above, in fact I suspect HP support got their solution from reading this site. :D I’m glad they were able to help get your server working better.

Derek April 23, 2010 at 9:37 pm

Hey Alex, I cant seem to figure out my issue. Do you mind looking at the pictures from my handle results. Thanks!

http://i209.photobucket.com/albums/bb191/vvgallegos/Untitled2.jpg
http://i209.photobucket.com/albums/bb191/vvgallegos/Untitled-1.jpg

2yahoo.com.au April 24, 2010 at 3:25 am

Hi Alex,
Back again..just cant to say I’ve gotten a bit lazy, just disabled Twonky and stuck with the basic dlna sharing. I did this when I realised I only need MP4 support so I can just wait for the patch. But I have noticed another way of identifying troublesome files…which is moving the folder in question to a temp location. The transfer get stuck on the file in question and reported as being ‘in use’. Perhaps an option for some out there.

Brad April 24, 2010 at 3:26 am

Sorry that’s me 2yahoo above, typo in the name field.

Don April 24, 2010 at 8:50 am

Alex,

Wish HP would put you on consulting status so that this could get fully resolved and we wouldn’t have to resolve to these type of temporary fixes.

I should have noted the emphasis of the post was that they acknowledge the problem… which I was pleased to hear… When I bought the HP mediastream I thought it would be an “out of box” experience. It has been anything but. People like you are the only reason I havn’t sent it back.

Alex Kuretz April 24, 2010 at 2:28 pm

Thanks for the feedback, Don, sorry to hear you’ve had struggles with your server but glad this site could help, it’s why I started it. :)

Gordon M April 25, 2010 at 1:12 am

Hi Alex,

Just to add to the many comments here; I ran through the ‘handle’ solution on an HP EX490 and identified a .VOB file causing Twonky to consume all available CPU. It took a matter of minutes to resolve and your help is again much appreciated! Looking forward to an update from HP on this…

Thanks,

Gordon

JesterEE April 27, 2010 at 9:22 pm

Alex,

Thanks for the help once again. Was able to find the offending files pretty on my server easily with your guide. Has anyone narrowed down on what makes certain files throw Twonky for a loop?

Also, I have been having some audio stuttering problems lately when streaming music. Have you seen that? I don’t know if you read the wegotserved forums (because I hate to double post), but I have a thread started there.

-JesterEE

Alex Kuretz April 27, 2010 at 9:48 pm

JesterEE, the only audio stuttering issues I had were caused by the bad transcoding config I mention in this article that were correct in Patch 3. I’ve also not heard what it is about certain files that freak out Twonky, I’ve not investigated closely but from others comments there doesn’t seem to be a consistent cause. I’m glad the guide helped you!

Ajax23 May 3, 2010 at 4:20 am

He Alex,

i have found a partial solution for mpeg-2 files.
On my MSS (EX490) i’ve had experienced the 100% CPU usage through twonky .
I got an info from a fellow about a application “mpeg corrector”; after i found the files with your “handle”-trick i run the mpeg-corrector.exe against these files and it seems the issue is solved.

The corrector convert the mpeg-2 file to a VCD file so i was not to be able to compare the 2 headers ( e.g. with “MPEG2 Program Test 4″ from http://www.fr-an.de/home/about.htm )

Morpheus.Dreaming May 4, 2010 at 7:59 am

Thank you – you totally fixed this for me. I searched through my Twonky log file to find one video that caused the problem, moved it to the public share, and rebuilt the database. Everything is now good again!

DataKill June 4, 2010 at 3:49 pm

This site is really helpfull, great job Alex.
I is very sad that HP supports its own product like a banana.
The MSS ex495/ DV x510 is a really good solution.
I like my x510 :)

I wonder if it is possible to update Twonky with normal update, since they released 514/515 as WHS.msi

Did anyone tried to update the MSS/DV ?

regards
DK

Alex Kuretz June 6, 2010 at 9:07 am

DataKill, there’s some info on that here: http://www.mediasmartserver.net/forums/viewtopic.php?f=13&t=8226

tarok5 July 10, 2010 at 8:45 am

Thanks for the bullet – I was ready to chunk the box out or recover as this is by no means easy to catch. Muchas Gracias, amigo!

Leave a Comment

{ 4 trackbacks }

Previous post:

Next post: