Skip to content

Audio-Only Mode Fix#1022

Closed
Trouffman wants to merge 2 commits into
DistroAV:developfrom
Trouffman:AudioOnly-Patch
Closed

Audio-Only Mode Fix#1022
Trouffman wants to merge 2 commits into
DistroAV:developfrom
Trouffman:AudioOnly-Patch

Conversation

@Trouffman

@Trouffman Trouffman commented May 16, 2024

Copy link
Copy Markdown
Collaborator

Fix audio bug that audio-Only mode does not work when restarting OBS.

Main bug with workaround solution: #592

Should fix the issues :
#429
#578
#981
#906
#621
#467
#298

This was tested and confirmed fixing the bug on Win 11 Home + Win 10 Home on OBS 30.1.1 (for the issue)

DO NOT MERGE!

This re-introduce another issue that the "last frame" of the input is not "cleared" when the bandwidth settings change from another one to "audio_only".

Fix audio bug that audio-Only mode does not work when restarting OBS.
Comment thread src/obs-ndi-source.cpp
Comment thread src/obs-ndi-source.cpp
case PROP_BW_AUDIO_ONLY:
recv_desc.bandwidth =
NDIlib_recv_bandwidth_audio_only;
obs_source_output_video(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So there is no need to send any blank frame?
If this was the only thing sending a blank frame, then all blank frame code should be removed entirety.

@paulpv paulpv May 16, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only other place we send blank frame is
https://github.com/obs-ndi/obs-ndi/blob/develop/src/obs-ndi-source.cpp#L940

void ndi_source_thread_stop(ndi_source_t *s)
{
	if (s->running) {
		s->running = false;
		pthread_join(s->av_thread, NULL);
		if (!s->config.remember_last_frame) {
			obs_source_output_video(s->obs_source,
						s->config.blank_frame);
		}
	}
}

Is this also not necessary?
I think the intention here is to intentionally render an empty frame when the source is switched away and "remember last frame" is not selected.
ie: to blank the frame.
But why would an audio only source need to blank a video frame it never had?
The only reason I can see to do this is if the config is changing from a normal a/v source to an audio only source.

@paulpv paulpv May 16, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FFR: PROP_BW_AUDIO_ONLY was first added 2017/11/29 in:
bafaf47#diff-6a31bbe65b845c97228452424d004830270b76230165c75ec3d1c67b2c6420e6R304

Then blank_video_frame() was first added 2018/03/24 in:
7d1cf13#diff-6a31bbe65b845c97228452424d004830270b76230165c75ec3d1c67b2c6420e6R446

The title of that 2018/03/24 PR is

source: reorder functions + clear last video frame in Audio Only mode

There has got to be a reason why this was added.
Thinking...

Maybe again only if the config is changing from a normal a/v source to an audio only source... something that would happen often while dev/testing this, and one time for most users changing from the default.

@Palakis @tt2468 ?

Removed trailing tab after the ;
@Trouffman Trouffman closed this May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants