Client Disconnects

For help and support with Universal Media Server in general
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Post Reply
bladeravinger
Posts: 6
Joined: Sat Jun 15, 2019 9:05 pm

Client Disconnects

Post by bladeravinger » Sat Jun 15, 2019 9:21 pm

Hey Guys, i have seen loads of threads regarding this problem and not a single solution thus far.

I have tried across multiple platforms which leads me to believe its not a me problem its a UMS problem.

Initially this was happening while UMS was hosted from a Windows PC streaming to a PS4, i looked at many options on these forums to try and fix this issue. no success

Fortunately my new server arrived yesterday and as you do when you want a server that works properly i installed Linux (for some reason i just enjoy command line so much)

Again streaming to my PS4 25-30 mins disconnect, i took a look at the logs, to only see "stopped playing "series" on PS4" no leading or trailing errors.

Untill today i thought it was an issue between my PS4 and UMS and i was blaming the PS4, but out of curiosity i loaded an episode of my favorite Show to tick over in chome while i worked and after 25-30 mins its dies again. same "INFO 08:53:08.452 [StopPlaying Event] Stopped playing "Stargate Atlantis The best Show ever to grace my television" on Chrome" no leading or trailing errors. (oh i just noticed my server clock is wrong ;D)

Is there anywhere i can find a more detailed log, or i can debug this issue? does anyone have any advice, as its clearly not the computer im streaming from nor the renderer as when i change these variables the problem persists

EDIT: i dont pay attention, im going to run a trace log now, il post it when its ready

EDIT 2:
The chrome clients did not disconnect this time, but the PlayStation 4 did.

Here is the leading log for those that want to just see it rather then look for it

Code: Select all

TRACE 2019-06-15 10:01:22.525 [UPNP-AliveMessageSender] Searching network interface for 192.168.178.31
TRACE 2019-06-15 10:01:22.525 [UPNP-AliveMessageSender] Setting SSDP network interface: name:enp3s0 (enp3s0)
TRACE 2019-06-15 10:01:22.563 [pool-1-thread-5] got player status: {"mute":"0","volume":"0","position":"1268","playback":"PLAYING"}
TRACE 2019-06-15 10:01:22.607 [pool-1-thread-11] got player status: {"mute":"1","volume":"100","position":"836","playback":"PLAYING"}
DEBUG 2019-06-15 10:01:22.835 [ffmpeg64-19-2] frame=37032 fps= 26 q=21.0 size= 1314310kB time=00:25:44.68 bitrate=6970.2kbits/s speed=1.08x    
TRACE 2019-06-15 10:01:22.853 [pool-1-thread-30] got player status: {"mute":"1","volume":"100","position":"836","playback":"PLAYING"}
DEBUG 2019-06-15 10:01:22.954 [ffmpeg64-17-Cleanup] Stopping Unix process 1776: ffmpeg64-17
TRACE 2019-06-15 10:01:22.954 [ffmpeg64-17-Cleanup] Killing the Unix process: 1776
DEBUG 2019-06-15 10:01:22.969 [ffmpeg64-17-Cleanup] Stopping Unix process 1772: mkfifo-18
TRACE 2019-06-15 10:01:22.969 [ffmpeg64-17-Cleanup] Killing the Unix process: 1772
TRACE 2019-06-15 10:01:22.975 [ffmpeg64-17-Cleanup] Destroying buffer
TRACE 2019-06-15 10:01:23.289 [pool-1-thread-19] got player status: {"mute":"1","volume":"100","position":"836","playback":"PLAYING"}
DEBUG 2019-06-15 10:01:23.289 [ffmpeg64-21-2] frame=28482 fps= 34 q=21.0 size=  798112kB time=00:19:48.09 bitrate=5503.0kbits/s speed= 1.4x    
TRACE 2019-06-15 10:01:23.353 [pool-1-thread-12] got player status: {"mute":"1","volume":"100","position":"836","playback":"PLAYING"}
DEBUG 2019-06-15 10:01:23.377 [ffmpeg64-19-2] frame=37053 fps= 26 q=19.0 size= 1314310kB time=00:25:45.50 bitrate=6966.5kbits/s speed=1.08x    
DEBUG 2019-06-15 10:01:23.474 [ffmpeg64-21-2] frame=28496 fps= 34 q=21.0 size=  798112kB time=00:19:48.60 bitrate=5500.7kbits/s speed= 1.4x    
TRACE 2019-06-15 10:01:23.603 [pool-1-thread-21] got player status: {"mute":"1","volume":"100","position":"837","playback":"PLAYING"}
TRACE 2019-06-15 10:01:23.854 [pool-1-thread-17] got player status: {"mute":"1","volume":"100","position":"837","playback":"PLAYING"}
TRACE 2019-06-15 10:01:23.866 [ffmpeg64-19-Timer] buffered: 207,746,176 bytes / inputs: 1
DEBUG 2019-06-15 10:01:23.883 [ffmpeg64-19-2] frame=37077 fps= 26 q=21.0 size= 1314310kB time=00:25:46.48 bitrate=6962.1kbits/s speed=1.08x    
DEBUG 2019-06-15 10:01:23.978 [ffmpeg64-21-2] frame=28519 fps= 34 q=20.0 size=  798112kB time=00:19:49.63 bitrate=5495.9kbits/s speed= 1.4x    
TRACE 2019-06-15 10:01:24.102 [pool-1-thread-22] got player status: {"mute":"0","volume":"0","position":"1269","playback":"PLAYING"}
TRACE 2019-06-15 10:01:24.103 [pool-1-thread-26] got player status: {"mute":"1","volume":"100","position":"837","playback":"PLAYING"}
DEBUG 2019-06-15 10:01:24.200 [UPNP-AliveMessageSender] Sending ALIVE...
TRACE 2019-06-15 10:01:24.200 [UPNP-AliveMessageSender] Searching network interface for 192.168.178.31
TRACE 2019-06-15 10:01:24.200 [UPNP-AliveMessageSender] Setting SSDP network interface: name:enp3s0 (enp3s0)
TRACE 2019-06-15 10:01:24.201 [pool-1-thread-13] got player status: {"mute":"0","volume":"0","position":"1270","playback":"PLAYING"}
TRACE 2019-06-15 10:01:24.302 [ffmpeg64-21-Timer] buffered: 207,740,785 bytes / inputs: 1
TRACE 2019-06-15 10:01:24.352 [pool-1-thread-9] got player status: {"mute":"1","volume":"100","position":"837","playback":"PLAYING"}
DEBUG 2019-06-15 10:01:24.388 [ffmpeg64-19-2] frame=37117 fps= 26 q=21.0 size= 1314310kB time=00:25:48.21 bitrate=6954.3kbits/s speed=1.09x    
TRACE 2019-06-15 10:01:24.453 [StopPlaying Event] Matched media renderer "PlayStation 4" based on address 192.168.178.171
INFO  2019-06-15 10:01:24.453 [StopPlaying Event] Stopped playing Stargate.Atlantis.S01E03.BR.1080p.HEVC.AC3-D3FiL3R.mkv on PlayStation 4
debug.zip
The debug.log. Ran 3 Simultaneous streams.
(573.94 KiB) Downloaded 31 times

bladeravinger
Posts: 6
Joined: Sat Jun 15, 2019 9:05 pm

Re: Client Disconnects

Post by bladeravinger » Thu Jun 20, 2019 2:51 am

Any feedback on what steps i can take to mitigate this issue?

Is it an issue with the playstation 4 or an issue with UMS?

i have multiple systems i can try different configs from linux and windows servers to windows and linux clients.

im willing to put in the time to debug this issue on my systems so we can create a definitive guide to fix this issue for future users

User avatar
mik_s
Moderator
Posts: 73
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: Client Disconnects

Post by mik_s » Thu Jun 20, 2019 3:34 am

I have had disconnects in the past on my ps4 after 20 or so minutes watching something, but after i managed to get it online to update the mediaplayer it started to behave. maybe try deleting and re-installing the media player on your ps4 and see if that helps.

Nadahar
Posts: 1464
Joined: Tue Jun 09, 2015 5:57 pm

Re: Client Disconnects

Post by Nadahar » Thu Jun 20, 2019 3:37 am

You'll need a lot of patience if you're ever going to get a reply from a developer. They have been been even more rare on this forum than usual lately.

As a former developer I can say that nobody probably knows the reason. I haven't even paid much attention to the changes made since 7.0.0, since I consider much of the new code to be of a too low quality. As such, I don't really know if they have introduced new issues that can potentially cause this. That said, I think there have been problems with the PS4 for some users "as long as I can remember", but my impression is also that it mostly works for some PS4 users. This, combined with nothing really revealing in the logs, makes this issue difficult to handle when one don't have a PS4 to test with.

I see that your log file is full of

Code: Select all

DEBUG 2019-06-15 09:48:08.348 [ffmpeg64-21-1] Cannot grow buffer size from 52,428,800 bytes to 209,715,200 bytes.
DEBUG 2019-06-15 09:48:08.349 [ffmpeg64-21-1] Error given: java.lang.OutOfMemoryError: Java heap space
...which is very likely to be the cause for your problems. You have allocated 683 MB to the JVM, which should normally be sufficient, but for some reason it isn't. The default heap space allocated for Windows installations is 1280 MB (while Linux is 768 MB by default if I remember correctly). I don't think there is any good reason for this, more or less all development takes place on Windows and for some developers that seems to be the only platform they "care about". My guess is that the default JVM stack allocation has been bumped to resolve some issue at some point, but the person doing this hasn't cared to change it for macOS and Linux.

You can easily change the JVM stack size in UMS.sh, and since it seems that you have available memory, you should try to increase it so that you don't get out of memory errors. Eventually you will however, since UMS has a flawed design that manifests itself somewhat like a memory leak (although it technically isn't) which will mean that it will eat more and more memory over time.

While the fundamental design flaw have been there at least since UMS 5.0.0, the changes in 7.0.0 have made the problems much worse. If you don't absolutely need some of the stuff added in 7.x or 8.x, I would stick to 6.8.0.

If adjusting the stack memory and/or downgrading to 6.x doesn't help, I think you'd need to some kind of network capture (similar to WireShark) and post that.

bladeravinger
Posts: 6
Joined: Sat Jun 15, 2019 9:05 pm

Re: Client Disconnects

Post by bladeravinger » Wed Jun 26, 2019 5:26 am

Thanks for the detailed reply @nadahar. I had not even noticed the memory issue, but server has some unused memory, il update the. Sh and try again. @mik_s, il try updating the media player also.

I do not belive the issues lies with ums but I have no clue about the source. I will try these suggestions and get feedback for everyone.

Thanks guys


UPDATE:

Nothing good to report. the increased memory allocations had no effect, nor did re-installing media player on the console. Next il downgrade to an earlier version 6.x as suggested by Nadahar and report back

UPDATE 2:

Rolling back to v6.8 did not help either, i will try a few different versions and see if i can get better results

bladeravinger
Posts: 6
Joined: Sat Jun 15, 2019 9:05 pm

Re: Client Disconnects

Post by bladeravinger » Mon Jul 08, 2019 3:36 am

Another Update.

After rolling back to version 5.0.0 UMS on Linux, exactly 30 mins after the console connects the console then disconnects and dosn't look for any other servers without the app restarting.

at this point i feel its the Media player app some how checking if the server is from some predetermined authorized source and if not cutting the connection.

The same issue is present in all versions that i have tested. the problem isnt too bad for me, i can watch my series, but i wont even try movies, it would be like watching it on Cable TV with an ad break every 20 mins.

i think another media player is in order. or set fire to the console and use something more reliable

Nadahar
Posts: 1464
Joined: Tue Jun 09, 2015 5:57 pm

Re: Client Disconnects

Post by Nadahar » Mon Jul 08, 2019 9:20 am

As long as you keep finding "java.lang.OutOfMemoryError" when you search your logfile, there's no use looking at other aspects. After an out of memory error has occurred, UMS' state is to be considered corrupted, as it is completely random what have been stored in memory and what haven't. Any application that gets and out of memory error must be stopped/closed and started again.

You can simply expect "everthing" to go wrong once this error has been logged, so if adjusting the heap size didn't solve this, there must be some other reason why this happens. In any case, don't blame neither the console as long as you keep getting this. It must be solved to have any hope that the server will work properly.

bladeravinger
Posts: 6
Joined: Sat Jun 15, 2019 9:05 pm

Re: Client Disconnects

Post by bladeravinger » Fri Jul 12, 2019 4:42 am

Nadahar wrote:
Mon Jul 08, 2019 9:20 am
As long as you keep finding "java.lang.OutOfMemoryError" when you search your logfile, there's no use looking at other aspects. After an out of memory error has occurred, UMS' state is to be considered corrupted, as it is completely random what have been stored in memory and what haven't. Any application that gets and out of memory error must be stopped/closed and started again.

You can simply expect "everthing" to go wrong once this error has been logged, so if adjusting the heap size didn't solve this, there must be some other reason why this happens. In any case, don't blame neither the console as long as you keep getting this. It must be solved to have any hope that the server will work properly.
I will restart my server and run another trace log, though its currently running on a Ubuntu 19.04 4Gb Ram, 1.4Gb assigned to UMS give or take. i just doubled the default ram, but il expand it further and see if i get another error.

Correction i already have it configured to output trace logs. so il have a look at the one i have

Update.

In 4 days or running i cant find single "java.lang.OutOfMemoryError" or even "OutOfMemory"

so it seems that is not my issue.

I have 80 Mb of log file right now, if anyone wishes to take a look i can strip it down to the last 24 hours and post it. i have likely missed something of importance, but i have no clue what im looking for, so scanning over things looking for something out of place

Nadahar
Posts: 1464
Joined: Tue Jun 09, 2015 5:57 pm

Re: Client Disconnects

Post by Nadahar » Fri Jul 12, 2019 8:53 am

The log files usually compress very well, so just (g)zip it and it shouldn't be big.

bladeravinger
Posts: 6
Joined: Sat Jun 15, 2019 9:05 pm

Re: Client Disconnects

Post by bladeravinger » Fri Jul 12, 2019 11:43 pm

Ah you are right, i forgot texts files compress so well
debug.zip
(4.67 MiB) Downloaded 19 times
The Log

Post Reply