Jump to content

MBT Not Mounting ISO When Pointing at Synology Based Server


solabc16

Recommended Posts

solabc16

Good Evening

 

I've had Emby server and MBT running successfully on my laptop (Win7 x64) for some time. I recently decided to try and get the server running on my Synology 1815+, as I have a welcome break from work related travelling for a while.

 

Everything was reasonably straight forward and it all worked, except MBT does not mount the ISO image before passing it though to the player (PowerDVD) when pointed at the Synology based server instance.

 

If I point it to my Windows based instance, with path substitution configured to map the file locations to the Synology file share, everything works ok. The problem only appears to happen when pointing at the server running on the Synology box.

 

Here are the log extracts from my attempts at troubleshooting this so far:-

 

Server and Theatre Both Running on Win7 x64 Laptop (WORKS)

 

2015-12-03 23:49:21.7134 Info - App: Mounting C:\Users\james.mercer\Desktop\EmbySrvLocal\Movies\Harry Potter and the Half-Blood Prince (2009)\Harry Potter and the Half-Blood Prince (2009)-dvd1.iso
2015-12-03 23:49:21.7134 Debug - App: Start
2015-12-03 23:49:21.8914 Info - App: C:\Users\james.mercer\Desktop\EmbySrvLocal\Movies\Harry Potter and the Half-Blood Prince (2009)\Harry Potter and the Half-Blood Prince (2009)-dvd1.iso mounted to \\.$DU.pfmfs_7DB\Harry_Potter_and_the_Half_Blood_Prince_2009_dvd1-9
2015-12-03 23:49:21.8914 Info - App: C:\Program Files (x86)\CyberLink\PowerDVD15\Movie\PowerDVD Cinema\PowerDVDCinema.exe "\\.$DU.pfmfs_7DB\Harry_Potter_and_the_Half_Blood_Prince_2009_dvd1-9"

 

Server and Theatre Both Running on Win7 x64 Laptop, Using File Share to Access Local Content Rather Than a Path (WORKS)

2015-12-03 23:50:48.7594 Info - App: Mounting \\ENDOR\Movies\Harry Potter and the Half-Blood Prince (2009)\Harry Potter and the Half-Blood Prince (2009)-dvd1.iso
2015-12-03 23:50:48.7594 Debug - App: Start
2015-12-03 23:50:48.9404 Info - App: \\ENDOR\Movies\Harry Potter and the Half-Blood Prince (2009)\Harry Potter and the Half-Blood Prince (2009)-dvd1.iso mounted to \\.$DU.pfmfs_7DB\Harry_Potter_and_the_Half_Blood_Prince_2009_dvd1-10
2015-12-03 23:50:48.9404 Info - App: C:\Program Files (x86)\CyberLink\PowerDVD15\Movie\PowerDVD Cinema\PowerDVDCinema.exe "\\.$DU.pfmfs_7DB\Harry_Potter_and_the_Half_Blood_Prince_2009_dvd1-10"

 

Server and Theatre Both Running on Win7 x64 Laptop,Path Substitution Used to Access Conent on Synology Share Instead (WORKS)

2015-12-03 23:52:21.7037 Info - App: Mounting \\JFK\EmbyServer\Movies\BDs\Harry Potter and the Half-Blood Prince (2009)\Harry Potter and the Half-Blood Prince (2009)-dvd1.iso
2015-12-03 23:52:21.7037 Debug - App: Start
2015-12-03 23:52:23.0228 Info - App: \\JFK\EmbyServer\Movies\BDs\Harry Potter and the Half-Blood Prince (2009)\Harry Potter and the Half-Blood Prince (2009)-dvd1.iso mounted to \\.$DU.pfmfs_7DB\Harry_Potter_and_the_Half_Blood_Prince_2009_dvd1-11
2015-12-03 23:52:23.0228 Info - App: C:\Program Files (x86)\CyberLink\PowerDVD15\Movie\PowerDVD Cinema\PowerDVDCinema.exe "\\.$DU.pfmfs_7DB\Harry_Potter_and_the_Half_Blood_Prince_2009_dvd1-11"

 

Server Running on Synology, Theatre Running on Win7 x64 Laptop (FAILS)
2015-12-03 23:53:49.5057 Info - App: C:\Program Files (x86)\CyberLink\PowerDVD15\Movie\PowerDVD Cinema\PowerDVDCinema.exe "\\JFK\EmbyServer\Movies\BDs\Harry Potter and the Half-Blood Prince (2009)\Harry Potter and the Half-Blood Prince (2009)-dvd1.iso"
 

Appreciate any advice on how to troubleshoot this further.

 

Best

- James

Edited by solabc16
Link to comment
Share on other sites

solabc16

Hi Luke

 

Thanks for the reply. When I used path substitution to make my Windows based server installation serve up paths to the same content on the Synology box, everything worked correctly? (details above)

 

I've just tried the reverse, having the Synology server installation server up a paths to the Windows based share containing the same content and it also failed in this scenario.

 

The failure to mount the ISO image seems to occur only when the theatre app is pointing at the Synology based instance of the server, content from both locations works correctly when pointing at the Windows instance.

 

Best

- James

Link to comment
Share on other sites

solabc16

Evening

 

I had some time to look at this a little more this evening. In terms of configuration, I've narrowed it down as follows:-

  • Win7 x64 Laptop running Media Browser Theatre
  • Synology Windows Share Hosting Content
  • Win7 x64 Laptop running Media Browser Server
  • Synology DS1815+ running Media Browser Server

To recap, when the movie is launched from MBT connected to the Windows instance of the server, everything works as expected.The ISO is mounted and successfully passed through to PowerDVD, which we can see in the logs:-

 

Info - App: Mounting \\JFK\EmbyServer\Movies\BDs\Harry Potter and the Half-Blood Prince (2009)\Harry Potter and the Half-Blood Prince (2009)-dvd1.iso
Debug - App: Start
Info - App: \\JFK\EmbyServer\Movies\BDs\Harry Potter and the Half-Blood Prince (2009)\Harry Potter and the Half-Blood Prince (2009)-dvd1.iso mounted to \\.$DU.pfmfs_7DB\Harry_Potter_and_the_Half_Blood_Prince_2009_dvd1-11
Info - App: C:\Program Files (x86)\CyberLink\PowerDVD15\Movie\PowerDVD Cinema\PowerDVDCinema.exe "\\.$DU.pfmfs_7DB\Harry_Potter_and_the_Half_Blood_Prince_2009_dvd1-11"

 

When MBT is connected to the Synology instance of the server, PowerDVD is launched but fails due to it being passed the path to the ISO file itself. This can also be seen in the logs, with the single entry:-

 

Info - App: C:\Program Files (x86)\CyberLink\PowerDVD15\Movie\PowerDVD Cinema\PowerDVDCinema.exe "\\JFK\EmbyServer\Movies\BDs\Harry Potter and the Half-Blood Prince (2009)\Harry Potter and the Half-Blood Prince (2009)-dvd1.iso"

 

I fired up Wireshark to see what was happening, but was only able to see PowerDVD probing for valid content. When launching from the Windows based instance of the server, Wireshark simply reveals the file being streamed as would be expected.

 

So the issue appears to be that the ISO is not being mounted by MBT when launched from Emby server running on the Synology platform. I'm running MBT with debug logging enabled, but no additional errors or debug information seems to be being logged.

 

Any suggestions on how to debug/troubleshoot further appreciated.

 

Best

- James

 

5664cc7f8ce9d_synology_isofails.png

Link to comment
Share on other sites

  • 2 weeks later...
solabc16

Evening

 

Another look this evening, trying to get to the bottom of this problem. I decided to take a look at the request/response between Theatre and Server, to see if there were any differences.

 

As far as the path being returned is concerned, there is no difference.

 

NAS

 

56736fe0ebbb4_Fiddler_NAS.png

 

WinPC

 

5673702dea51d_Fiddler_WinPC.png

 

Still trying to figure out why Theatre does not mount the ISO before passing it to the external player when pointing to the Synology hosted server.

 

Best

- James

Link to comment
Share on other sites

solabc16

Hi Luke

 

More details in my first post, but this is all that is logged when pointing at the Synology based server:-

 

2015-12-03 23:53:49.5057 Info - App: C:\Program Files (x86)\CyberLink\PowerDVD15\Movie\PowerDVD Cinema\PowerDVDCinema.exe "\\JFK\EmbyServer\Movies\BDs\Harry Potter and the Half-Blood Prince (2009)\Harry Potter and the Half-Blood Prince (2009)-dvd1.iso"

 

No errors, warnings or additional debug.

 

I've just been looking at the requests/responses in more detail and although the paths are the same, not all of the properties returned are identical.

 

For example, the ISO type and container name differs between the Windows and Synology based server instances.

 

Could this be causing Theatre to not recognise the media type and hence not trigger its ISO mounting funtion?

 

Best

- James

Edited by solabc16
Link to comment
Share on other sites

solabc16

Evening

 

I've attached the trace files from Fiddler, along with a comparison of what is returned in the "MediaSources" section of the response by the two instances of the server.

 

WINDOWS

"MediaSources":[{
    "Protocol":"File",
    "Id":"c5dcad70ef53858624aab9397593b4d3",
    "Path":"\\\\JFK\\EmbyServer\\Movies\\BDs\\Harry Potter and the Half-Blood Prince (2009)\\Harry Potter and the Half-Blood Prince (2009)-dvd1.iso",
    "Type":"Default",
    "Container":"iso",
    "Name":"Bluray",
    "ReadAtNativeFramerate":false,
    "SupportsTranscoding":true,
    "SupportsDirectStream":false,
    "SupportsDirectPlay":true,
    "RequiresOpening":false,
    "RequiresClosing":false,
    "VideoType":"Iso",
    "IsoType":"BluRay",
    "MediaStreams":[],
    "PlayableStreamFileNames":[],
    "Formats":[],
    "RequiredHttpHeaders":{}
}]

SYNOLOGY

"MediaSources":[{
    "Protocol":"File",
    "Id":"1d14a870c79ee022e482624ec612c993",
    "Path":"\\\\JFK\\EmbyServer\\Movies\\BDs\\Harry Potter and the Half-Blood Prince (2009)\\Harry Potter and the Half-Blood Prince (2009)-dvd1.iso",
    "Type":"Default",
    "Container":"iso",
    "Name":"ISO",
    "ReadAtNativeFramerate":false,
    "SupportsTranscoding":true,
    "SupportsDirectStream":false,
    "SupportsDirectPlay":true,
    "RequiresOpening":false,
    "RequiresClosing":false,
    "VideoType":"Iso",
    "MediaStreams":[],
    "PlayableStreamFileNames":[],
    "Formats":[],
    "RequiredHttpHeaders":{}
}]
 

Best

- James

 

GET_Item_Windows.txt

GET_Item_Synology.txt

Media_Sources_Comparison.txt

Link to comment
Share on other sites

solabc16

Ok, so this takes us a little bit closer, which we can trace back to the source @ https://github.com/MediaBrowser/MediaBrowser.IsoMounting/blob/master/MediaBrowser.IsoMounting.Linux/LinuxIsoManager.cs

 

tail -n 50 server-63585993600.txt
    *** Error Report ***
    Version: 3.0.5781.5
    Command line: /usr/local/emby/share/emby/MediaBrowser.Server.Mono.exe -programdata /usr/local/emby/var -ffmpeg /usr/local/ffmpeg/bin/ffmpeg -ffprobe /usr/local/ffmpeg/bin/ffprobe
    Operating system: Unix 3.10.35.0
    Processor count: 4
    64-Bit OS: True
    64-Bit Process: True
    Program data path: /usr/local/emby/var
    Mono: 4.2.1 (Stable 4.2.1.102/6dd2d0d Mon Nov 30 14:47:31 CET 2015)
    Application Path: /volume1/@appstore/emby/share/emby/MediaBrowser.Server.Mono.exe
    Missing mount, umount or sudo. Unable to continue
    System.IO.IOException
      at MediaBrowser.IsoMounter.LinuxIsoManager+<Mount>c__async0.MoveNext () <0x412647a0 + 0x00153> in <filename unknown>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x40e2dc80 + 0x0002b> in <filename unknown>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x41266330 + 0x000d3> in <filename unknown>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x41266280 + 0x00097> in <filename unknown>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x40bcc520 + 0x0003b> in <filename unknown>:0
      at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () <0x40c019f0 + 0x00017> in <filename unknown>:0
      at MediaBrowser.Providers.MediaInfo.FFProbeVideoInfo+<ProbeVideo>d__0`1[T].MoveNext () <0x41262f70 + 0x0043f> in <filename unknown>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x40e2dc80 + 0x0002b> in <filename unknown>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x41266330 + 0x000d3> in <filename unknown>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x41266280 + 0x00097> in <filename unknown>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x40bcc520 + 0x0003b> in <filename unknown>:0
      at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () <0x40e82cf0 + 0x00013> in <filename unknown>:0
      at MediaBrowser.Providers.Manager.MetadataService`2+<RunCustomProvider>d__52[TItemType,TIdType].MoveNext () <0x410e74f0 + 0x004f3> in <filename unknown>:0
 

- James

Link to comment
Share on other sites

Right - because the IsoType is not populated by the server, the client doesn't know what kind of ISO it is and therefore can't play it.

 

To be honest, I'm not sure about the future of the server-side ISO mounting feature. The linux support for it was built by a community member but it came with one major drawback - that the server has to run as sudo in order to use it. Since almost nobody is going to want to run their server like that, that means hardly anyone is using it which also means hardly anyone is helping to test or maintain it.

 

Unfortunately right now I don't have a quick solution for you unless you can run as sudo. You might want to consider an external player that is capable of handling the ISO without requiring any mounting. Alternatively, you could write some script, use that script as your external player, and have the script mount the ISO then launch the real player.

Link to comment
Share on other sites

solabc16

Hi Luke

 

Thanks for the feedback. I can appreciate what they've done, and taking advantage of and/or chaining existing utilities is - for want of a better phrase, a very *NIXy way of doing things.

 

So the problem here is happening during the library scan on the server side, resulting in a number of the object properties not being set or defaulted.

 

I'll have a look at what needs to be done (if it can be), to get this running ok as it is on the Synology platform; I'll update this thread with my findings.

 

ISOs, in my opinion at least, still have a role to play as they allow functionality that can't currently be replicated by alternate options; which is why I still use them as my primary source.

 

On the Theatre side, is there anyway to configure the external player to just play any file that is an ISO, regardless of its sub-type?

 

i.e. do not worry if it's a Bluray, DVD, etc. just always mount the source if it's an ISO - which we do know from the Container and/or VideoType in both scenarios.

 

Best

- James

Link to comment
Share on other sites

If you take a look here you can see the notes written by the person who built the iso mounting, in case they might be helpful:

 

http://emby.media/community/index.php?/topic/3634-linux-setup/

 

the big problem is that I can tell you that none of the package builders for any of our distros are actually testing that procedure. That's why I'm not sure we're going to be able to continue to offer the server-side mounting feature, but we can at least offer the ability to designate what type of iso it is.

Link to comment
Share on other sites

solabc16

Evening

 

Ok, so some reasonable progress. In summary, so far...

 

1) Install ipkg on the Synology box (https://forum.synology.com/wiki/index.php/Overview_on_modifying_the_Synology_Server,_bootstrap,_ipkg_etc)

 

2) Install sudo on the Synology box (http://nas.deadcode.net/2009/08/26/install-sudo-on-diskstation/)

 

3) Edit sudoers with the following (for now)...

## Entries Added for Emby Server Support

Defaults:emby !requiretty
emby ALL=(root) NOPASSWD: /bin/mount
emby ALL=(root) NOPASSWD: /bin/umount
emby ALL=(root) NOPASSWD: /usr/bin/mount
emby ALL=(root) NOPASSWD: /usr/bin/umount

4) Create a symbolic link for umount...

ln -sf ../../bin/busybox /usr/bin/umount

5) Create a script for mount in /usr/bin, making it executable with chmod a+x ./mount...

cat /usr/bin/mount

#!/bin/sh
/bin/busybox mount -o loop -t iso9660 "$1" "$2"

The reason for (5), is that the implementation of mount as supplied by Synology does not autodetect the type correctly. The -o argument is provided for completeness, but has proved to not be necessary. As the '-t' argument should be consistent across *NIXes, it might be worth considering adding this to command line built by LinuxIsoManager.

 

So far, this is working properly for DVD sources and those which I have refreshed manually in the metadata manager now play without issue in Theatre.

 

Blurays are not mounting correctly, I'll take a look at that tomorrow.

 

Luke, I noticed that the error strings currently being generated by the LinuxIsoManager are not consistent with the latest source at https://github.com/MediaBrowser/Emby.IsoMounting/blob/master/MediaBrowser.IsoMounting.Linux/LinuxIsoManager.cs- are you in the process of updating this?

 

Best

- James

Link to comment
Share on other sites

  • 5 weeks later...
solabc16

Evening

 

Apologies for the delay in posting some more updates on this topic. So there was the problem with Blu-ray discs, which I mentioned in my last post.

 

I also discovered during testing that loop devices weren't being released, which eventually resulted in a failure.

 

Both of these I've been able to resolve, details as follows.

 

  • Same approach for umount taken as for mount, i.e. an exectuable script in /usr/bin/, allowing the command line to be set accordingly.
  • Alternative options in the mount script, in the event that the mount attempt fails.

 

So here are the scripts I've been working with...

cat /usr/bin/mount

#!/bin/sh

#
# Attempt to mount the file as ISO9660 (DVD)
#

/bin/busybox mount -r -o loop -t iso9660 "$1" "$2" > /dev/null 2>&1

if [ $? -eq 0 ]
then
  echo "Successfully mounted file as ISO9660."
  exit 0
else
  echo "Could not mount the file as ISO9660, trying UDF..."
fi

#
# Attempt to mount the file as UDF (BD)
#

/bin/busybox mount -r -o loop -t udf "$1" "$2" > /dev/null 2>&1

if [ $? -eq 0 ]
then
  echo "Successfully mounted file as UDF."
  exit 0
else
  echo "Could not mount the file as UDF, giving up."
fi

#
# If we get here, we've failed to mount the file.
#

exit 1

...and...

cat /usr/bin/umount

#!/bin/sh

#
# Attempt to unmount the file and free the loop device.
#

/bin/busybox umount -d "$1" > /dev/null 2>&1

if [ $? -eq 0 ]
then
  echo "Successfully unmounted file."
  exit 0
else
  echo "Could not unmount the file, giving up."
fi

#
# If we get here, we've failed to unmount the file.
#

exit 1

As I mentioned previously, the wrapper in itself works reasonably well as a solution and provides a well defined interface. It could perhaps be improved by making the scripts part of the solution, with a known path local to the Emby Server installation, rather than looking for and coding against specific paths/command line switches - which is always likely to be fragile.

 

I'm happy to take a look at this and see if we can make some improvements in this area. I've been working with this now for a few weeks on the Synology platform, and we seem to be in a better place now.

 

Best

- James

Link to comment
Share on other sites

  • 1 month later...
solabc16

Evening

 

Updated scripts as a result of discussion here: http://emby.media/community/index.php?/topic/32037-metadata-and-library-scan-broken-on-v3058710/?p=307112

 

MOUNT

#!/bin/sh

#
# Attempt to mount the file as ISO9660 (DVD)
#

/bin/busybox mount -r -o loop -t iso9660 "$1" "$2" > /dev/null 2>&1

if [ $? -eq 0 ]
then
  echo "Successfully mounted file as ISO9660."
  sleep 3s
  exit 0
else
  echo "Could not mount the file as ISO9660, trying UDF..."
fi

#
# Attempt to mount the file as UDF (BD)
#

/bin/busybox mount -r -o loop -t udf "$1" "$2" > /dev/null 2>&1

if [ $? -eq 0 ]
then
  echo "Successfully mounted file as UDF."
  sleep 3s
  exit 0
else
  echo "Could not mount the file as UDF, giving up."
fi

#
# If we get here, we've failed to mount the file.
#

exit 1

UMOUNT

#!/bin/sh

#
# Attempt to unmount the file and free the loop device.
#

/bin/busybox umount -d "$1" > /dev/null 2>&1

if [ $? -eq 0 ]
then
  echo "Successfully unmounted file."
  sleep 3s
  exit 0
else
  echo "Could not unmount the file, giving up."
fi

#
# If we get here, we've failed to unmount the file.
#

exit 1

Best

- James

Link to comment
Share on other sites

  • 2 months later...
solabc16

Evening

 

I've revisited this issue today, in light of DSM6's arrival. The good news is the updated implemenation by Synology resolves all of the previous issues, so with the exception of the point below none of the above steps need to be applied.

 

You do however still need to update your sudoers file, details below for convenience - please treat this file with all due respect.

 

Add the following to the end of your /etc/sudoers file...

## Entries Added for Emby Server Support

Defaults:emby !requiretty
emby ALL=(root) NOPASSWD: /bin/mount
emby ALL=(root) NOPASSWD: /bin/umount
emby ALL=(root) NOPASSWD: /usr/bin/mount
emby ALL=(root) NOPASSWD: /usr/bin/umount

And for reference, here is the check showing the mount/umount process and loop device being freed correctly:-

 

573399117a109_losetup5.png

 

5733991d5942d_losetup6.png

 

5733938549683_losetup1.png

 

573393939797e_losetup2.png

 

The end result being the media information is now being correctly reported in ET (and other apps):-

 

57339402c40ca_losetup3.png

 

5733941a77f5c_losetup4.png

 

- James

Edited by solabc16
  • Like 1
Link to comment
Share on other sites

Well done James!

 

I convert most of my media ISO's, but sure someone will find this as helpful.

Link to comment
Share on other sites

solabc16

Thanks. There are certain titles where I don't want to lose the extra content and the effort required to reconstruct it any other way is just not worth it.

 

So for these cases, the ISO format fits the bill and works perfectly when coupled with a mapping to an external player in ET.

 

- James

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...