WHS (A solution for the HP Media Streamer issue)

General discussion about the media server. Feature requests. Hints, tips and tricks.
Locked
User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag
WHS (A solution for the HP Media Streamer issue)

Post by phibertron » Wed Mar 09, 2011 11:28 pm

If you are an owner of an HP MediaSmart Server, you know all to well
that it and the many other devices out there come pre-installed with Twonky Server
which is great, except when the device manufacturer doesnt heep their versions up to date
with the current versions available from Twonky directly
In addition to this, the versions that come pre-installed are not upgragable by the user
unless that user has there own key, as the pre-intalled versions are usually keyless versions

But, if you are willing to purchase your own key, then the upgrade path is a lot easier
With one huge exception when it comes to the HP Mediasmart server
It being a windows home server, has all these extended capabilities
One of them is HP Media Streamer for Music, Photo, and Video
This feature is actually a frontend to the pre-installed Twonky Server
The most recent version of Twonky Server from HP is version 5.1.1
Anything beyond that is not guarenteed to work with the HP Media Streamer frontend
So say you instlaled the newest version of Twonky Server, the HP Media Streamer would no longer work
Note that the Twonky server itself is fine, and will run and act as normal for what ever version you installed
So basically your stuck with either not upgrading, and not getting fixes or new features
or you upgrade and lose the HP Media streamer abilities

Based on some known configuration abilities of Twonky Server,
It is possible to run more than one instance, which might be able to solve the problem for the most part
I did a lot fo testing in that regard and did come up with a working solution to deal with the HP MediaSmart Media Streamer issue

Follow along with me as I show you how to put the HP version into stealth mode,
and then do a hand install of the current version of Twonky for use on your local network
running as a second instance on port 9001

Note: You are going to need to have access to the desktop of the server
which you can get through the use of the windows remote desktop client
wrote: 1.
Set the HP version to not broadcast itself via UPNP on the network
By editing the registry with regedit to add the -nossdp switch to the service

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TwonkyMedia]
C:\TwonkyMedia\twonkymedia.exe -serviceversion 0 -nossdp
wrote: 2.
WARNING!!!
Do not run the twony setup.exe on the homeserver
As it will alter the registry and files need to keep the current HP Twonky 5.1.1 working
You were warned, though it is reverable, with a lot of work

What I did was run the twonky setup locally on my pc or in a vm if you have to work with
Once youve done that, make a copy of the following folder C:\Program Files\TwonkyMedia
and copy it to the HP MediaSmart server
so that C:\Program Files\TwonkyMedia exists there also
wrote: 3.
Open a command prompt
and change to the twonky directory, CD C:\Program Files\TwonkyMedia
and the type this command, twonkymediaserverwatchdog.exe -install 1
Warning!!!
If you forget the -install 1 part or just used -install without the 1
its game over, it would overwrite things
wrote: 4.
So now the second instance is installed and running
completely independent of the HP Version
You are going to need to go configure it
with your key, media shares, and any other settings you want
To access this instance, it is now running on http: //yourserver:9001
Hopefully that wasnt too hard =)

Here are a few things to make note of:

- You now have to servers to manage, which could be a good thing
The web streaming and local streaming are now two seperate twonky services

- The HP Version of Twonky 5.1.1 is not showing on your network,
which you do not need to do in any way, just dont add the -nossdp switch
I do it so that I wont have to see it,
but it is still web accessable from http: //yourserver:9000
There is one other way to make it stealthy,
and that is to set its ip=127.0.0.1 in the ini
but you could then not get to http: //yourserver:9000 if you did this
unless you were at localhost ( on the desktop )

- The Hp Version is not going to benefit from the other instance
it is just being left there to allow for the HP Media Streamer to still work
But you are gaining the advatanges of the newer twonky on your local network

- Running two instances uses more memory and more cpu on server startup
but as long as your not streaming from the HP Media Streamer
it will just sit there, and you wouldnt even know its there

- If you want to learn a little more about multiple instances, go here
http://twonkyforum.com/viewtopic.php?f=2&t=9408

- If you want to learn a little more about creating custom navtrees go here
http://twonkyforum.com/viewtopic.php?f=2&t=9353
Last edited by phibertron on Thu Mar 10, 2011 12:02 am, edited 1 time in total.
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Notes: Here are copies of the registry keys

Post by phibertron » Wed Mar 09, 2011 11:43 pm

In case you mess anything up while editing the registry
or wanted to know what keys were created by the second instance

This is the key for the original twonky version 5.1.1

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TwonkyMedia]
"Type"=dword:00000010
"Start"=dword:00000002
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):43,00,3a,00,5c,00,54,00,77,00,6f,00,6e,00,6b,00,79,00,4d,00,\
  65,00,64,00,69,00,61,00,5c,00,74,00,77,00,6f,00,6e,00,6b,00,79,00,6d,00,65,\
  00,64,00,69,00,61,00,2e,00,65,00,78,00,65,00,20,00,2d,00,73,00,65,00,72,00,\
  76,00,69,00,63,00,65,00,76,00,65,00,72,00,73,00,69,00,6f,00,6e,00,20,00,30,\
  00,00,00
"DisplayName"="TwonkyMedia"
"ObjectName"="LocalSystem"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TwonkyMedia\Security]
"Security"=hex:01,00,14,80,b8,00,00,00,c4,00,00,00,14,00,00,00,30,00,00,00,02,\
  00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
  00,00,02,00,88,00,06,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\
  05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\
  20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,04,00,00,00,00,\
  00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,06,00,00,00,00,00,14,00,00,01,\
  00,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,00,18,00,fd,01,02,00,01,02,00,\
  00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,00,00,00,00,00,05,12,00,00,00,\
  01,01,00,00,00,00,00,05,12,00,00,00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TwonkyMedia\Enum]
"0"="Root\\LEGACY_TWONKYMEDIA\\0000"
"Count"=dword:00000001
"NextInstance"=dword:00000001
This is the key for the original twonky version 5.1.1 with the -nossdp added

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TwonkyMedia]
"Type"=dword:00000010
"Start"=dword:00000002
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):43,00,3a,00,5c,00,54,00,77,00,6f,00,6e,00,6b,00,79,00,4d,00,\
  65,00,64,00,69,00,61,00,5c,00,74,00,77,00,6f,00,6e,00,6b,00,79,00,6d,00,65,\
  00,64,00,69,00,61,00,2e,00,65,00,78,00,65,00,20,00,2d,00,73,00,65,00,72,00,\
  76,00,69,00,63,00,65,00,76,00,65,00,72,00,73,00,69,00,6f,00,6e,00,20,00,30,\
  00,20,00,2d,00,6e,00,6f,00,73,00,73,00,64,00,70,00,00,00
"DisplayName"="TwonkyMedia"
"ObjectName"="LocalSystem"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TwonkyMedia\Security]
"Security"=hex:01,00,14,80,b8,00,00,00,c4,00,00,00,14,00,00,00,30,00,00,00,02,\
  00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
  00,00,02,00,88,00,06,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\
  05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\
  20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,04,00,00,00,00,\
  00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,06,00,00,00,00,00,14,00,00,01,\
  00,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,00,18,00,fd,01,02,00,01,02,00,\
  00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,00,00,00,00,00,05,12,00,00,00,\
  01,01,00,00,00,00,00,05,12,00,00,00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TwonkyMedia\Enum]
"0"="Root\\LEGACY_TWONKYMEDIA\\0000"
"Count"=dword:00000001
"NextInstance"=dword:00000001
These are the keys created during the install of the second instance

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List]
"C:\\Program Files\\TwonkyMedia\\twonkymediaserverwatchdog.exe"="C:\\Program Files\\TwonkyMedia\\twonkymediaserverwatchdog.exe:*:Enabled:TwonkyMedia"
"C:\\Program Files\\TwonkyMedia\\twonkymediaserver.exe"="C:\\Program Files\\TwonkyMedia\\twonkymediaserver.exe:*:Enabled:TwonkyMediaServer"

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_TWONKYMEDIA-1]
"NextInstance"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_TWONKYMEDIA-1\0000]
"Service"="TwonkyMedia-1"
"Legacy"=dword:00000001
"ConfigFlags"=dword:00000000
"Class"="LegacyDriver"
"ClassGUID"="{8ECC055D-047F-11D1-A537-0000F8753ED1}"
"DeviceDesc"="TwonkyMedia-1"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_TWONKYMEDIA-1\0000\Control]
"*NewlyCreated*"=dword:00000000
"ActiveService"="TwonkyMedia-1"

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TwonkyMedia-1]
"Type"=dword:00000010
"Start"=dword:00000002
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,\
  20,00,46,00,69,00,6c,00,65,00,73,00,5c,00,54,00,77,00,6f,00,6e,00,6b,00,79,\
  00,4d,00,65,00,64,00,69,00,61,00,5c,00,74,00,77,00,6f,00,6e,00,6b,00,79,00,\
  6d,00,65,00,64,00,69,00,61,00,73,00,65,00,72,00,76,00,65,00,72,00,77,00,61,\
  00,74,00,63,00,68,00,64,00,6f,00,67,00,2e,00,65,00,78,00,65,00,20,00,2d,00,\
  73,00,65,00,72,00,76,00,69,00,63,00,65,00,76,00,65,00,72,00,73,00,69,00,6f,\
  00,6e,00,20,00,31,00,00,00
