Commit Graph

63 Commits

Author SHA1 Message Date
Jörg Müller
41a0411d79 Fix T99083: audio bad in command-line video player (blender -a)
There was a wrong sample size computation in PulseAudioDevice.
The sample format is switched to float32 for the command-line player.
2022-06-23 21:32:34 +02:00
Campbell Barton
42a6c226d0 CMake: fix AUDASPACE disabling WITH_PYTHON for Blender
When AUDASPACE couldn't find NUMPY, it would disable WITH_PYTHON for
the rest of Blender. Now setting the value globally is only done for
standalone AUDASPACE builds. Now it's possible to build Blender with
AUDASPACE & PYTHON but without NUMPY.

While this isn't an especially important configuration to support,
having Python mysteriously disabled is a hassle to troubleshoot.

NOTE: extern/audaspace/CMakeLists.txt has become out sync with the
original [0], it seems this is being maintained in our repository.

[0]: https://github.com/neXyon/audaspace/blob/master/CMakeLists.txt
2022-05-20 11:18:49 +10:00
Jörg Müller
ac8beb4fda Fix T97453: Blender crash when selecting Caching checkbox in VSE
Merge Audaspace fixes from upstream.
2022-04-22 22:36:04 +02:00
Sebastian Parborg
c2016feadc Merge branch 'blender-v3.1-release' 2022-02-18 18:25:31 +01:00
Sebastian Parborg
af6a1b08e3 VSE: Refactor our code to be compatible with ffmpeg 5.0
In ffmpeg 5.0, several variables were made const to try to prevent bad API usage.
Removed some dead code that wasn't used anymore as well.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D14063
2022-02-18 18:24:16 +01:00
Jörg Müller
4782713390 Fix T94994: Anim Player Stops working In Video Sequence Editor
Port from upstream: variable was unitialized when device initialization
failed when the WASAPI mixing thread is started.
2022-02-15 20:04:42 +01:00
Jörg Müller
2a095d8bfe Audaspace: port bugfixes from upstream.
Windows audio backend (WASAPI) now automatically switches to
the selected audio device in windows.
2022-01-14 22:51:35 +01:00
Xavier Cho
62d64bec2a Docs: Fixes and improvements in API documentation
Fixes several notable mistakes and missing information
regarding the API documentation (*.rst).

This will allow API stub generators like bpystubgen or
fake-bpy-module to produce more accurate result.

Differential Revision: https://developer.blender.org/D12639
2021-10-22 18:27:16 -04:00
Jörg Müller
f7608276e3 Audaspace: port bugfix from upstream.
Fixes T91615: Instant crash when dragging video file into video editor sequencer
2021-09-23 23:27:49 +02:00
Jörg Müller
8324ac8457 Audaspace: porting upstream pulseaudio fixes.
Fixes T89045 and T91057.
2021-09-21 22:20:34 +02:00
Jörg Müller
bdbc7e12a0 Audaspace: added audio file streams functionality.
On the blender side this commit fixes importing video files with audio
and video streams that do not share the same start time and duration.

Differential Revision: https://developer.blender.org/D12353
2021-09-18 21:45:33 +02:00
Jörg Müller
a217e043be Audaspace: porting PulseAudio fixes from upstream. 2021-08-18 22:22:21 +02:00
Sebastian Parborg
2946f72a2a VSE: Use lines to draw waveform
Refactor and improve waveform drawing.

Drawing now can use line strips to draw waveforms instead of only
triangle strips. This makes us able to properly visualize thin waveforms
as they would not be visible before. We now also draw the RMS value of
the waveform.

The waveform drawing is now also properly aligned to the screen pixels
to avoid flickering when transforming the strip.

Reviewed By: Richard Antalik

Differential Revision: https://developer.blender.org/D11184
2021-08-16 15:12:19 +02:00
Sebastian Parborg
ded68fb102 VSE: Fix audaspace not reading ffmpeg files with start offset correctly
The duration and start time for audio strips were not correctly read in
audaspace.

Some video files have a "lead in" section of audio that plays before the
video starts playing back. Before this patch, we would play this lead in
audio at the same time as the video started and thus the audio would not
be in sync anymore.

Now the lead in audio is cut off and the duration should be correctly
calculated with this in mind.

If the audio starts after the video, the audio strip is shifted to
account for this, but it will also lead to cut off audio which might not
be wanted. However we don't have a simple way to solve this at this
point.

Differential Revision: http://developer.blender.org/D11917
2021-08-16 15:10:58 +02:00
Ray Molenkamp
32c687b5ec Clean-up: Remove UTF8-BOM markers
Done at the request of Sergey.
2021-08-10 11:27:18 -06:00
Jörg Müller
a112adf16a Audaspace: porting pulseaudio fixes from upstream. 2021-07-01 14:26:13 +02:00
Jörg Müller
19d19970e4 Fix T88887: Audio causes issues with Playback when PC put to Sleep, Hibernate or when Screensaver appears
Porting WASAPI device reinitialization from upstream.
2021-07-01 14:26:13 +02:00
Jörg Müller
530f2994e9 Fix T88614: Mixdown crashes Blender 2.92.0 and 3.0.0 Alpha
The problem is caused by the most recent ffmpeg version (4.4) which
needs channels to be set when submitting a frame for encoding.
2021-05-27 19:05:17 +02:00
Jörg Müller
35cf34de6d Fix T86851: PulseAudio randomly asserts in background rendering
Upstream fix from Audaspace with simplified PulseAudio code.

Maniphest Tasks: T86851

Differential Revision: https://developer.blender.org/D10840
2021-03-29 12:16:01 +02:00
Jörg Müller
250a69ee82 Fix T86728: Blender freezes when playhead is dragged in this .blend
Porting the deadlock bugfix in WASAPI from upstream Audaspace.
2021-03-19 21:42:55 +01:00
Jörg Müller
de06cb8559 Bugfix: properly rename Null audio device to None 2021-03-16 23:45:49 +01:00
Jörg Müller
12c08ceee3 Audaspace: add support for CoreAudio on macOS
This adds CoreAudio as audio backend on macOS.
CoreAudio is the standard audio API on macOS.

Ref T86590
2021-03-16 23:21:45 +01:00
Jörg Müller
bc57985306 Audaspace: add support for WASAPI on Windows
This adds WASAPI as audio backend on Windows.
WASAPI is the modern standard audio API on
Windows introduced with Windows Vista.

Ref T86590
2021-03-16 23:21:45 +01:00
Jörg Müller
d33339ebf4 Audaspace: add support for PulseAudio on Linux
This adds PulseAudio as audio backend on Linux.
PulseAudio is the main audio engine used on most,
if not all, Linux distributions today.

Ref T86590
2021-03-16 23:21:45 +01:00
Jörg Müller
7b8fc307dc Audaspace: porting minor improvements from upstream
- NullDevice is now called None
- Automatic choice of best available device.
- Minor formatting, documentation and cmake fixes.
2021-03-16 23:21:45 +01:00
Jörg Müller
58c697a9ec Audaspace: port accuracy improvement from upstream. 2020-12-24 10:42:16 +01:00
Jörg Müller
83ad35cb9c Fix T83997: Duplicated audio does not sound the same
The issue was that sounds were always faded from 0 volume when they
started and depending on the currently used buffer size, the fading took
longer or shorter.

The solution stores whether the sound has ever been played back and
consequently does not fade when starting to play back.
2020-12-24 10:42:16 +01:00
Bastien Montagne
010f44b855 Fix several issues with handling of numpy in CMake.
Issues were:
* Abusing of `WITH_PYTHON_INSTALL_NUMPY` by both Audaspace and
  Mantaflow.
    - `PYTHON_INSTALL` options only decide whether we copy python (and
      some extra modules) in our Blender installation. On linux it
      makes much more sense to use global python installation.
    - Now we have instead a proper `WITH_PYTHON_NUMPY`
* Bad assumptions regarding path of headers relative to path of python
  module.
    - In current Debian testing, modules are under `python3.9`
      directory, while headers are under `python3` directory.
    - Now we properly `find_path` for headers as well, modifying
      `find_python_package` to take an optional argument for headers.

Note that the required changes done to `extern` libraries are in
blender-specific files that do not exist upstream.

Differential Revision: https://developer.blender.org/D9773
2020-12-14 16:44:55 +01:00
Bastien Montagne
551856ed32 Revert "Fix several issues with handling of numpy in CMake."
This reverts commit 5d570c875eda8fb9aa3635f7f4edac0dc1eaedc8.

Buildbots are still borken, need more time to investigate.
2020-12-14 12:29:34 +01:00
Bastien Montagne
5d570c875e Fix several issues with handling of numpy in CMake.
Issues were:
* Abusing of `WITH_PYTHON_INSTALL_NUMPY` by both Audaspace and
  Mantaflow.
    - `PYTHON_INSTALL` options only decide whether we copy python (and
      some extra modules) in our Blender installation. On linux it
      makes much more sense to use global python installation.
    - Now we have instead a proper `WITH_PYTHON_NUMPY`
* Bad assumptions regarding path of headers relative to path of python
  module.
    - In current Debian testing, modules are under `python3.9`
      directory, while headers are under `python3` directory.
    - Now we properly `find_path` for headers as well, modifying
      `find_python_package` to take an optional argument for headers.

