Question / Help WriteN, RTMP send error 10053 + 10038 - need help please!

Leolph

New Member
Hi there,

I'm getting frequent random disconnects and I don't know why.
Having used OBS classic for over 2 years this problem never appeared, although digging here in the forums there were also some guys having this error, but no solution was found.

Since several months I am using OBS Studio and - (just as a sidenote - it's awesome!) and in the last weeks those errors occur.

Here is my log for today's stream:

Code:
http://www.leolph.com/OBS/obslog.txt



First I streamed some World of Warcraft, later some Hearthstone. Both games had those issues.

When you look at the log there are dropped frames while rendering in a range from 0,x - 29,x %. So my guess is that I need to optimize my settings. Not sure, but I have the feeling when when CPU load is at 50% just with streaming something might be wrong and causing those problems.


I tried Stream Settings Estimator and got this result:

Estimator01.jpg



I'm running 3 monitors with 1920x1200 each, it's the recommend resolution for them, other create black borders.
Videobitrate is set to 2500
Coder x264
Audio 160
Base resolution: 1920x1200
Output resolution: 1920x1200
Scale factor: Bicubic
FPS: 30
Renderer Direct3d 11
CPU priority: normal
Don't know what CFR and CBR is, haven't found it in the settings. What and where are they? :)


Any help is appreciated, thank you in advance,

best regards

Leolph
 

Leolph

New Member
So I checked a ton of Youtube videos, forums, google searches and tinkered a lot with the settings.
I lowered all possible variables to get OBS Studio run smooth again. Some other applications like
Twitch Inspector also provided some useful informations.

The only thing that changed in the past weeks were the OBS Studio version and the NVidia gfx driver (376.19 from December 5th, 2016)
As you can see in the stream log below there are 2 peaks resulting in a disconnect.
The peak at 18:25-18:26 is the usual disconnect I suffer daily. Sometimes the stream runs smooth for 4+ hours, sometimes I get disconnect every several minutes. It's totally random.

New today was the peak at 20:30 - 20:31.
On this peak the CPU usage had a new record from OBS64.exe with 82,7% (see added picure 2)
Usually OBS64.exe hovers around 25% (see added picture 1).

This lets me assume the following:
My PC has enough power to run OBS classic with 3000 bitrate and used to have enough power for 2500 bitrate. But now, even with only 2000 bitrate those disconnects are driving me mad.
Either an update for OBS Studio or the NVidia gfx driver screwed something because those were the only 2 components that were changed.

Please, can anybody help on this?

Am I the only one with those disconnects with the current OBS 64 Studio version running under Win10-64 ?!


Edit:
Okay, another bug I should mention about OBS 64:
Sometimes I click the Icon to start "C:\Program Files (x86)\obs-studio\bin\64bit\obs64.exe" and nothing happens, although in the Task Manager there is a OBS64.exe running.
The window does not show up. Even after waiting several minutes nothing happens. I have to kill the process and try it again. Sometimes it starts on the second try, sometimes I need 4-5 tries to get OBS started. What's that about?

Edit2:
And another bug:
Streams are offline, I want to close OBS and get the message "OBS is currently active, all streams will be stopped. Are you sure you want to quit?"
CPU Usage of OBS64.exe at that time 11,6% ?!


It looks like this is a problem of OBS64 bit.
Please, neeeed help :)





Pic 1: The "normal" CPU usage from OBS 64
OBSBug04.jpg



Pic 2: new "record" for CPU usage!
OBSBug05.jpg



Pic 3: CPU Usage in idle mode, all streams stopped
OBSBug06.jpg


Code:
http://www.leolph.com/OBS/obslog13122016.txt
 

Leolph

New Member
So, OBS 17.0.0 has arrived and the problem still exists.

Now I've come a bit closer to the solution, here is what I've found out (pre 17.0.0):

- If you change the language you will get a ton of aboves errors
- changing the language will "reset" your configuration
- auto key frame will produce a lot of above errors
- twitch dashboard says "top quality" stream all the time, then the error occurs


The errors are still total random. Today I streamed a single picture with some music and got rendering issues, CPU usage was 3%, 30fps, nothing else than OBS running:

20:49:10.742: WriteN, RTMP send error 10054 (4097 bytes)
20:49:10.742: WriteN, RTMP send error 10053 (79 bytes)
20:49:10.742: WriteN, RTMP send error 10038 (42 bytes)
20:49:10.742: [rtmp stream: 'adv_stream'] Disconnected from rtmp://live-fra.twitch.tv/app
20:49:10.742: Output 'adv_stream': stopping
20:49:10.742: Output 'adv_stream': Total encoded frames: 119342
20:49:10.742: Output 'adv_stream': Total drawn frames: 120877
20:49:10.742: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 2359 (2.0%)
20:49:10.742: Output 'adv_stream': Reconnecting in 10 seconds..
20:49:10.743: [rtmp stream: 'adv_stream'] Freeing 2 remaining packets


2% rendering issues just for a picture?



So, I guess I have to live with the problem until it's fixed. The only source left causing this problem is OBS.
 

lulusoccer

New Member
Hi there,

I'm getting frequent random disconnects and I don't know why.
Having used OBS classic for over 2 years this problem never appeared, although digging here in the forums there were also some guys having this error, but no solution was found.

Since several months I am using OBS Studio and - (just as a sidenote - it's awesome!) and in the last weeks those errors occur.

Here is my log for today's stream:

Code:
http://www.leolph.com/OBS/obslog.txt



First I streamed some World of Warcraft, later some Hearthstone. Both games had those issues.

When you look at the log there are dropped frames while rendering in a range from 0,x - 29,x %. So my guess is that I need to optimize my settings. Not sure, but I have the feeling when when CPU load is at 50% just with streaming something might be wrong and causing those problems.


I tried Stream Settings Estimator and got this result:

Estimator01.jpg



I'm running 3 monitors with 1920x1200 each, it's the recommend resolution for them, other create black borders.
Videobitrate is set to 2500
Coder x264
Audio 160
Base resolution: 1920x1200
Output resolution: 1920x1200
Scale factor: Bicubic
FPS: 30
Renderer Direct3d 11
CPU priority: normal
Don't know what CFR and CBR is, haven't found it in the settings. What and where are they? :)


Any help is appreciated, thank you in advance,

best regards

Leolph
Hi Leolph! I believe you and I are having the Exact same issues with OBS Studios! I have yet to find a solution to my problem but it seems we are very very similar!
https://obsproject.com/forum/thread...ttempts-to-fix-have-failed.65615/#post-282725
^^My current post to try and figure out what is wrong

I know this was a few months ago but I'm just hoping maybe you've figured something out between then and now? The thing I find the most interesting is the sharp increase in CPU use? Mine does the exact same, goes from 12-20% up to 90-100% during the disconnects.
 

mueffl

New Member
I just am getting the same issue, since a week... it worked perfectly before on my rtmp server and I havent changed anything on it, so it's a total mystery to me whats causing this problem. Any one on here has found a solution or hint of what could cause this? I can't stream any longer than 20 to 60 seconds to the server anymore always getting this:

OBS 18.0.1 64bit

13:04:42.323: [rtmp stream: 'adv_stream'] Connecting to RTMP URL rtmp://***/live...
13:04:42.326: [rtmp stream: 'adv_stream'] Interface: Broadcom NetLink (TM) Gigabit Ethernet (ethernet, 1000 mbps)
13:04:42.514: [rtmp stream: 'adv_stream'] Connection to rtmp://***/live successful
13:04:42.519: ==== Streaming Start ===============================================
13:05:01.240: WriteN, RTMP send error 10053 (551 bytes)
13:05:01.240: WriteN, RTMP send error 10053 (61 bytes)
13:05:01.240: WriteN, RTMP send error 10038 (42 bytes)
13:05:01.240: [rtmp stream: 'adv_stream'] Disconnected from rtmp://***/live
13:05:01.240: Output 'adv_stream': stopping
13:05:01.240: Output 'adv_stream': Total encoded frames: 1135
13:05:01.240: Output 'adv_stream': Total drawn frames: 1136

It doesn't matter if I use software or Nvenc. I am streaming at 3500kbit, but going down to even 100kbit doesn't help anything. I have no packet loss to the server, MTR is fine, I can down and upload with 100mbit to it via other tests.

The old OBS 0.659b 64bit shows the same issue, with other log entries:

12:16:02: SO_SNDBUF was at 65536
12:16:03: RTMPPublisher::SocketLoop: Increasing send buffer to ISB 131072 (buffer: 0 / 528384)
12:16:05: RTMPPublisher::SocketLoop: Increasing send buffer to ISB 262144 (buffer: 0 / 528384)
12:16:53: RTMPPublisher::SocketLoop: Received FD_CLOSE, 7 ms since last send (buffer: 0 / 528384)
12:16:53: RTMPPublisher::SocketLoop: Aborting due to FD_CLOSE, error 0
12:16:53: FlushBufferedVideo: Flushing 46 packets over 750 ms
12:16:54: Total frames encoded: 3203, total frames duplicated: 0 (0.00%)
12:16:54: Total frames rendered: 3207, number of late frames: 1 (0.03%) (it's okay for some frames to be late)
12:16:54: Encoder closed
 
Last edited:

Leolph

New Member
@lulusoccer @mueffl I have still the same problems with OBS Studio and I am still fine with using OBS classic.

Maybe in August there might be a new PC coming around, until then I am lurking here and wait for a solution / workaround.
 

R1CH

Forum Admin
Developer
@mueffl, your log shows you were disconnected by your RTMP server. Check there for clues.

For those experiencing this issue in OBS Studio, make sure to post a log from a session where you've turned on the "New networking code" option in advanced settings.
 

Leolph

New Member
@mueffl, your log shows you were disconnected by your RTMP server. Check there for clues.

For those experiencing this issue in OBS Studio, make sure to post a log from a session where you've turned on the "New networking code" option in advanced settings.

Not sure why you don't write a single word on my posts above, I can only think that you just don't have any answer for the problem.
So I had hope that 19.0.3-64bit OBS Studio would solve the connection issues, but sadly that's not the case - even with the "new network code" mysterious thing. Well, here some logs..

Code:
12:11:12.661: [rtmp stream: 'adv_stream'] Connecting to RTMP URL rtmp://live-fra.twitch.tv/app...
12:11:12.697: [rtmp stream: 'adv_stream'] Interface: Realtek PCIe GBE Family Controller (ethernet, 100 mbps)
12:11:14.322: [rtmp stream: 'adv_stream'] Connection to rtmp://live-fra.twitch.tv/app successful
12:11:14.322: [rtmp stream: 'adv_stream'] New socket loop enabled by user
12:11:14.325: ==== Streaming Start ===============================================
13:59:56.698: socket_thread_windows: Received FD_CLOSE, 30172 ms since last send (buffer: 0 / 208384)
13:59:56.698: socket_thread_windows: Aborting due to FD_CLOSE, error 0
14:00:08.873: [rtmp stream: 'adv_stream'] Disconnected from rtmp://live-fra.twitch.tv/app
14:00:08.873: Output 'adv_stream': stopping
14:00:08.873: Output 'adv_stream': Total encoded frames: 189710
14:00:08.873: Output 'adv_stream': Total drawn frames: 196074
14:00:08.873: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 2661 (1.4%)
14:00:08.873: Output 'adv_stream':  Reconnecting in 10 seconds..
[...]
14:00:18.874: ---------------------------------
14:00:18.881: [rtmp stream: 'adv_stream'] Connecting to RTMP URL rtmp://live-fra.twitch.tv/app...
14:00:18.901: [rtmp stream: 'adv_stream'] Interface: Realtek PCIe GBE Family Controller (ethernet, 100 mbps)
14:00:20.516: [rtmp stream: 'adv_stream'] Connection to rtmp://live-fra.twitch.tv/app successful
14:00:20.516: [rtmp stream: 'adv_stream'] New socket loop enabled by user
14:15:57.829: socket_thread_windows: Received FD_CLOSE, 30181 ms since last send (buffer: 0 / 208384)
14:15:57.829: socket_thread_windows: Aborting due to FD_CLOSE, error 0
14:16:07.631: [rtmp stream: 'adv_stream'] Disconnected from rtmp://live-fra.twitch.tv/app
14:16:07.632: Output 'adv_stream': stopping
14:16:07.632: Output 'adv_stream': Total encoded frames: 4294798182
14:16:07.632: Output 'adv_stream': Total drawn frames: 28463
14:16:07.632: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 1476 (5.2%)
14:16:07.632: Output 'adv_stream':  Reconnecting in 10 seconds..
14:16:17.633: ---------------------------------
[...]
14:16:17.641: [rtmp stream: 'adv_stream'] Connecting to RTMP URL rtmp://live-fra.twitch.tv/app...
14:16:17.661: [rtmp stream: 'adv_stream'] Interface: Realtek PCIe GBE Family Controller (ethernet, 100 mbps)
14:16:19.292: [rtmp stream: 'adv_stream'] Connection to rtmp://live-fra.twitch.tv/app successful
14:16:19.293: [rtmp stream: 'adv_stream'] New socket loop enabled by user
14:31:47.424: socket_thread_windows: Received FD_CLOSE, 30278 ms since last send (buffer: 0 / 208384)
14:31:47.424: socket_thread_windows: Aborting due to FD_CLOSE, error 0
14:32:18.589: [rtmp stream: 'adv_stream'] Disconnected from rtmp://live-fra.twitch.tv/app
14:32:18.589: Output 'adv_stream': stopping
14:32:18.589: Output 'adv_stream': Total encoded frames: 4294965513
14:32:18.589: Output 'adv_stream': Total drawn frames: 28828
14:32:18.589: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 2112 (7.3%)
14:32:18.589: Output 'adv_stream':  Reconnecting in 10 seconds..
14:32:28.589: ---------------------------------
 

R1CH

Forum Admin
Developer
Strange log, it looks like OBS has no more data to send so Twitch disconnects you after their 30 second timeout.
 

reedog117

New Member
Hate to revive an old thread but I’m having the same error with both old and new networking code in 23.2.1. TwitchTest on my system yields 100 quality and 10000+ kbps bandwidth to multiple endpoints and OBS is in a datacenter with multiple redundant paths outbound. Ping is less than 20ms to multiple ingest servers.

It almost seems like a memory leak if OBS has been running too long. One thing I noticed in the last post in this thread is that number of encoded frames is right near the maximum number for a 32-bit unsigned long. Considering I’m streaming at 60fps I’m wondering if that’s exacerbating the issue.

https://obsproject.com/logs/AupRzsfIftCytv9a
 

Narcogen

Active Member
You should make a new thread, looking at your log and theirs your problem is unrelated.

The WriteN log message occurs when there's no active connection to send data to, but OBS is still trying. You've already been disconnected at that point, and there have been multiple OS and application updates since 2016/7.
 
Last edited:
I've determined the disconnects are from mismatched audio frequencies on your Input and output audio devices. Say you're using Virtual audio cable Input and it's set to 44.1 khz and your virtual audio cable output is set to 48 khz, it messes up the audio buffering. Once max buffering hits, it closes the stream and will continue until you restart OBS. this shouldn't happen if you have all your frequencies matched.
 
Top