INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Tips for having parts of my media collection off line.  (Read 1563 times)

Spike1000

  • Citizen of the Universe
  • *****
  • Posts: 641
Tips for having parts of my media collection off line.
« on: February 05, 2019, 03:13:22 am »

My video collection is too big for a single disk drive so part of it lives on my NAS; my NAS is not powered on all the time. I have 'Fix broken links Yes (protect files on missing drives) set so I don't have any issues with files going missing. I do, however, have issues with MC 'timing out' or 'waiting' for extended periods of time when an operation or click involves a file that's not present as the NAS is powered off. My current setup is really unworkable in its current state  :(

Are there any tips/settings to make MC more 'tolerant' of files that are temporarily absent?

Spike

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10935
Re: Tips for having parts of my media collection off line.
« Reply #1 on: February 05, 2019, 12:02:52 pm »

Missing network resources will always be problematic since every access, even to see if its currently available, will result in Windows trying to connect to the device, and then timing out - which is just slow.

The most likely option that would not cause frequent disruptions would be using a mapped network drive, and actually removing that mapping when the NAS is off, so that the entire drive is missing, and not visible to either MC or the OS at all. Of course this also means you have to manually re-map the drive when you turn the NAS on, which is a bit cumbersome. But as long as the drive is still visible in Windows, even if in a disconnected state, Windows itself will try to probe the network for it as soon as an app just asks the most basic questions about it (like, "Are you there?"), which results in such delays.

Basically, a network resource thats only part-time available is really bad for performance, since both MC and Windows are rather eager to reconnect to it whenever they can - which is usually a good thing, since there is plenty causes for intermittent connection losses.
Logged
~ nevcairiel
~ Author of LAV Filters

xpto

  • Recent member
  • *
  • Posts: 32
Re: Tips for having parts of my media collection off line.
« Reply #2 on: February 06, 2019, 02:21:45 pm »

Spike,

I have a setup similar to yours and faced the same frustration when my NAS was turned off. It can be very annoying to be interrupted constantly by long timeouts (10 seconds and more) while MC is frozen in the foreground not allowing user interaction.

Here is a workaround that I got from user "zybex" here from the forum. Kudos to zybex!

Idea is to have your NAS name resolution pointing to 127.0.0.1 to trick MC to think your NAS is indeed your own localhost - this of course while your NAS is powered down. If your NAS is up then the mapping NAS to 127.0.0.1 should not exist.

If you are on a Windows system, do this:

1. Download and install "Hosts File Editor" from:

https://github.com/scottlerch/HostsFileEditor/releases (download the .msi file)

2. Start "Hosts File Editor" - check icon on the notification area (those little icons in the taskbar close to the clock)

Note that any app that changes the „hosts“ file needs „Admin“ privilege so be sure to allow it on the UAC prompt that appears.

3. Press "Edit" and add a line where "IP Address" is 127.0.0.1 and "Host names" is <YOUR NAS NAME>

4. Press Save.

Now use MC and check if the "timing outs" as you describe are gone.

For extra credit, you can use the function "Disable Hosts File" and swap between:

- having the workaround in place (when your NAS is down)
- not having the workaround in place (when your NAS is up)

It is easily accessible with the right mouse button on the application's icon in the notification area.

All what is above is a workaround.

As for the original problem, a solution can only come from the devs. Probably MC's code is waiting synchronously from an ioctl() or similar operation to finish. It is actually not checking to access a particular file. It is checking if the host is up or not. Maybe the devs can confirm how it is exactly implemented. Would changing to wait asynchronously be a solution and we would not see the timeouts affecting user experience? Only the devs can test and check if that's the solution.

In the meantime, enjoy the workaround.

Thanks to zybex one more time!

xpto
Logged

~OHM~

  • Citizen of the Universe
  • *****
  • Posts: 1825
  • "I Don't Play The Music The Music Plays Me"
Re: Tips for having parts of my media collection off line.
« Reply #3 on: February 06, 2019, 04:58:43 pm »

Great tip...thanks to both of you!  :)
Logged
“I've Reached A Turning Point In My Life. I Now Realize I Have More Yesterdays Then Tomorrows”

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Tips for having parts of my media collection off line.
« Reply #4 on: February 06, 2019, 06:05:49 pm »

You're welcome :)

For simpler usage, you can create 2 desktop shortcuts: "NAS Enabled" and "NAS disabled" - each runs a script/tool to change the HOSTS file accordingly. I don't have examples for these, but it's trivial to do in Perl/Python/etc. One nagging part is that the scripts need to run as administrator to be able to modify HOSTS, so you'll always get the Windows security prompt.
Logged

Spike1000

  • Citizen of the Universe
  • *****
  • Posts: 641
Re: Tips for having parts of my media collection off line.
« Reply #5 on: February 07, 2019, 03:06:52 am »

Thanks for the tip, will look into that.

I've been thinking about the problem and the workarounds are all sort of OS based. By this you're doing things at the OS level with scripts, apps, keyboard and mouse etc. All pretty inconvenient as I'd be typically be using the '10 foot interface' to navigate my film video collection. I have come to the conclusion that MC really needs an option to (at least) temporarily ignore a drive letter (or similar) via simple menu option toggle. Needing to visit the 'OS' spoils the UX and makes the product just a windows 'application' not a complete media player solution. I don't really want to use a keyboard and mouse when using MC. I run one MC instance headless on windows and it's pretty awful, there's just too many things going wrong that need terminal services intervention or reboots to restore connectivity. It's certainly not a seamless experience  :(

I tried to play a high bitrate FLAC on it last night, the bitrate was greater than the DAC could manage, utter disaster. Long story short; the client lost its config, skin and link to the database!!!! Quick solution restore a MC backup, but I had to traipse up and down stairs rebooting MC Server and Client and then use Terminal Services to get in and fix everything. I can fix the problem from happening again, but it's more under the bonnet tinkering; I really want MC to 'just work' and not rely on endless tinkering. I can see why people choose propriety solutions like Sonos. . .

Spike

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Tips for having parts of my media collection off line.
« Reply #6 on: February 07, 2019, 05:39:06 am »

True, you have to commit some time to JRiver to have it working as required. Your FLAC playback issue causing the loss of client config seems unrelated, weird issue.

Regarding this solution for the networking issues, it can be automated with a script running on a loop or on a schedule. In metacode:

Code: [Select]
Loop:
  if (ping <myNASIP> == SUCCESS)
     <remove myNAS entry from HOSTS file>
  else
     <add "127.0.0.1 myNAS" to HOSTS
  sleep(60);

simple really :)
Logged

Spike1000

  • Citizen of the Universe
  • *****
  • Posts: 641
Re: Tips for having parts of my media collection off line.
« Reply #7 on: February 07, 2019, 07:44:00 am »

Your FLAC playback issue causing the loss of client config seems unrelated, weird issue.

Oh, it's certainly unrelated  :), but it's a symptom of MC needing a lot of tinkering and even then it still bites you in the bum  :o

MC is complex, trying to have the same complexity over a 'media network' on devices the application author's don't have direct control over is very hard. I wonder if there's a opening keeping the complexity in the server but having a much simpler client option. Panel is doing that for the interface, maybe there could be a 'thin' client (renderer?) that simply is controlled by the server and plays/displays what it's sent? Zones do that now but my system often gets it knickers in a twist and when it falls over the client can lose it's config and files end up being played on TV device on the server rather than the DAC on the client and it's such a pain to sort out as one's headless and they are on different floors in a house. . .  I'm ranting now :-) Might see if I can take a look at things once again over the weekend.

Cheers

Spike

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Tips for having parts of my media collection off line.
« Reply #8 on: February 07, 2019, 12:20:44 pm »

If you could use DLNA on your client you could set up different libraries to connect depending on your situation. One DLNA server could include all files and the other only files that are always available (so exclude NAS). (.....If only replication of DLNA views would be easier...Tuning in FEATURE REQUEST: Use selected DLNA server settings as a template for new DLNA server)
Logged

Spike1000

  • Citizen of the Universe
  • *****
  • Posts: 641
Re: Tips for having parts of my media collection off line.
« Reply #9 on: February 08, 2019, 03:48:37 am »

To be honest I think MC is too complex in this area as it is but I can see that'd work. I did manage to fix my headless windows client last night. Took about 20 minutes of faffing to get the result I wanted:

Server instructs client to play a 192kHz FLAC file as a 96kHz FLAC (as that's all the DAC on the client will do). Both server and client have the same drive letter mapped to the media files. The problem is it seems it's 100 times more easy to get the client to play an MP3 version of the file if any form of file sample rate conversion is attempted. I wonder how many other people do this and don't realise  ?

Having the client try and play the 192kHz FLAC file blew it out of the water on Wednesday. And on a headless system this is an utter pain to fix.

I discovered a whole string of issues on the way (I may write them up at some point) but having a 'full fat' copy of MC being used as a 'renderer' on a headless windows PC is far from straightforward and is not reliable so I certainly don't recommend it.  :(

Spike

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72439
  • Where did I put my teeth?
Re: Tips for having parts of my media collection off line.
« Reply #10 on: February 08, 2019, 05:45:30 am »

When you say client in your last post, do you mean renderer?
Logged

Spike1000

  • Citizen of the Universe
  • *****
  • Posts: 641
Re: Tips for having parts of my media collection off line.
« Reply #11 on: February 08, 2019, 07:32:58 am »

No, I meant client. Not sure what differences you'd be getting at in my setup.

Both machines run MC, one as a headless client to the server. Maybe I didn't describe the set up very well. The challenges I have is that the 'full fat' complexities of MC hinder its 'simple' use in a headless client situation. It has its own database and config when I want one database and one major config (on the server) and really need a very simple lightweight client that just plays stuff it's received from the server in the format that the locally attached DAC supports. I'd call that a 'client' as there's only one database on the MC server; but you could also call it a renderer as it has a very simple function - to play files when instructed by the server in a format it supports.

That's actually quite fiddly to set up with MC. There's a whole stack of gotchas that I've come across that make it unreliable/a pain/not something that 'just works'.

The client never recovers if it's started before the server. Pop up dialogue box on the screen.
It never recovers from 'something went wrong with playback' messages. Pop up dialogue box on the screen.
As I said sending it a file the DAC couldn't play completely blew it out of the water - it hung and lost its settings!
It's VERY easy to convert files down to high bitrate MP3s and play them (MC defaults?), much harder to ensure they stay in their format with maybe a sample rate change for the DAC.

Many years ago I was going to use DNLA and hardware 'renderers' to play from a central 'server', I abandoned that as it was fraught with issues so I picked MC. This works but has different issues and doesn't work well as a headless client; just too many things can 'break it' and require intervention.

Spike

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72439
  • Where did I put my teeth?
Re: Tips for having parts of my media collection off line.
« Reply #12 on: February 08, 2019, 03:26:12 pm »

Spike,
I think the key details may be buried in your text.  Could you provide a concise description of your setup?
Logged
Pages: [1]   Go Up