ACD + fuse mount: still not working with Plex

Currently using the latest beta: v1.33-92-g881740e-acd-range-fixβ . I have heard that http seek is working on unencrypted fuse mount now. However, I still can’t get both encrypted or unencrypted fuse mount to work with Plex. Plex sees the video, but video playback will not start and ends in an error. Any update with this?

I’m using this beta and its working with kodi. I realize kodi isn’t the same as plex but they are similar. v1.33-83-g8710741β. I’m using a crypted mount that I mount read only (there are issues currently with writing to a crypt mount).

It is actually working better than expected from a performance point of view.

A log might help with the --debug-fuse option on the mount. At least you can see whats going on.

I turned on --debug-fuse and here’s the output when Plex stops working (for crypt acd mount)

2016/11/01 19:19:08 fuse: <- Open [ID=0xea Node=0xd Uid=1000 Gid=1000 Pid=8030] dir=false fl=OpenReadOnly
2016/11/01 19:19:08 X-Men.Apocalypse.2016.1080p.BluRay.x264.DTS-FGT.mp4: File.Open
2016/11/01 19:19:08 X-Men.Apocalypse.2016.1080p.BluRay.x264.DTS-FGT.mp4: ReadFileHandle.Read OK
2016/11/01 19:19:08 fuse: -> [ID=0xe8] Read 4096
2016/11/01 19:19:08 fuse: <- Read [ID=0xeb Node=0xd Uid=1000 Gid=1000 Pid=8082] 0x1 4096 @0x4d0000 dir=false fl=0 lock=0 ffl=OpenReadOnly
2016/11/01 19:19:08 X-Men.Apocalypse.2016.1080p.BluRay.x264.DTS-FGT.mp4: ReadFileHandle.Read size 4096 offset 5046272
2016/11/01 19:19:08 X-Men.Apocalypse.2016.1080p.BluRay.x264.DTS-FGT.mp4: ReadFileHandle.seek from 3395584 to 5046272 (io.Seeker)
2016/11/01 19:19:10 pacer: Rate limited, sleeping for 429.961588ms (1 consecutive low level retries)
2016/11/01 19:19:10 pacer: low level retry 1/10 (error HTTP code 500: “500 Internal Server Error”, reponse body: {“message”:“Internal failure”}
)
2016/11/01 19:19:13 pacer: Rate limited, sleeping for 888.298971ms (2 consecutive low level retries)
2016/11/01 19:19:13 pacer: low level retry 2/10 (error HTTP code 500: “500 Internal Server Error”, reponse body: {“message”:“Internal failure”}
)
2016/11/01 19:19:16 pacer: Rate limited, sleeping for 3.158288344s (3 consecutive low level retries)
2016/11/01 19:19:16 pacer: low level retry 3/10 (error HTTP code 500: “500 Internal Server Error”, reponse body: {“message”:“Internal failure”}
)
2016/11/01 19:19:20 pacer: Rate limited, sleeping for 3.304784443s (4 consecutive low level retries)
2016/11/01 19:19:20 pacer: low level retry 4/10 (error HTTP code 500: “500 Internal Server Error”, reponse body: {“message”:“Internal failure”}
)
2016/11/01 19:19:23 pacer: Resetting sleep to minimum 20ms on success
2016/11/01 19:19:23 fuse: -> [ID=0xea] Open 0x2 fl=0

I think the problem is that the plex server uses two threads or processes, one to read audio and one for video. Rclone seems to try to handle this using a single connection, so it constantly seeks between the audio and video readers file offsets.

You should probably open a github issue describing the problem.

That looks like Amazon rate limiting, or just going wrong…

However rclone recovered and carried on

So you will have got a 8 second pause or so. Sometimes media players need to do a lot of seeking and if each one is taking 8 seconds it will appear to take a very long time!

However my experience with ACD is that it isn’t usually like this - it works quite well.

After a bit of testing, I was able to get ACD + fuse mount to work with Plex but it’s definitely not perfect and needs some optimization.