Note that the required changes done to `extern` libraries are in
blender-specific files that do not exist upstream.

Differential Revision: https://developer.blender.org/D9773
2020-12-14 11:00:28 +01:00
Dalai Felinto
46e66d154c Missing README.blender license files + New BSD cases
I also changed New BSD to BSD 3 Clause.

Differential Revision: https://developer.blender.org/D9791
2020-12-08 18:51:14 +01:00
Aaron Carlisle
b8f25dd698 PyDoc: Fix typo in extern audaspace documentation
A PR has also been sent upstream:
https://github.com/neXyon/audaspace/pull/33
2020-10-07 16:17:22 -04:00
Joerg Mueller
9cac181fbe Audaspace: port changes from upstream.
Adds possibility to report progress during audio mixdown.
2020-09-07 18:12:45 +02:00
Joerg Mueller
3c54db4a4e Audaspace: port compilation fix from upstream. 2020-09-01 18:12:48 +02:00
Joerg Mueller
3593dff147 Fix T79374: Render audio produces random clipping
Port of the bugfix from audaspace upstream.
2020-08-03 17:42:36 +02:00
Joerg Mueller
92f6f6d30e Audaspace: port documentation bugfix from upstream. 2020-08-03 14:21:54 +02:00
Jörg Müller
fe3ca3f6ce Fix T66786: Audio SDL: Video editor Sound muted without muting it
Porting fix for SDL 2 audio formats from audaspace upstream.
2020-06-13 15:19:03 +02:00
Jörg Müller
fe891d581d Audaspace: update from upstream
- Changing API for time values from float to double for better precision.
- Fixing minor mistakes in the documentation.
- Fixing minor unnecessary large memory allocation.
2020-05-03 15:30:35 +02:00
Aaron Carlisle
899bfdc412 Audaspace: Update From Upstream (For API Docs)
No functional changes:

- Cleanup Spelling, Line Length
- Use proper class method styling for py docs
- Fix Broken Links

Differential Revision: https://developer.blender.org/D7276

Fixes T75191
2020-03-30 17:47:40 -04:00
Sergey Sharybin
3e77765362 Audaspace: Various fixes
- Fixed uninitialized result used in DynamicMusic::seek().

  The comment to this function says false is returned if the handle
  is invalid, while in practice non-initialized value will be returned.

- Spelling typos in comment.

- Silence -Wdelete-non-abstract-non-virtual-dtor warning.

Differential Revision: https://developer.blender.org/D6896
2020-02-21 18:31:56 +01:00
Joerg Mueller
e93aa9c0fc Fix T71621: VSE crashes when playing last frame of audio
Porting bug fix from audaspace upstream.
2019-11-22 10:34:01 +01:00
122ba774e0 Fix T71621: VSE crashes when playing last frame of audio
Due to some floating point errors the last frame of a VSE audio strip can
cause integer overflow and crash Blender. This overflow was caused by a
cast from `int64_t` to `int` without prior check. The crash is fixed by
keeping the variable as `int64_t` for as long as possible.
2019-11-21 10:01:12 +01:00
Ray Molenkamp
67fa8d2307 Fix: Build error with msvc
std::min requires the algorithm header
2019-11-17 09:09:58 -07:00
Jörg Müller
fb1cbbaf46 Fix T71322: Crash in Audaspace with some video file
Getting upstream audaspace fixes for audio files with more than 8
channels.
2019-11-17 09:02:18 +01:00
Jörg Müller
514c9d14e4 Fix T68945: VSE - Improper audio on frame 1
This has already been fixed in 8d207cdc3b307fa20bc5b29059c596306aa2a65c
as fix for T52472: VSE Audio Volume not set immediately, but I failed to
backport it to upstream audaspace which is the reason the problem was
back.
2019-10-03 10:26:48 +02:00
Jörg Müller
c56133c846 Fix T64480: Tweak needed to Audaspace CMake options
The issue was that Audaspace options ended up in the cmake cache though
they should not be there.

Also reverting indentation change by @ideasman42.
Thanks to @mont29 for reporting and helping with the fix.
2019-05-22 12:14:51 +02:00
Jörg Müller
8096f36796 Audaspace: porting changes from upstream.
- Silence now has an optional sample rate parameter.
- Fix: wrong length reported by modulator and superpose.
- Minor formatting, include and documentation fixes.
2019-05-10 23:01:04 +02:00
Campbell Barton
3076d95ba4 Cleanup: use 2 space indentation for CMake 2019-04-17 06:35:54 +02:00
Ray Molenkamp
9cdc3483ca Fix: Build error with msvc2019. 2019-04-11 06:56:40 -06:00
Jörg Müller
322abc1428 Audaspace: merging modulator effect from upstream. 2019-04-03 19:56:25 +02:00