"DisplayName"="TwonkyMedia-1"
"ObjectName"="LocalSystem"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TwonkyMedia-1\Security]
"Security"=hex:01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,\
  00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
  00,00,02,00,60,00,04,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\
  05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\
  20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,\
  00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,\
  00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TwonkyMedia-1\Enum]
"0"="Root\\LEGACY_TWONKYMEDIA-1\\0000"
"Count"=dword:00000001
"NextInstance"=dword:00000001
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Re: WHS (A solution for the HP Media Streamer issue)

Post by phibertron » Thu Mar 10, 2011 12:41 am

And if you really really borked things up

You could download the latest patches again and reinstall them

http://h10025.www1.hp.com/ewfrf/wc/soft ... 48165#N148
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Re: WHS (A solution for the HP Media Streamer issue)

Post by phibertron » Thu Mar 10, 2011 1:40 am

I forgot to add my "theories" on why I think the newer versions dont work with the HP Media Streamer directly

1.
The 5.x versions for the most part are using twonkymediaserver.exe
as a service to launch twonkymedia.exe (which is the server)

twonkymediaserver.exe is like the current watchdog exe in 6.x

I think that somewhere in the app that HP wrote,
it is making "hardcoded" calls to "twonkymedia.exe"
This is just a guess though
and this is where it probably fails
because in the 6.x twonkymedia.exe doesnt exist
and to makes things more complicated, they use the name of the prior watchdog
as the name of the streaming service in 6.x

2.
It is also possible that the HP Media Streamer is making calls
that dont exist in the 6.x version, or not in the right format
meaning that the file names and services dont matter
but the get data and return data are out of whack

Its hard to say which or if both are true
I have done some experiments where I tried to rename and move things arounf
to see If I could get it to work with newer versions
But what usually happens, I just make it so twonky doesnt start

I any case, the solution I proposed, does allow the HP Media Streamer to work
and you get the benefit of it on the LAN
The only thing that the HP app could gain from the newer versions
is performance and stability
In that the Hp app being hardcoded, cant really do much more than it does already
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Re: WHS (A solution for the HP Media Streamer issue)

Post by phibertron » Fri Mar 11, 2011 1:36 am

I can confirm that version 5.1.6 does NOT break the HP Media Streamer
But of course you'll need your own key to do that
It is interesting to note that in this version, the filenames are using the same context as the 6.x version is now

twonkymediaserver.exe
twonkymediaserverwatchdog.exe

So in my previous post, I was fiddleing around with that idea to see what names the HP app didnt like
And thats not it

Its now on to try to see if I can decompile the HP Medis Streamer SWF file
to see if there is a hard coded call in there somewhere
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Re: WHS (A solution for the HP Media Streamer issue)

Post by phibertron » Mon Apr 04, 2011 5:42 pm

In some further refinement of the process
I wanted to point the directory that twonky is using to store all of its data
By default it is using the following directory

C:\Documents and Settings\All Users\Application Data\TwonkyMedia

I went digging around and found some references to the appdata switch
like the nossdp switch it isnt something we can use in the ini
but it is something we can use on startup by adding -appdata c:\twonkymedia\appdata
to the following registry key
I was able to make it all point to c:\twonkymedia\appdata
It is also interesting to note, that say c:\twonkymedia\appdata didnt exist
It would create it and use the settings from twonkymedia-server-default.ini
to create the twonkymedia-server.ini with relative path's and settings
which is the purpose of twonkymedia-server-default.ini
wrote: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TwonkyMedia]
C:\TwonkyMedia\twonkymedia.exe -serviceversion 0 -appdata c:\twonkymedia\appdata -nossdp

Though, I did find some other things that need to be redirected
that should have done so with the method
TwonkyMediaServer-log.txt and bgtrans-log.txt
some how still want to go to C:\Documents and Settings\All Users\Application Data\TwonkyMedia

I figured out the logfile one, by adding the -logfile switch
wrote: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TwonkyMedia]
C:\TwonkyMedia\twonkymedia.exe -serviceversion 0 -appdata c:\twonkymedia\appdata -logfile c:\twonkymedia\appdata\TwonkyMediaServer-log.txt -nossdp
But I havent found a switch for bgtrans-log.txt redirection

And the last thing is, even with all this
if C:\Documents and Settings\All Users\Application Data\TwonkyMedia doesnt exist, it creates it
but does not add anything to it
so there must be a few more things that might be needed to the startup switches for full redirection
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

Locked