Here’s my setup. I know the using fuse mount with crypt is still experimental so I’m not using crypt at the moment. I’m using rclone to mount acd drive to /mnt/.acd:

rclone mount --verbose --read-only --debug-fuse --allow-other --no-modtime acd: /mnt/.acd 

I’m then using encfs to decrypt this mount to /mnt/acd. I’m able to start a movie with Plex and it plays smooth (most of the time) if I’m not doing anything with Plex. But starts doing a library refresh, the movie buffers very often and becomes unwatchable. It seems to be a connection saturation issue because bandwidth isn’t an issue for me. Using rclone move/copy I’m able to get 100MB/s up/down. I’ve tested both files > 10GB and < 10GB and it’s occurring with both.

I want to move away from acd_cli and use rclone exclusively but in the meatime still having to rely on acd_cli for more reliable acd fuse mount.

1 Like

It would be worth trying 1.34 - there have been quite a few fixes to fuse and seeking all of which went into 1.34.

This may not make a difference though!

Are you still seeing those “500 Internal Server Errors” in the log like before? I don’t think rclone can do anything about those :frowning:

I’ve played around with mounting with v1.34 & video playback and I’m having problems.
I’ve mounted my ACD in macOS and when I try to play a video I get:

  • PLEX MEDIA PLAYER playback attempts
    (tried multiple times & getting the same result without being able to even start a video)

    2016/11/06 15:41:34 folder/video-file.mkv: File.Attr
    2016/11/06 15:41:34 folder/video-file.mkv: File.Open
    2016/11/06 15:41:36 folder/video-file.mkv: ReadFileHandle.Flush
    2016/11/06 15:41:36 folder/video-file.mkv: ReadFileHandle.Flush OK
    2016/11/06 15:41:36 folder/video-file.mkv: ReadFileHandle.Release closing
    2016/11/06 15:41:36 folder/video-file.mkv: ReadFileHandle.Release OK

  • Opening the directory gave me the above messages or the one’s below:
    (again I tested & retested this a few times)

    2016/11/06 15:41:34 folder/video-file.mkv: File.Attr
    2016/11/06 15:41:34 folder/video-file.mkv: File.Open
    2016/11/06 15:41:36 folder/video-file.mkv: ReadFileHandle.Read size 4096 offset 0
    2016/11/06 15:41:36 folder/video-file.mkv: ReadFileHandle.Flush OK
    2016/11/06 15:41:36 folder/video-file.mkv: ReadFileHandle.Read size 8192 offset 440782848
    2016/11/06 15:41:36 folder/video-file.mkv: ReadFileHandle.seek from 4096 to 440782848
    2016/11/06 15:41:36 folder/video-file.mkv: ReadFileHandle.Read OK
    2016/11/06 15:41:36 folder/video-file.mkv: ReadFileHandle.Flush
    2016/11/06 15:41:36 folder/video-file.mkv: ReadFileHandle.Flush OK
    2016/11/06 15:41:36 folder/video-file.mkv: ReadFileHandle.Release closing
    2016/11/06 15:41:36 folder/video-file.mkv: ReadFileHandle.Release OK

  • MVP & VLC video players on macOS give me these messages:
    (playback is more stop then go making it impossible for streaming video playback)

    ReadFileHandle.Read size 4096 offset 590856192
    ReadFileHandle.seek from 51789824 to 590856192
    ReadFileHandle.Read OK
    ReadFileHandle.Read size 32734 offset 590860288
    ReadFileHandle.Read OK
    ReadFileHandle.Read size 8192 offset 31899648
    ReadFileHandle.seek from 590893022 to 31899648
    ReadFileHandle.Read OK
    ReadFileHandle.Read size 12288 offset 31907840
    ReadFileHandle.Read OK
    ReadFileHandle.Read size 24576 offset 31920128
    ReadFileHandle.Read OK
    ReadFileHandle.Read size 49152 offset 31944704
    ReadFileHandle.Read OK
    ReadFileHandle.Read size 98304 offset 31993856
    ReadFileHandle.Read OK
    ReadFileHandle.Read size 196608 offset 32092160
    ReadFileHandle.Read OK
    ReadFileHandle.Read size 393216 offset 32288768
    ReadFileHandle.Read OK
    ReadFileHandle.Read size 786432 offset 32681984

  • With larger files I also get some of these sprinkled in:
    (couldn’t see a pattern & it takes a long time for the video to start playing)

    2016/11/06 17:59:16 pacer: Rate limited, sleeping for 1.688510981s (2 consecutive low level retries)
    2016/11/06 17:59:16 pacer: low level retry 2/10 (error HTTP code 500: “500 Internal Server Error”, reponse body: {“message”:“Internal failure”}

In contrast when I load the same video files in nPlayer (an iOS app that connects to ACD) I can stream them fairly instantaneously & there are no interruptions even while streaming larger video files with 2MB/s.

I’ve also tried mounting like ladude626 with
--verbose --read-only --debug-fuse --allow-other --no-modtime
Unfortunately I still can’t get video playback to start.

@ncw Forgot to mention I was running the latest beta v1.33-106-ge162377 so should contain most of the seek fixes in 1.34 right?

@hari9 I wondering adding --transfers 20 --checkers 40 will help? I’ll try to test when I get home later.

I’m using v1.34-02-g5f320cc and still getting the same issue as I described above, movie plays but buffers when library refresh occurs in the background. I’m using the mount command below.

rclone mount --transfers 20 --checkers 40 --verbose --read-only --debug-fuse --allow-other --no-modtime acd: /mnt/.acd

Got some good news. I added the option “–max-read-ahead 1024k” and playback is super stable now even when a library refresh is occurring in the background. I notice not only that movie load time is reduced but also fast forwarding is also faster too! Seems like Plex just needs a bigger buffer to be stable.

1 Like

@ladude626 wow so this is definitely essential to Plex! I am now able to play videos :smiley:

I’ll check what file sizes “–max-read-ahead 1024k” can handle. I’m particularly interested if video files with 2MB/s to 10MB/s will work as well. I’ll keep testing this more & report back. (my ACD is unencrypted)

So now I am using:
rclone mount --max-read-ahead 1024k --transfers 20 --checkers 40 --verbose --read-only --debug-fuse --allow-other --no-modtime acd:folder/vid.file

Interesting result!

I set that value to the default as I didn’t have any other info as to what it should be.

It might be that the default value should be bigger for rclone so I’d be interested in the results of experiments setting it to bigger and smaller values.

After some testing with 1M, 10M, 50M, 100M, and 200M max-read-ahead, I notice incremental improvement to video playback with each increase in size, though there might not be a noticeable difference between 200M vs. 100M. Improvement to video playback includes max birate that’s playable, video start time, buffer time when skipping/rewinding, and time to resume video. For now I’m going to stick with using 200M. BTW I’m mounting encfs decryption on top of rclone fuse mount (not using crypt).

So I’m using this now:

rclone mount --max-read-ahead 200M --transfers 20 --checkers 40 --verbose --read-only --debug-fuse --allow-other  acd:remote/ /mnt/local/folder

I’m currently I can smoothly playback video at 40Mbps birate without significant buffer using a ethernet connected FireTV running Plex. I’m located in the US and Plex server in located in EU.

2 Likes

@ladude626 20M or 200M? And what difference did it make to remove “–no-modtime” ?

@ncw where is the --max-read-ahead data stored? In RAM only or is anything temporarily written to disc?

@hari9 Sorry I meant 200M. I didn’t seen any difference in performance with --no-modtime remove (with it you can’t tell when files was modified when browsing).

Thanks for testing - very useful.

I’ll note that --transfers is ignored by rclone mount. --checkers is used to control the parallelism of directory listings though.

You will probably get a bit more performance turning off --debug-fuse and --verbose when you are happy.

Do you think I should change the defaults? Does anyone know what the defaults in other fuse filing systems are?

It is stored in the kernel buffer cache I think. So if you do free -m it is part of the buff/cache column

              total        used        free      shared  buff/cache   available
Mem:          15936        7429         294         838        8211        7247
Swap:         16267         233       16034