DistroAV icon indicating copy to clipboard operation
DistroAV copied to clipboard

Apple silicon continues to distort in the right channel

Open nunowonder opened this issue 2 years ago • 8 comments

Hi all, In spite of having my solution that I shared with all of you: https://github.com/obs-ndi/obs-ndi/discussions/826

I have to say that if I don’t use that solution, and transmit the audio from the plug-in itself, the 4.11.1 version still distort the right channel…

it’s so hard to have a great computer and not being able to use it normal because of this plug-in :(

nunowonder avatar May 08 '23 13:05 nunowonder

Hello, Is it possible to understand if there is a chance of solution for this?

nunowonder avatar May 17 '23 17:05 nunowonder

Here's my workaround, but this is not perfect, as we have to have more resources: OBS-NDI my workaround_PeeEmPeeGee

nunowonder avatar Jun 03 '23 11:06 nunowonder

Hi everybody! Do you know if there is hope to fix the distort on the right channel? Did you see my workaround?

nunowonder avatar Oct 14 '23 10:10 nunowonder

I can look into this again. I did notice that there are a few discrepancies in the code between the Filter output and the Main output. I am testing some changes now.

paulpv avatar Nov 03 '23 23:11 paulpv

@nunowonder Can you help me out by confirming if it is the Filter output audio or the Main output audio that has the problem?

Any example of the code differences between the Filter's audio output and the Main's audio output. Filter: https://github.com/obs-ndi/obs-ndi/blob/79b2f80b645efebf276f4cd2567775384970e093/src/obs-ndi-filter.cpp#L352-L383 Uses:

  • NDIlib_audio_frame_v2_t
  • audio_frame.timecode = (int64_t)(audio_data->timestamp / 100);
  • A single dynamically allocated buffer
  • send_send_audio_v2
  • frees the buffer

Main: https://github.com/obs-ndi/obs-ndi/blob/79b2f80b645efebf276f4cd2567775384970e093/src/obs-ndi-output.cpp#L335-L370 Uses:

  • NDIlib_audio_frame_v3_t
  • audio_frame.timecode = NDIlib_send_timecode_synthesize;
  • A dedicated buffer that is resized as necessary
  • send_send_audio_v3

This may be intentional, but I am thinking of making them nearly identical...question is which one of these is the correct impl (plus I also can look at tt2468's rewrite branch impl too).

paulpv avatar Nov 03 '23 23:11 paulpv

I can look into this again. I did notice that there are a few discrepancies in the code between the Filter output and the Main output. I am testing some changes now.

Oh my God, some great news here!!! Thank you!

nunowonder avatar Nov 03 '23 23:11 nunowonder

Sure @paulpv ,

So, If I´m sending the NDI from MAIN OUTPUT to my receiving computer (Mac M1Max), the OBS plugin that catches it distorts the right channel. Let me just tell you that if I receive the same source on my receiving computer through the sotware "NDI VIRTUAL INPUT", it don´t distort, so the problem is the plugin itself, the receiving one.

Bad news: if I change the NDI Source of the receiving OBS to catches the NDI filter inside an audio source of OBS sender, it also distorts the right channel...

nunowonder avatar Nov 04 '23 13:11 nunowonder

Another thing VERY important: the Main Output sends audio with some delay. I use a very specific situation to contour this problems, but there is also a big problem, and that is not on the receiving computer, is the Main Output that sends audio delayed from image. I know because even If I change the NDI VIRTUALINPUT to the MAIN OUTPUT and not the Filter that I use to contour the distorting problem (and then I inject the sound from NDI virtual input to OBS capturing it), the sound is ok, I mean it's not distorting inside NDI VIRTUAL INPUT but it gives more delay. I can make a discord call to help you understand better this!

nunowonder avatar Nov 04 '23 14:11 nunowonder