SageTV Community

SageTV Community (
-   SageTV for unRAID/Docker (
-   -   r5000 insists on recording to nonexistent var/media/tv? (

btrcp2000 10-08-2017 08:19 AM

r5000 insists on recording to nonexistent var/media/tv?
flipped the switch on my new unraid server last night, everything seems good except the r5000 boxes are looking to write to var/media/tv, which is not a directory. It should be unraid/sagemedia/tv, but I cannot find anywhere to change a setting like that, nor have i ever had to tell the r5000s where to go.

They are set up on a Windows7 VM (but NOT as part of a win7 sage network encoder setup), and the sage.prop in the docker is given the ip:port to find them. Sage was able to find and configure them without issue, but it cannot record.

I guess that directory is a standard one and cannot be changed, how can I workaround?

BobPhoenix 10-08-2017 08:32 AM

So you have two recording directories showing in SageTV Detailed Setup screen? /unraid/sagemedia/tv and /var/media/tv showing?

btrcp2000 10-08-2017 09:09 AM

No, just the var one. Thought about adding the other just to see what would happen, but figured i would touch base with smarter people first.

KarylFStein 10-08-2017 09:37 AM

The docker container maps certain directories within the docker like /var/media. By default /var/media inside the docker = /mnt/user/sagemedia on the server. In other words SageTV thinks it's writing to /var/media/tv but it's really writing to /mnt/user/sagemedia/tv. I don't know how the R5000s work, but if SageTV is handling writing the stream then you should be OK.

btrcp2000 10-08-2017 10:12 AM

1 Attachment(s)
I think I understand that, but it's definitely not usable as a sage tuner as it is not recording anything. The attached is what I am seeing on the VM

KarylFStein 10-08-2017 10:57 AM

Like I said, I don't know how the R5000s work. Are you running some capture software on a Windows VM and SageTV talks to that application telling it where to write the stream data? If so maybe you could modify the VM to mount the unRAID location /mnt/user/sagemedia/tv as C:\var\media\tv.

btrcp2000 10-08-2017 12:26 PM

LOL, me neither! It's always been magic to me.

Haven't tried this as this is now in production and it's football sunday, but what would happen if in sage.prop i changed this:


to this:


Just to bring you up to speed, here's what i know about how r5000 works. Yes, there is software on the win7 VM, which is what the screen shot is showing. If you look close, you can see in the two instances that the r5000 software is set to record to the C drive, but it has never actually used that, so i assumed that somehow sage just takes full control of it. in order for sage to find it, the lines below are manually pasted into properties, and are where some things are configured, but nothing jumps out to me that this issue is coming from the encoder config.

mmc/encoders/12346/video_capture_device_name=Dish \#1 523E

btrcp2000 10-08-2017 04:12 PM

Changed the recording path and the video storage path both to the new path as shown below. No error now but also not recording anything either. Hoping g to fix this, could be an unraid deal breaker since I am in a 2 yr dish contract

btrcp2000 10-08-2017 04:32 PM

Changed the recording path and the video storage path both to the new path as shown below. No error now but also not recording anything either. Hoping g to fix this, could be an unraid deal breaker since I am in a 2 yr dish contract

BobPhoenix 10-08-2017 05:11 PM

Don't think it has anything to do with R5000 per say. You just have something setup incorrectly. I had (and will again once I get my Colossus back to mostly reliable recordings again) a Colossus attached to an encoding VM and the rest of the tuners in an unRAID docker. I have another server where this is still the way I went for my HDPVRs since I get reliable 5.1 sound recordings from Windows but not the docker. I will be turning the Colossus one back once I get reliable HDMI recordings again. Looking like I need a new card currently - what fixed problem with first Colossus card on second currently and will likely be on third next week if latest change doesn't fix Colossus server.

I did setup a little differently.
  1. First and foremost I have no users defined on unRAID the shares are WIDE open. Guests can read/write/delete all files.
  2. I have recording drives outside of the array (the different part of the equation but shouldn't make a difference) and mounted with Unassigned Devices plugin with them auto mounted and shared.
  3. The mounts are /mnt/disks/Recording1, /mnt/disks/Recording2, /mnt/disks/Recording3.
  4. In the docker I have host path /mnt/disks assigned to "Path 2" - SageTV Media Directory (for recordings, etc).
  5. In SageTV properties I have recording paths of "/var/media/Recording1", "/var/media/Recording2" & "/var/media/Recording3".
  6. I removed the existing /var/media/??? entries from the recording directory property line and the default property line.
  7. Default line is blank so Sage won't force it back in the recording directories property line (not sure why linux is forced into this but Windows is not).
  8. Windows VM is running Win7 pro but should work with any version.
  9. Have Adminstrative user setup on Windows so that I can use it as the user in Service mode with SageTV.
  10. In SageTV on Windows I have the following recording directories defined. \\ServerName\Recording1, \\ServerName\Recording2, \\ServerName\Recording3.
  11. When I setup the Windows VM I added the Colossus as a tuner to the VM instance of SageTV so that I could test it out and make sure it was able to record before I connected the Docker SageTV to it.
  12. Set the property in SageTV VM to be an encoding server:"enable_encoding_server=true"
  13. Set the property in SageTV VM to "network_encoder_discovery=false" so that my HDHRs don't get shared out from the encoding server since unRAID docker picks them up natively.
  14. Left the VM setup with a tuner and recording directories even though I shouldn't need to leave the encoders defined and maybe not the recording directories either.
  15. Last I defined my Colossus to the docker SageTV. It records fine no problems recording to my shared recordings directories. But I get AAC audio ~50% of the time and Dolby Digital (like I want) the rest. The AAC audio doesn't play on my HD300s and the video is best described as stop motion video.
That is what I have two of my servers defined as not really sure what steps are required above and what are just quirks of how I wanted this to be setup. For instance you should be able to record directly to the array. I had that setup for a while but I like to have my recording drives separate from my array so that the array drives can spin down. I would record to my cache drive but don't want to ware out my SSDs too quickly (I record 1-2TB every 360 hours). I could setup a spinner mounted to the recording drive share on the cache drive so recordings go to the spinner and mover moves them to the array. But I have a lot of old drives available for recording drives that I would have to put into the array to provide enough storage. As it is I can go several months+ before the recording drives are full. Then I can add larger drives to the array and move the recordings to the array at that time - after I save the money to get the 8TB drives.

So long read (sorry about that) short. I'm sure you can get it to work just setup the VM to be independent first and get your R5000s recording correctly to the Recording drive(s)/directory you have defined on unRAID. Once you have the VM working then turn it into an encoding server and setup the unRAID SageTV docker to connect to IT.

btrcp2000 10-09-2017 08:22 AM

Thanks so much for all that detail. Unfortunately, I'm still stuck. I think the r5000 encoding software simply cannot deal with the fact that both var/media/tv and mnt/user/sagemedia/tv mean something entirely different in linux world vs Windows.

Here's what I have tried (disregard my comment about changing the path making the error go away. satellite had lost signal in a storm and wasn't producing any file at all).

Changing the both the container and host paths in Sage Docker to mnt/user/sagemedia/tv results in error on Win VM that it cannot find that path. This happens with or without a Sage instance acting as a network encoder on the Win VM (it is possible to point the Docker sage.prop directly to the networked tuners via the cut/paste mmc/encoder lines per nextcomwireless' instructions).

There has to be a way to make this work.

btrcp2000 10-09-2017 09:41 AM

Tried mapping the sagemedia/tv share to a drive on the Windows VM, and pointing sage.prop to it with this:


Got a general playback failure and the encoder line was changed to this (including the reversed order of :\)


symbolic link next, but I don't think the sage docker looks at any of these settings. it is somehow brute forcing sage to only look at /var/ directories, which the r5000 software can't see

BobPhoenix 10-09-2017 03:24 PM

Did you try to setup your Windows VM with the R5000 first. Setup the tuner in the VM instance of SageTV and setup recording directories in it first. Your recording director(y|ies) would be a UNC path in the Windows VM so: "\\unRAIDServerName\Share to record to".

Once you have it setup in your Windows VM and it records. THEN and only THEN set your property to be an encoding server on the Windows VM. Now connect to your docker and setup the R5000 in the docker. Hopefully if you follow this sequence it will work. Trying to do it ALL at once is most likely causing your problems.

Basically unless you can get it setup to work as a local recorder to the Windows VM and let SageTV Windows turn it into a network encoder I don't think you will get it to work.

btrcp2000 10-09-2017 06:26 PM

I don;t think I have tried that combo yet. I had not set the vm sage instance up to record to a drive. I thought docker sage would come to vm sage and somehow take over its tuner, but it sounds as though docker sage is supposed to tell vm sage what to record, and docker sage's wiz.bin will keep track of what was recorded and where it is?

Regardless, I can't experiment anymore until i figure out why the USB card disappeared entirely from the VM. It's the same one you helped me with earlier on the limetech forums (VIA Technologies, Inc. VL805 USB 3.0 Host Controller [1106:3483]). Still shows up in System Devices on unraid, and the vfio-pci line still appears in flash, but the VM doesn't see anything. Also tried plugging the r5000 into the motherboard's usb, which is seen by the libvirt hotplug tool, but no response form the VM when attached. Frustrating.

btrcp2000 10-09-2017 10:01 PM

I'm in a downward spiral now. Tried removing the vfio-pci line so I could reboot and add it back but now I can't even reach the web interface.

Fuzzy 10-10-2017 06:01 AM

You do NOT have to have an instance of sagetv running in the VM to act as a network encoder - the r5000hd software already acts as a network encoder. The issue is that sage simply passes the recording path that it wants the recording written to to the network encoder (in this case, as far as sage knows, that path is /var/media/tv/show-0123456.mpg). The r5000hd software get this, and tries to record to that file. Since /var/media/tv/ doesn't exist from the windows install, this doesn't work. I personally don't know how r5000hd.exe deals with that path - whether it tried writing to C:\var\media\tv, or C:\Program Files (x86)\nextcommwireless\var\media\tv, etc - not sure). What I do know, however, is that the r5000hd software DOES support recording to UNC paths. So, if you added your recording share as a UNC path to sage, and removed /var/media/tv, then it likely would work (sage would be sending //SERVER/SHARE/FOLDER/show-0123456.mpg to the network encoder, which it should be able to record to).

Removing /var/media/tv is currently blocked from within the UI (a restriction leftover from the original linux builds being for OEM systems), but after you add the UNC path recording folder, you should be able to stop it, and remove the /var/media/tv from the file.

btrcp2000 10-10-2017 06:45 PM

unraid up again. sure wish i knew what i did, but anyway...

First attempt with r5000 installed alone on the VM, no sage instance acting as networked encoder.

If I add a directory in the placeshifter UI by Specifying \\UNRAID\sagemedia\tv, it immediately gets adjusted to /opt/sagetv/server/\\UNRAID\sagemedia\tv

I have also seen this:

failed to open file for SageTV:
error: system cannot find the file specified

btrcp2000 10-11-2017 09:42 AM

I have tried a million different things and I think the root issue comes down to the fact that Docker Sage insists on prepending stuff to the recording directory.

I currently have docker sage and windows VM sage, with both r5000 boxes installed to the windows VM. One of the boxes is set up as a localdomain tuner to WinVM Sage, and is able to record just fine. The other is setup as a networked encoder to Docker Sage. The recording path for WinVm Sage is \\UNRAID\sagemedia\tv and it stays that way. The path for Docker Sage is entered that way, but immediately gets prepended to "/opt/sagetv/server/\\UNRAID\sagemedia\tv", even if I stop docker sage and adjust the prop file, it will revert upon restarting.

Really seems like there should be a way to stop this, but I am out of ideas. I would be willing to pay someone to get me past this, whether it's fixing it as is, or something else entirely to get these boxes to work. Otherwise, I will need to give up on Unraid for a few years.


jusjoken 10-11-2017 12:28 PM

Have you tried changing that path in the properties directly or only in the UI?


btrcp2000 10-11-2017 12:40 PM

both. in the UI I have tried "specifying" and typing in \\UNRAID\sagemedia\tv, as well as using the Up navigation button to get to it, as well as editing sage.prop.

BobPhoenix 10-11-2017 03:48 PM

In linux every path has to be mounted somewhere. SageTV chooses to mount network paths under /tmp/sagetv_shares/. It should be removing that from the path and storing in the database (wiz.bin) only the rest of the path. That should also be the path communicated to network encoders. Not sure if it isn't doing that or what is really going on. At one time when I had SageTV installed in a MINT linux VM I had scripts for SageTV that forced the maps to exist when the VM booted. That mostly worked but I found the path would disconnect but the VM was still running. Plus it was easier just to use the docker since it already had comskip and gentuner installed. So I switched.

When I just looked I see I have scripts that mount to /mnt/<mount point> and symlink that to /tmp/sagetv_shares/<mount point>. The /mnt/<mount point> are always connect and the symlinks happen whenever SageTV boots. I may try to do this again with the docker and see if I can then use a network encoder and UNC paths that way. I currently have imported folders that are network paths but I use Unassigned devices to map them via SMB and then pass /mnt/disks to the docker as a path so that to the docker the path appears as a local path.

BobPhoenix 10-11-2017 04:21 PM

Here are the log messages (errors actually) when I try to setup a network path as an imported folder in the latest SageTV docker:

11 17:11:42.090 [EventRouter-b888e3bc2889@306b4e0d] SMB Mount Path: //vmserver/online /tmp/sagetv_shares/vmserver/online
Wed 10/11 17:11:42.113 [EventRouter-b888e3bc2889@306b4e0d] Executing process: [mount.cifs, //vmserver/online, /tmp/sagetv_shares/vmserver/online, -o, guest,iocharset=utf8]
Wed 10/11 17:11:42.119 [EventRouter-b888e3bc2889@306b4e0d] Started process object: java.lang.UNIXProcess@2ce50bc4
Wed 10/11 17:11:42.170 [ErrorStreamConsumer@37026894] STDERR:java.lang.UNIXProcess@2ce50bc4: mount.cifs: permission denied: no match for /tmp/sagetv_shares/vmserver/online found in /etc/fstab
Wed 10/11 17:11:42.179 [EventRouter-b888e3bc2889@306b4e0d] SMB Mount Failed
Wed 10/11 17:11:42.191 [EventRouter-b888e3bc2889@306b4e0d] Executing process: [sh, -c, mount -t smbfs | grep -i "/tmp/sagetv_shares/vmserver/online"]
Wed 10/11

Why is this looking in fstab for a match? Sine it is a mount with the full path I would have thought it wouldn't need to. In my limited understanding of linux anyway.

I see what I could do to fix this for ME anyway. Add a script that updates fstab and then does a 'mount -A' so that it is read in again. But didn't think this was necessary.

btrcp2000 10-11-2017 07:45 PM

did these logs result when you entered the UNC path in the Path 1 (or 2 or 3) box in the container or did you do it another way?

BobPhoenix 10-12-2017 03:09 PM


Originally Posted by btrcp2000 (Post 611073)
did these logs result when you entered the UNC path in the Path 1 (or 2 or 3) box in the container or did you do it another way?

That is when I got into SageTV GUI and entered an imported path by navigating to the server and directory I wanted and then "Select Current" in the popup in the SageTV GUI.

stanger89 10-13-2017 10:09 AM

I've had a lot more luck with network paths and SageTV *nix when I used the browse function rather than trying to type paths in.

And make sure you use Placeshifter rather than Client. IIRC I had trouble using client because it would browse from it's own context which doesn't always match the server's context, Placeshifter browses from the server.

BobPhoenix 10-13-2017 03:19 PM


Originally Posted by stanger89 (Post 611089)
I've had a lot more luck with network paths and SageTV *nix when I used the browse function rather than trying to type paths in.

And make sure you use Placeshifter rather than Client. IIRC I had trouble using client because it would browse from it's own context which doesn't always match the server's context, Placeshifter browses from the server.

If this was directed towards me. This was from HD300 extender and that was how I setup the network path. I browsed to the folder I wanted on another computer through the NETWORK choice rather than the "/" choice. I did no typing in of a directory path. I made it all the way to the folder I wanted on my VMServer unRAID box where my BluRay and DVD rips are. I chose the "Select Current Directory" option. It added the path and the scanning icon showed up in the top GUI bar but immediately vanished. The result in the log is above where it references permissions and fstab.

btrcp2000 10-16-2017 10:04 PM

I am inclined to believe that it is impossible to have Sage Docker instruct 10+ yr old nextcom software on a WinVM to record to a Linux share.

A second instance of sage acting as an encoding tuner doesn;t work, I think because the r5000 is already a network tuner. I can install it and get it running as a standalone server, but then after editing sage.prop to tell it to act as an encoding server, sage docker does not "discover" the tuner. In fact r5000s never get "discovered", as you have to paste a bunch of lines into sage.prop.

Is there an IP:port address I can use that would allow sage docker to instruct sage windows client what to record and where? The tuner has its own port, looking for one that would be sage

Other failed attempts last few days include using the unnassigned devices plugin to create a share, but that also cannot find the destination.

I think I'm done unless anyone has any better ideas. I don't know enough to write a network encoder or modify encoders created by others.

BobPhoenix 10-17-2017 03:20 PM

I wondered if it would work with a Windows VM since I thought I remembered the R5000 software making itself available as a network encoder directly. Sorry to hear it didn't work either.

I'm having a weird network encoder problem myself with my Colossus server. When I setup Windows SageTV in the VM and record the recordings come out fine most of the time (10% are bad with AAC audio so won't play on HD300). If I set the property to turn that instance of SageTV into a network encoder > 50% of the recordings turn out bad but not in the same way. Normally a 2 hour movie takes 8GB or greater but as a network encoder that can turn out several MBs in size not GBs and nothing appears to be wrong but I haven't really had a chance to check the logs too close but there are NO system messages in the GUI. I'm going to try ESXi next as the Virtualization platform since I have my HD-PVRs on Windows as a network encoder and it is working perfectly on another server. I did this because I like 5.1 sound on my recordings and that doesn't work for me with the docker and does from a Windows VM network encoder. I used ESXi because I also have a nVidia DualTV to get SD recordings in a PCI slot which unRAID has been unable to pass through like ESXi. I'm hopeful that ESXi will cure my Colossus server too. I kind of expect to have to restart either the docker or the Windows VM like I did when I had the Colossus in a standalone server but with v9 the GUI response is an almost continual spinning circle just trying to navigate around. Even making changes to favorites takes hours when I can make the same changes on a docker SageTV in 15 minutes.

Fuzzy 10-21-2017 05:13 PM

I'm sure a proxy COULD be made that would allow remapping the paths passed from sage into the paths the encoder needs, but I'm not entirely sure the best way to go about it.

btrcp2000 10-21-2017 06:09 PM

It seems like the person named checkbin got this to work in an old thread I resurrected with the right combination of sage.prop paths and nfs shares, but I have not been able to stumble on the right combo. Hoping he/she chimes in soon

btrcp2000 08-05-2018 06:49 PM

It Works!!
Got it working!!! This is the command that finally fixed it (from an elevated prompt on the win10 VM):

mklink /D C:\var\media\tv \\UNRAID\sagemedia\tv
I had tried mapping before, but couldn't figure out how to get it to use a nested folder instead of just the root of a virtual letter drive. Found this link that explained how to set up a symlink, which I also had seen before. I finally figured out that this command wants to create the last folder of the path, but needs the rest of it to already exist. In other words, if you want c:\var\media\tv to map to the UNRAID share, you have to create new folders for var and media in windows explorer, then let the command create the tv folder. In win Exp, that TV folder looks just like a shortcut to a network folder as if you had dragged and dropped it.

I am still shocked that it worked because I could have sworn it would choke on the linux fwd slash vs windows back slash issue. Did not have to change anything in Sage properties other than the usual r5000 lines.

I have both r5000 boxes running delivering perfect digital copies includng 5.1 sound directly to the UNRAID share. Now the challenge is getting the r5000hd app to come up on the VM at startup. Have tried the settings in the app, running a task, copying the shortcut to the startup folder, no luck yet. Once I fix this I'm sure Dish will promptly cease support of the VIP211 boxes...

This has been over a year of on and off tinkering. There are far larger problems in the world, but it always feels good to squish bugs.

Thanks to checkbin for the assist as well!

All times are GMT -6. The time now is 01:16 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.