Skip to content

Comments

aja: Subtract packet time from audio timestamp#6359

Merged
jp9000 merged 1 commit intoobsproject:masterfrom
norihiro:aja-audio-timestamp
Apr 23, 2022
Merged

aja: Subtract packet time from audio timestamp#6359
jp9000 merged 1 commit intoobsproject:masterfrom
norihiro:aja-audio-timestamp

Conversation

@norihiro
Copy link
Contributor

@norihiro norihiro commented Apr 20, 2022

Description

Subtract the audio packet time from the timestamp for audio.
The code is copied from pulse-input.c.

Motivation and Context

When calling obs_source_output_audio, timestamp should be the starting time of the audio packet.

How Has This Been Tested?

OS: Fedora 34.
Hardware: AJA Video Kona 4 (connected to the top PCIe slot)
CPU: Intel Core i7-11700
MB: ASRock Z590 Extreme (no GPU card is installed)
Camera: Sony SRG-120HD (configured to send 1080p59.94)
I found the bug during implementing another PR #6351.
The implementation was tested with debug information in the change of the PR.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

When calling `obs_source_output_audio`, timestamp should be the starting
time of the audio packet.
@RytoEX RytoEX added the Bug Fix Non-breaking change which fixes an issue label Apr 20, 2022
@jp9000
Copy link
Member

jp9000 commented Apr 20, 2022

What's the average duration of an audio segment for aja?

@norihiro
Copy link
Contributor Author

norihiro commented Apr 20, 2022

On my setup, it sends 800 frames for each packet at 48000 Hz in average, so 16.7 ms, it varies 784 to 816 samples.

@norihiro
Copy link
Contributor Author

It looks the segment time of the audio equals to the video frame time. If I configure my camera to 25 fps, the size of the segment becomes 1920 frames, 40ms.

@jp9000 jp9000 merged commit c5154cc into obsproject:master Apr 23, 2022
@norihiro norihiro deleted the aja-audio-timestamp branch April 23, 2022 14:27
@RytoEX RytoEX added this to the OBS Studio 28.0 milestone Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Fix Non-breaking change which fixes an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants