-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deluge-streaming doesn't work on linux #19
Comments
Can you try with the latest release, https://github.com/JohnDoee/deluge-streaming/releases/tag/0.10.0 ? A little extra info, some of these video players doesn't like to wait for data, so when Deluge can't get the needed piece fast enough, they get angry and error out. |
Sadly, it's still the same.
I don't think that's the issue. Example: I have 10% of file already downloaded, then I start to stream it. It still fails, whereas opening the file directly (at 10% completed) works just fine. If anything changed, it's the errors. Now there are none, both in mpv and vlc. |
I found a few problems, let me fix them and lets see. |
I've been doing too many tests with small files and fast internet, so the errors I made were simply masked. The new one should actually do sequential download. If you want to track what the plugin is actually doing, you can get Deluge-Pieces and see. Try the new release, https://github.com/JohnDoee/deluge-streaming/releases/tag/0.10.1 |
Great, it works now. I still get some errors, but the file plays fine and there are no visible artifacts.
Again, playing file the hard way (start downloading, start streaming, ignore streaming url, play the file from hard drive deluge's downloading to) yields no errors. It looks like deluge-streaming still omits a segment here and there while -- UPDATE I just tried another file, and this happend:
The file itself doesn't seem corrupted, mpv plays it with no errors. As from 5 files tested this happend with one file only, I'll link it here. No idea whether github cares or not, therefore I'm going to add some spaces to the link. Note: It could be illegal in your country to download / share file this torrent points to, as it is a copyright protected content (anime). -- UPDATE 2 I missed your previous commend due to it being edited
I'll check it a bit later and post the results if there's something interesting in the output. |
It seems like there's a math error somewhere when doing a range request. So, mpv buffers so fast from Deluge it gets some null bytes but doesn't do that when playing from disk.
That's an interesting error because that means Deluge told me that the torrent has a piece length of zero. There is probably a race condition, I'll add a small safeguard against it.
You can ignore the "before edit" part 😄 Thanks for the feedback! |
I looked at the pieces plugin. Something doesn't seem quite right here. Either math is a bit off when calculating which piece should be downloaded next, or maybe it's mpv requesting them in a weird order. VLC refuses to open any stream now, but it can play the "raw files".
this could be the case, as I have mpv (youtube-dl) set up this way:
which basically means "load as much as possible to the ram, because my internet connection is really slow" It's probably not the most optimal way to
but for network streams in gerenal this is the setting I like the most. I would use mpv's cache-file option instead of wasting my ram, but apparently it doesn't work as advised so I have to stick with filling up my ram at the moment. EDIT: Ooops, I made a missclick. Sorry. How does one re-open an issue? |
It seems like either Linux or Python buffers when reading from disk. If you read 1024 bytes, it might actually read 2048 and just save 1024 in memory. Since Deluge haven't downloaded the data we need yet it caches garbage data. I'm busting that now, all media player errors should be gone. I also ensure the torrent is added correctly, or at least, the piece length is correct. This should fix the ZeroDivision exception. Anyways, check out https://github.com/JohnDoee/deluge-streaming/releases/tag/0.10.2 It seems like it's not actually possible to force Deluge to do 100% sequential download. If it seems mostly-sequential, then it's probably the best we can get. |
Well done, now it seems to work perfectly. I'll do some more tests later today or tomorrow, but everything seems to be fixed.
I just checked Deluge-Pieces output when using SequentialDownload plugin (and streaminig plugin disabled), and it seems to be more or less the same. |
Any updates ? |
Actually, yes. I'm not certain if it's still platform-related as I don't have any windows machine laying around, but it seems that both downloading and seeking works much better when the client is running and is connected to the daemon. If it's just the deluge daemon being somewhere in the background the plugin still works, but seeks seem to take longer (requires firther testing) and the cache-bar in mpv either doesn't fill at all or fills very slowly. Steps to reproduce this behavior:
It all seems weird, but that's what happens for me. Maybe I'll do some more digging tomorrow or the day after when I'll have some more time. |
I think Deluge might do something weird to Twisted and its event loop. The reason I'm not using deluge-web to serve files is because it simply doesn't work. Your description is consistent with a broken/slow event loop as every write require the loop to run. |
It seems like Deluge has an internal cache for states.... I've tried to fix it in 0.10.3 (Note, probably doesn't work with Deluge 2 was the update mechanism is different) |
Now for some reason deluge reports download speed of 1 MiB/s (for example) and mpv's cache is feeling at much slower rate, about 1/10th of download speed. The torrent completition percentage also seems to move at slower pace than advertised. (1 MiB/s downloads 100MiB file in ~15 minutes rather than 100 seconds). Is it possible that some (a lot actually, 90% would be my bet) of downloaded segments are getting discarded? I don't think I've seen this behavior when using previous versions of the plugin. Edit: |
I was testing with speeds capped at 1MB/s so I noticed nothing. I can see what the problem is though. man, this is hard to get right. |
The saga continues, I've tried to limit how often it sets priority on pieces while still doing it when it is necessary. Interestingly enough the original design was the same as Quasar used so they must've had same problem for small torrents. |
I can't get deluge-streaming to work on linux. I tried the exact same configuration of tools and settings as I use on windows, but with no results. The file download itself seems to work file, I can play the file that's being downloaded directly and it seems to play just fine. The only problem is playing it via deluge-streaming.
--
Reproduction steps:
--
Deluge version: 1.3.15 (default settings, one plugin only)
deluge-streaming version: latest release
mpv version: latest git (default settings)
youtube-dl version: latest git
vlc version: 3.0.3 (default settings)
--
Log from mpv on windows (warnings are marked, the rest are errors):
Log from mpv on linux (warnings are marked, the rest are errors):
Log from vlc on linux:
The text was updated successfully, but these errors were encountered: