Audaspace: Load CoreAudio device on demand #107607

Open
Richard Antalik wants to merge 4 commits from iss/blender:core-audio-on-demand into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

Refactor CoreAudioDevice code to support on demand device opening and
closing when sound is not playing.

Currently device is opened when AUD_init() is called and then closed
immediately. This is because it seems, that this is causing issues with
synchronizer and causes AV sync to fail.

Anothe issue seems to be usage of audio scrubbing. This seems to confuse the device and it fails to play audio at all after some time. For WASAPI this was also problematic and a solution could be to create a timer in new thread, that would delay closing of the device.

Refactor CoreAudioDevice code to support on demand device opening and closing when sound is not playing. Currently device is opened when AUD_init() is called and then closed immediately. This is because it seems, that this is causing issues with synchronizer and causes AV sync to fail. Anothe issue seems to be usage of audio scrubbing. This seems to confuse the device and it fails to play audio at all after some time. For WASAPI this was also problematic and a solution could be to create a timer in new thread, that would delay closing of the device.
Richard Antalik added 1 commit 2023-05-04 10:09:47 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
0b834f3573
Audaspace: Load CoreAudio device on demand
Refactor CoreAudioDevice code to support on demand device opening and
closing when sound is not playing.

Currently device is opened when AUD_init() is called and then closed
immediately. This is because it seems, that this is causing issues with
synchronizer and causes AV sync to fail.
Poster
Collaborator

@blender-bot package

@blender-bot package

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR107607) when ready.
Joerg Mueller requested changes 2023-05-04 16:47:35 +02:00
Joerg Mueller left a comment
Collaborator

Please follow the code style of audaspace and do not apply Blender's clang format in this file. This leads to way too many changes in this file. Audaspace has it's own clang format changes, but you should only format actually changed code.

I'd also name the methods simply open and close, the Device is superfluous and the open function is not on demand, it just opens.

Apart from that, the changes look good as far as I can tell. Cannot try it, since I lack the hardware though.

Please follow the code style of audaspace and do not apply Blender's clang format in this file. This leads to way too many changes in this file. Audaspace has it's own clang format changes, but you should only format actually changed code. I'd also name the methods simply `open` and `close`, the Device is superfluous and the open function is not on demand, it just opens. Apart from that, the changes look good as far as I can tell. Cannot try it, since I lack the hardware though.
Richard Antalik added 1 commit 2023-06-20 20:42:29 +02:00
Poster
Collaborator

@neXyon Hi, this should be ready to review,.Can you have a look?

@neXyon Hi, this should be ready to review,.Can you have a look?

Please fix the formatting first as I mentioned before, otherwise it's hard to read the diff.

Please fix the formatting first as I mentioned before, otherwise it's hard to read the diff.
Richard Antalik added 1 commit 2023-09-14 23:28:22 +02:00
Poster
Collaborator

@neXyon Sorry I was pretty sure I did that, but I was wrong. Would you in future accept plain cleanup patch to format the file? Otherwise I have to undo unintended changes manually which is bit tedious.

@neXyon Sorry I was pretty sure I did that, but I was wrong. Would you in future accept plain cleanup patch to format the file? Otherwise I have to undo unintended changes manually which is bit tedious.

Not sure what you mean? Do you mean running clang-format as auto-formatter? Clang format can also be run on just the changes in a diff which would be ideal here. So, can you apply the cleanup patch here already?

Not sure what you mean? Do you mean running clang-format as auto-formatter? Clang format can also be run on just the changes in a diff which would be ideal here. So, can you apply the cleanup patch here already?
Richard Antalik added 1 commit 2023-09-15 13:40:40 +02:00
Poster
Collaborator

Not sure what you mean?

I meant to make the files conform to format rules before I make any changes to files. I don't have IDE setup to work on Audaspace code, and MSVC is ignoring clang format currently anyway. Not sure if I broke the addon somehow. It's just in Blender we like to keep our code formatted at all times, so I thought about doing same thing in this case.

So, can you apply the cleanup patch here already?

OMG I forgot to commit changes before pushing :D

> Not sure what you mean? I meant to make the files conform to format rules before I make any changes to files. I don't have IDE setup to work on Audaspace code, and MSVC is ignoring clang format currently anyway. Not sure if I broke the addon somehow. It's just in Blender we like to keep our code formatted at all times, so I thought about doing same thing in this case. > So, can you apply the cleanup patch here already? OMG I forgot to commit changes before pushing :D

Reviewers

Joerg Mueller requested changes 2023-05-04 16:47:35 +02:00
Merge conflict checking is in progress. Try again in few moments.
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest: Wayland
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#107607
There is no content yet.