Beam

Beam v1.1.0

Hello all!

I would love to try out this solution, but I need a MacOS version, it can be in ROSETTA, even though I would prefer in M1 (I have a M1Max64Gb) but I mean, I already use Teleport on Rosetta version of OBS so... The thing is: Teleport don´t have Alpha transparency. NDI is just too laggy for my needs. Teleport is flawless in terms of not lagging, and quality is perfect. But maybe BEAM will be better than any of those solutions. Can you please try to do it for MAC? I can be tester, helper, anything... @YorVeX I will thank you very much, send me DM if you want ;)

A few points:

First, to send NDI, are you using the NDI output option under Tools? If you are, are you using the "BGRA" colorspace in the Advanced menu? You need to in order to have alpha channel stream support. If you are using a filter, you can get away with a lot more, but you need to use a second stream if you need to send audio.

If you're set up like you're supposed to and it's STILL lagging, I agree with @YorVeX. If you're using NDI and you're at gigabit ethernet already, you have other underlying problems. Your network speed is likely not the problem. Also, be sure you're using Apple Silicon versions of OBS Studio, the OBS-NDI plugin as well as the NDI runtime itself. I suspect the very instant you involve Rosetta at any part of the stack, whether it's NDI or Beam you're using, notwithstanding network bandwidth for a moment, your day will get a lot worse.

But then again, full disclosure, I am not a Mac person. I would say other things about that, but I do not want to piss people off, 'specially the moderators. :3 But I digress.

As for Teleport, due to the very way it works, it cannot support alpha channels because it uses a JPEG-based algorithm. I don't know whether it's "true" MJPEG (Motion JPEG) like many other programs out there use, but it basically compresses individual frames, then shoots them over the network.

--Katt. =^.^=
 
I think there is freeze when the NIC driver used by beam becomes responseless while using beam, it doesn't work anymore. and there is also freeze at OBS shutdown procedure.
when I press exit of OBS after beam freeze, OBS also freeze, so should force shutdown. (beam GUI works even after freeze, but does nothing)

how to reproduce
Alt-tabbing games which set as fullscreen(fullscreen optimization disabled)
Change the NIC driver setting used by beam in device manager
Disable, and enable the NIC driver used by beam in device manager or network connections

NIC: ConnectX-3 to both sides, directly connected
Also, reproduced by ASIX AX88179
 

YorVeX

Member
I think there is freeze when the NIC driver used by beam becomes responseless while using beam, it doesn't work anymore. and there is also freeze at OBS shutdown procedure.
when I press exit of OBS after beam freeze, OBS also freeze, so should force shutdown. (beam GUI works even after freeze, but does nothing)

how to reproduce
Alt-tabbing games which set as fullscreen(fullscreen optimization disabled)
Change the NIC driver setting used by beam in device manager
Disable, and enable the NIC driver used by beam in device manager or network connections

NIC: ConnectX-3 to both sides, directly connected
Also, reproduced by ASIX AX88179
That's a bit like asking Tesla to fix their car because it crashes when you remove and replace the tires while driving 100.
If you freeze (because of config change) or even disable the network driver while Beam is using it, for sure that will cause problems. The solution: simply don't do that. Just as Tesla would tell you not to work on the tires while driving. You can't work on hardware while it is being used.

I can't reproduce issues while alt-tabbing myself, can you send a log of both sender and receiver when that happens please? Does it happen with Arma 3? Do you use a different resolution in Arma than on your desktop? Unfortunately I don't have that game myself, I can only try with a few different games.
 
That's a bit like asking Tesla to fix their car because it crashes when you remove and replace the tires while driving 100.
If you freeze (because of config change) or even disable the network driver while Beam is using it, for sure that will cause problems. The solution: simply don't do that. Just as Tesla would tell you not to work on the tires while driving. You can't work on hardware while it is being used.
Yeah, literally how to reproduce. it is the easiest way to reproduce the symptom.

Resolution is same, both desktop, game are 1920x1080.

https://obsproject.com/logs/GuZ3fT8k89vgbJ7N - receiver
https://obsproject.com/logs/NjZCv2TbuuMZvRBq - sender

When it happened, doesn't need to restart receiver, only sender.

BTW, I updated the GPU driver, and the symptom is mitigated alot, really alot... 552.22 to 555.85
But, still happening. games using D3D11, D3D12 barely cauing it now, but I think games using OpenGL do often.
https://github.com/exch-bms2/beatoraja at least it is causing it alot.
Before updating GPU driver, every games with fullscreen are causing it within 1~3 times of alt-tab.(fullscreen optimization disabled) even moonlight did.
But now, after updating GPU driver, it happened only once by Arma 3, dead space, EZ2ON with many times of alt-tab while I'm collecting logs.
Other games tested, Ready or Not, Squad, Battlebit, Project DIVA. not happened.
And seems large pages option causes it more. Arma 3, beatoraja can use it.
 
Last edited:

YorVeX

Member
Yeah, literally how to reproduce. it is the easiest way to reproduce the symptom.

Resolution is same, both desktop, game are 1920x1080.

https://obsproject.com/logs/GuZ3fT8k89vgbJ7N - receiver
https://obsproject.com/logs/NjZCv2TbuuMZvRBq - sender

When it happened, doesn't need to restart receiver, only sender.

BTW, I updated the GPU driver, and the symptom is mitigated alot, really alot... 552.22 to 555.85
But, still happening. games using D3D11, D3D12 barely cauing it now, but I think games using OpenGL do often.
https://github.com/exch-bms2/beatoraja at least it is causing it alot.
Before updating GPU driver, every games with fullscreen are causing it within 1~3 times of alt-tab.(fullscreen optimization disabled) even moonlight did.
But now, after updating GPU driver, it happened only once by Arma 3, dead space, EZ2ON with many times of alt-tab while I'm collecting logs.
Other games tested, Ready or Not, Squad, Battlebit, Project DIVA. not happened.
And seems large pages option causes it more. Arma 3, beatoraja can use it.
Glad to hear you could at least mitigate the problem a bit, also good job there providing verbose mode logs right away!
The OBS game capture seems to reset when you alt-tab:

Code:
00:51:05.295: [game-capture: 'Game Capture'] ----------------- d3d11 capture freed ----------------
00:51:05.314: [game-capture: 'Game Capture'] Found D3D11 11.0 device on swap chain
00:51:05.314: [game-capture: 'Game Capture'] DXGI_SWAP_CHAIN_DESC:
00:51:05.314:     BufferDesc.Width: 1920
00:51:05.314:     BufferDesc.Height: 1080
00:51:05.314:     BufferDesc.RefreshRate.Numerator: 0
00:51:05.314:     BufferDesc.RefreshRate.Denominator: 1
00:51:05.314:     BufferDesc.Format: 28
00:51:05.314:     BufferDesc.ScanlineOrdering: 0
00:51:05.314:     BufferDesc.Scaling: 0
00:51:05.314:     SampleDesc.Count: 1
00:51:05.314:     SampleDesc.Quality: 0
00:51:05.314:     BufferUsage: 48
00:51:05.314:     BufferCount: 2
00:51:05.314:     Windowed: 1
00:51:05.314:     SwapEffect: 3
00:51:05.314:     Flags: 2114
00:51:05.315: [game-capture: 'Game Capture'] d3d11 shared texture capture successful
00:51:05.320: [game-capture: 'Game Capture'] ----------------- d3d11 capture freed ----------------
00:51:05.328: [game-capture: 'Game Capture'] Found D3D11 11.0 device on swap chain
00:51:05.328: [game-capture: 'Game Capture'] DXGI_SWAP_CHAIN_DESC:
00:51:05.328:     BufferDesc.Width: 1920
00:51:05.328:     BufferDesc.Height: 1080
00:51:05.328:     BufferDesc.RefreshRate.Numerator: 0
00:51:05.328:     BufferDesc.RefreshRate.Denominator: 1
00:51:05.328:     BufferDesc.Format: 28
00:51:05.328:     BufferDesc.ScanlineOrdering: 0
00:51:05.328:     BufferDesc.Scaling: 0
00:51:05.328:     SampleDesc.Count: 1
00:51:05.328:     SampleDesc.Quality: 0
00:51:05.328:     BufferUsage: 48
00:51:05.328:     BufferCount: 2
00:51:05.328:     Windowed: 1
00:51:05.328:     SwapEffect: 3
00:51:05.328:     Flags: 2114
00:51:05.328: [game-capture: 'Game Capture'] d3d11 shared texture capture successful

This happens twice within milliseconds, which makes me wonder a bit, what's your "Hook Rate" setting on that game capture?

Either way, this short interruption on the frames Beam is getting from OBS seems to start the problems, and it seems that's because the "Receiver timeout" mechanism is incorrectly triggered here. It should occur only after 1000 ms of not getting receive confirmations from the receiver, but apparently occurs a lot faster. It's based on the global _lastFrameTime variable that isn't accessed in a thread-safe way, which might be the culprit. Or I am just tired and it's something else xD

Will do some tests and maybe come up with a new beta release, would be nice if you could test it then to see whether it solves your issue.
 

DogRocketeer

New Member
is there a way to disable the send output from streamer.bot or through obs websocket?
i have an automation on a remote obs that needs to change profiles (which has a different resolution) and it doesnt update because the sender is still active so the scene is messed.

I need to disable the beam, change the profile then re-enable the beam.

cant seem to make it work... anyone know if this is possible?
 

YorVeX

Member
is there a way to disable the send output from streamer.bot or through obs websocket?
i have an automation on a remote obs that needs to change profiles (which has a different resolution) and it doesnt update because the sender is still active so the scene is messed.

I need to disable the beam, change the profile then re-enable the beam.

cant seem to make it work... anyone know if this is possible?
I have never used streamer.bot myself so cannot go into details, at least in theory you should be able to stop it using the StopOutput request specifying either "Beam Output" or "Beam Sender Output" as parameter for the output name (one is the unique ID string and one is the display name, not sure which of the two it expects but one of them should work, just try both).

Stopping and starting outputs in OBS can take a short time, I'd suggest you wait 1-2 seconds in your automation before switching the profile. Then after the switch you can start the output again using StartOutput.

I don't think I ever tried controlling Beam's output this way, so I am not sure how it reacts. Let me know if you run into any issues with it.
 
Last edited:

DogRocketeer

New Member
I have never used streamer.bot myself so cannot go into details, at least in theory you should be able to stop it using the StopOutput request specifying either "Beam Output" or "Beam Sender Output" as parameter for the output name (one is the unique ID string and one is the display name, not sure which of the two it expects but one of them should work, just try both).

Stopping and starting outputs in OBS can take a short time, I'd suggest you wait 1-2 seconds in your automation before switching the profile. Then after the switch you can start the output again using StartOutput.

I don't think I ever tried controlling Beam's output this way, so I am not sure how it reacts. Let me know if you run into any issues with it.

hey thanks for the reply.
this DOES actually work, kinda.

Code:
{
  "requestType": "StopOutput",
  "requestData": {
    "outputName": "Beam Output"
  }
}


That works. cuz the beam output does stop. The profile does let me change it properly now.
But the check mark in the beam section stays on the whole time.
When its done, I do:

Code:
{
  "requestType": "StartOutput",
  "requestData": {
    "outputName": "Beam Output"
  }
}

and OBS crashes every time.

I can confirm waiting longer times changes nothing. Same behavior.
I can also confirm the start and stop do ACTUALLY work tho. Even within a second of each other. I can see the output come and go on the stream laptop just fine. The crash happens if I change the profile and THEN try and start the Beam Output again.

Even tho the profile DOES in fact change. This is important because if I manually try and change the profile in OBS and the check box is still on in the Beam Sender Output, the check MARK on the target profile DOES indicate its on the target profile but the actual profile in OBS does not change. Its the OBS log that tells me it cant change it while output is active.

Side note, since the Beam output doesnt send audio, I have the mic and active app audio filters beaming as well. I dont see these outputs in the GetOutputList, but also they're audio only. I tried disabling them manually anyway just to see but it stays the same.

For now im, setting the profile. then I wrote batch script that gets triggered on this machine and kills OBS...then restarts it.. it restarts in the new profile and the beam is on from previous. The issue with this is obvious.. killing and restarting an app isnt reliable but also it takes 30 full seconds to get everything back.

Maybe this can be done in the future. I hope so.
Thanks again for trying!
 

DogRocketeer

New Member
The crash in the log, if interested.

Code:
Unhandled exception: c0000005
Date/Time: 2024-06-24, 13:54:51
Fault address: 7FFAF5B23C07 (c:\program files\obs-studio\bin\64bit\w32-pthreads.dll)
libobs version: 30.1.2 (64-bit)
Windows version: 10.0 build 19045 (release: 22H2; revision: 4529; 64-bit)
CPU: Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz


Thread 50A8: (Crashed)
Stack            EIP              Arg0             Arg1             Arg2             Arg3             Address
000000338C9FED60 00007FFAF5B23C07 000001DC302C3E00 0000000000000001 000001DC37B4C200 0000000088090081 w32-pthreads.dll!pthread_mutex_unlock+0x27
000000338C9FEDC0 00007FFAE4D5648C 000001DC4FA47F60 0000000000000001 0000000000000001 000001DC4FA482F8 obs.dll!video_output_connect2+0x35c
000000338C9FEFC0 00007FFAE4D17433 000001DC4FA47F60 0000000000000000 0000000000000003 0000000000000038 obs.dll!hook_data_capture+0x253
000000338C9FF000 00007FFAE4D17C73 000001DC0F055FC0 000001DC5280CC28 0000000000000000 000001DC0F055FC0 obs.dll!obs_output_begin_data_capture+0x223
000000338C9FF060 00007FF995C48EF8 0000000000000000 000001DC4FA47F60 0000000000000000 0000000000000000 xobsbeam.dll!NetObsBindings_ObsInterop_Obs__obs_output_begin_data_capture+0x58
000000338C9FF100 00007FF995C23DBB 000001DC4F71E350 0000021D1D6CA430 00000B69AF8D1F6F 00007FF99632C687 xobsbeam.dll!xObsBeam_xObsBeam_Output__output_start+0x2eb
000000338C9FF190 00007FFAE4D12C71 000001DC4FA47F60 0000000000000000 000000338C9FF410 000000338C9FF710 obs.dll!obs_output_actual_start+0x51
000000338C9FF1C0 00007FFAE4D12D77 0000021D1D6CA410 0000021D1D6CA3F0 0000021D1D3E5A50 0000021D1D6CA3F0 obs.dll!obs_output_start+0x87
000000338C9FF1F0 00007FF996300D6C 000000338C9FF710 0000000000000000 000000338C9FF710 0000021D1D6CA930 obs-websocket.dll!RequestHandler::StartOutput+0x29c
000000338C9FF2B0 00007FF9962E5A4C 0000021D1D6CA5D0 000000338C9FF650 000000338C9FF9C0 000000338C9FF9C0 obs-websocket.dll!RequestHandler::ProcessRequest+0x19c
000000338C9FF310 00007FF9962D30E5 0000021D781D80A0 0000021D0DF10710 0000021D781D8320 0000021CE5031710 obs-websocket.dll!WebSocketServer::ProcessMessage+0x13d5
000000338C9FF7B0 00007FF99629F777 0000021CE5031710 000001DC4F5FF508 0000000000000001 0000000000000001 obs-websocket.dll!`WebSocketServer::onMessage'::`2'::<lambda_1>::operator()+0xc87
000000338C9FFB80 00007FF9F79098DA 0000021D7E6EA890 0000021D7E6EA890 0000000000000000 0000021CE5031788 qt6core.dll!0x7ff9f79098da
000000338C9FFC40 00007FF9F790544A 0000000000000000 0000000000000000 0000000000000000 0000000000000000 qt6core.dll!0x7ff9f790544a
000000338C9FFC90 00007FFB13BE7344 0000000000000000 0000000000000000 0000000000000000 0000000000000000 kernel32.dll!0x7ffb13be7344
000000338C9FFCC0 00007FFB1477CC91 0000000000000000 0000000000000000 0000000000000000 0000000000000000 ntdll.dll!0x7ffb1477cc91
 

YorVeX

Member
The crash happens if I change the profile and THEN try and start the Beam Output again.
Yeah, that's what I meant with "not sure how it reacts". Beam currently works by being enabled or disabled through its options in the UI and based on that initializes or deinitializes some things before starting or stopping the output. If something else starts or stops the outputs, Beam doesn't do this (de-)initialization stuff. I guess when it's then triggered by the obs_output_begin_data_capture event it tries to work with the output but missing that preparation it does thing's like trying to access memory it hasn't allocated, which would explain the crash you get on that obs_output_begin_data_capture event.

To make this possible I would probably have to change the flow so that Beam would do the full (de-)initialization stuff only based on the output start and stop events from OBS, the thing is, I think I tried this in the beginning and ran into some issues with that. Not saying it's impossible, but probably needs a considerable amount of work to get there. Will definitely start another attempt at this, but can't make any promises on timelimes I'm afraid.

Side note, since the Beam output doesnt send audio, I have the mic and active app audio filters beaming as well. I dont see these outputs in the GetOutputList, but also they're audio only. I tried disabling them manually anyway just to see but it stays the same.
The simple explanation here is that filters are not outputs, so they can't show up in GetOutputList. You can have multiple Beam filters, but only one output, which is the one you control through the Tools menu. And actually it should include audio, it certainly does for me, so I wonder about that part - IIRC OBS only includes audio track 1 in outputs, are these audio feeds maybe on different tracks? That's a limitation of OBS, nothing I can do much about, OBS just never sends the audio data to Beam (or any output in general) if it's not on track 1.
 
Last edited:
Top