Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
81162cb
new override_speaker_channels option
goatchurchprime Mar 5, 2025
4ebd44c
add spaces around a +
goatchurchprime Mar 5, 2025
e3ca38b
doctool seems to have rearranged the xml entries
goatchurchprime Mar 5, 2025
ba211e1
Update doc/classes/ProjectSettings.xml
goatchurchprime Mar 6, 2025
d7cb9b2
Merge branch 'master' into gtch/simulate-surround-sound
goatchurchprime Apr 2, 2025
03fb3f6
clamp the values to prevent access to out of bounds memory
goatchurchprime Apr 3, 2025
05d8ffe
Fix EditorProperty shortcuts being global and unintentionally triggering
EricEzaM Mar 22, 2025
e8b2955
SCons: Only set GCC `-Wvirtual-inheritance` for C++ and `warnings=extra`
akien-mga Mar 31, 2025
f3a0cf3
Fix LogMultiplayer example in docs
matmas Feb 1, 2025
0646b7f
Add font import flag to toggle modulation of colored glyphs.
bruvzg Apr 1, 2025
aaea07a
Fix input config dialog overflow on Android Editor
syntaxerror247 Mar 31, 2025
a2a7d26
Directly use segment points in Geometry2D/3D function parameters
aaronfranke Mar 11, 2025
02061aa
Change navigation module LocalVector size_t uses to uint32_t
smix8 Apr 1, 2025
453baf3
Enable TTS on demand, instead of fully disabling it when project sett…
bruvzg Apr 1, 2025
9d7e47a
Allow to compile templates without navigation features
YeldhamDev Mar 30, 2025
40db9c5
Shader: Fix `bvec` to variant conversion
beicause Apr 1, 2025
1e7a69c
Fix CharacterBody's wall_min_slide_angle doc
Mar 3, 2025
8353a0a
Optimize HTML color validation
MewPurPur Apr 1, 2025
9ef3571
Remember last POT generator path
KoBeWi Apr 1, 2025
e949f19
Update class docs: `dpi_changed` signal is supported on Linux (Wayland)
MJacred Apr 1, 2025
ffaf304
Fix hash issue with OptimizedTranslation caused by signed char
zaevi Mar 16, 2025
4ea9c55
Remove bool from `Object::notification` virtual function; replace wit…
Ivorforce Apr 1, 2025
6a1e078
fix: use productCategory instead of vendorName for joy name on macos
sorascode Apr 1, 2025
6f76a35
Navigation: Replace the deprecated `Geometry2D::get_closest_point_to_…
beicause Apr 2, 2025
09f89f3
Expose TriangleMesh api functions wrapped for scripting
smix8 Mar 25, 2025
d0b6ba7
Allow higher freelook base speed values in the 3D editor settings
Calinou Apr 1, 2025
d2257c8
[Docs] Add note about console wrapper to `get_stdin_type`.
bruvzg Apr 2, 2025
2a487c3
Replace size() == 0 with is_empty().
YYF233333 Mar 19, 2025
6312a09
size() <= 0 and size() < 1.
YYF233333 Mar 20, 2025
a44f8a7
Prepare NavigationServer for process() and physics_process() split
smix8 Mar 31, 2025
f1038fd
SCons: Add `CPPEXTPATH` for external includes
Repiteo Apr 1, 2025
574a5f0
CryptoCore: Use size_t for buffer sizes to fix encoding/sums of 2.0+ …
akien-mga Apr 3, 2025
807c3a3
Display PortableCompressedTexture's format in inspector preview
beicause Apr 3, 2025
d47347a
Add is_inside_tree() check to SpringBoneSimulator3D
TokageItLab Mar 15, 2025
099bd4a
Fix invalid DAP responses when content had non-ASCII content
rsubtil Apr 2, 2025
9904ecf
Allow instantiate unexposed EditorPlugin form GDExtension.
Daylily-Zeleen Apr 2, 2025
dce1871
Fix Edit option for sub-resources
KoBeWi Apr 2, 2025
114d3dd
Mention DUPLICATE_SIGNALS only affects CONNECT_PERSIST signals
Mickeon Nov 24, 2024
a6f2868
Emit changed signal after baking navigation mesh
smix8 Mar 16, 2025
bacfaf9
Organize ifdefs for disabling navigation, physics, and XR
aaronfranke Apr 2, 2025
c6284b3
Removed unused `get_valid_parents_static` functions from `GDCLASS`.
Ivorforce Apr 2, 2025
1c6e0d3
Fix `BitMapEditor` crash when bitmap is empty
arkology Apr 3, 2025
8af7805
Make `swap_cancel_ok` setting 3-state instead of boolean.
bruvzg Apr 3, 2025
9c574c6
Detect KDE/LXQt and swap OK/Cancel buttons to Windows style.
bruvzg Apr 3, 2025
a5a07ac
PortableCompressedTexture: Fix create compressed format from image
beicause Apr 3, 2025
a612347
fix TextEdit VScroll max tolerance
BrotherShort Mar 29, 2025
8980708
Android Editor: Auto create `nomedia` file to hide project files in m…
syntaxerror247 Apr 3, 2025
0c53fe5
Cleanup QuickOpenDialog history and fix UID errors
KoBeWi Apr 3, 2025
585cc16
Remove unused `get_inheritance_list_static` from `GDCLASS`.
Ivorforce Apr 3, 2025
03d9260
[macOS] Fix native menu submenu items have wrong action and accelerat…
bruvzg Apr 3, 2025
e1629f3
Fix compiling with `disable_xr=yes`
beicause Apr 3, 2025
f7dea2a
Core: Integrate warning suppression macro helpers
Repiteo Mar 31, 2025
26bb395
Add p_delta argument to _process_modification() and expose advance()
TokageItLab Mar 5, 2025
0b23391
Add missing initializer_list constructor for TypedDictionary
tomfull123 Mar 26, 2025
5123818
JSONRPC: Require manual method registration
HolonProduction Apr 1, 2025
5dfaf58
Jolt: Update to 5.3.0
mihe Mar 21, 2025
6932a10
Validate custom directory when project is started
runzh-crypto Apr 4, 2025
e0aacd3
SCons: Integrate `WARNLEVEL` & `OPTIMIZELEVEL`
Repiteo Apr 3, 2025
909acac
CI: Remove "Free disk space on runner" job
Repiteo Apr 4, 2025
e7f8493
Core: Decouple `GDCLASS` from ClassDB
Repiteo Apr 4, 2025
d615848
Move `GD_IS_CLASS_ENABLED` and respective include from `class_db.h` t…
Ivorforce Apr 4, 2025
1e2642d
Wayland: Implement native sub-windows
deralmas Sep 27, 2024
380ce44
Change ClassDB::get_inheriters_from_class.
YYF233333 Jan 8, 2025
2705e5a
Revert "CI: Remove "Free disk space on runner" job"
Repiteo Apr 5, 2025
3bdf7c0
Combined TileMapLayer debug quadrant shapes to a surface
smix8 Apr 6, 2025
b1022a9
Fix differences between OpenXRInterface and XRHandTracker docs
Mickeon Apr 5, 2025
a1d468f
Core: Natively convert enum/BitField with Variant
Repiteo Jan 1, 2025
4147c46
Fix EditorHelpBitTooltip in single window mode.
bruvzg Apr 7, 2025
e1df0ac
Fix wrong translation method in FileDialog
KoBeWi Apr 3, 2025
039cb04
`VariantWriter::write`: fix writing negative infinity when p_compat i…
nikitalita Apr 3, 2025
159b9fe
Top-Aligned the Ruler's text to avoid draw conflicts
lodetrick Apr 3, 2025
39b05f6
Fallback Control.layout_mode to valid mode when child of non-containe…
kleonc Mar 25, 2025
1902e00
PortableCompressedTexture: Support ASTC format and creating directly …
beicause Apr 5, 2025
b40a029
Use the correct root inspector when making elements moved in an array…
Rindbee Mar 29, 2025
ad1372b
Android: Hardware keyboard connection status callback
syntaxerror247 Apr 4, 2025
4d579ab
Add an editor setting to enable/disable TouchActionsPanel
syntaxerror247 Apr 4, 2025
8723632
Re-organize UI in the shader editor
Chaosus Dec 11, 2024
a60cf31
Fix editing custom data for tilesets
JulianHeuser Apr 4, 2025
4ff12e7
Optimize Color.html()
MewPurPur Apr 1, 2025
589663d
CI: Bump various pre-commit hooks
Repiteo Mar 29, 2025
1c4a521
Avoid using a global variable to store instance index in canvas items…
clayjohn Apr 4, 2025
586272c
Fix Grabber Double Scaling when zoomed
lodetrick Apr 5, 2025
68b7d23
Consumes Scroll Events and fixes Mouse Warp
lodetrick Apr 5, 2025
733e173
Fix `Cannot get class` error when searching `TextFile`/`OtherFile`
jaydensipe Apr 7, 2025
4b8966f
Fix incorrect data format in RenderingDevice docs
Mickeon Apr 5, 2025
25cf7da
Fix typo in Window's `exclude_from_capture`
Mickeon Apr 5, 2025
337d826
LSP: Fix relative path handling for document links
HolonProduction Apr 5, 2025
8913fe6
LSP: Don't advertise support for workspace symbols
HolonProduction Apr 5, 2025
c975539
Add UID to file tooltip
KoBeWi Apr 5, 2025
f93b8a2
Do not use Dictionary::keys() for Dictionary iteration.
YYF233333 Mar 21, 2025
59b4ce8
Fixes Editor Scales in OpenXR GUI
lodetrick Apr 5, 2025
feb7829
Avoid array allocation when signal have 0 arg
Delsin-Yu Apr 6, 2025
b51f398
Fix caching of objects' class name pointer in `Object` instances.
Ivorforce Apr 6, 2025
b29f507
Fix *even* more miscellaneous oddities around the class reference
Mickeon Mar 18, 2025
c145ce7
validate any form of running project
runzh-crypto Apr 6, 2025
464ed99
Optimize `GDScriptLambdaCallable` by skipping the unnecessary `Object…
Ivorforce Feb 16, 2025
993e089
Update inspector theme when changed
Grublady Mar 18, 2025
01b2e8c
Add custom sort to center tab bar in the editor and project manager.
bruvzg Apr 6, 2025
bdd70b8
Add separate `minimize_disabled` and `maximize_disabled` window flags.
bruvzg Apr 6, 2025
2d428d5
Do not iterate Dictionary with get_key_at_index.
YYF233333 Mar 13, 2025
43a38ce
Handle the case where `waitpid` returns `errno` `EINTR`.
Ivorforce Apr 7, 2025
967d871
Set correct position of node with `Align Transform with View` in orth…
ydeltastar Nov 12, 2024
db5f061
Base accessibility API.
bruvzg Mar 21, 2025
466dae4
AccessKit integration for macOS, Linux, and Windows.
bruvzg Mar 21, 2025
13b0fb0
Initial editor accessibility.
bruvzg Mar 21, 2025
0120d06
Wayland: Fix error spam for closed windows
deralmas Apr 7, 2025
3c8f643
Makes embed floating window respect always on top
GustJc Mar 6, 2025
ae8dc49
Fix `FileAccessCompressed` claiming one byte more than it actually has.
Ivorforce Apr 8, 2025
586d6dc
Add an actual name for Ogg Vorbis importer/visible name.
DeeJayLSP Apr 8, 2025
12b14cd
[Editor] Use separate `EditorFileDialog` for "Pack Project as ZIP"
AThousandShips Apr 8, 2025
4769004
Optimize gdvirtual layout.
YYF233333 Mar 17, 2025
633de06
GDScript: Cancel suspended functions when reloading a script
HolonProduction Feb 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions doc/classes/ProjectSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,16 @@
<member name="audio/driver/output_latency.web" type="int" setter="" getter="" default="50">
Safer override for [member audio/driver/output_latency] in the Web platform, to avoid audio issues especially on mobile devices.
</member>
<member name="audio/driver/override_channel_out" type="int" setter="" getter="" default="0">
The channel index to send to the stereo output when [code]override_speaker_channels[/code] has forced there to be a higher number of actual channels.
</member>
<member name="audio/driver/override_channels" type="bool" setter="" getter="" default="false">
If [code]true[/code], the number of output channels will be set by [code]override_speaker_channels[/code] instead of the speaker mode of the output device.
Applies only to PulseAudio.
</member>
<member name="audio/driver/override_speaker_channels" type="int" setter="" getter="" default="8">
The number of channels to use when [code]override_channels[/code] is set to [code]true[/code].
</member>
<member name="audio/general/2d_panning_strength" type="float" setter="" getter="" default="0.5">
The base strength of the panning effect for all [AudioStreamPlayer2D] nodes. The panning strength can be further scaled on each Node using [member AudioStreamPlayer2D.panning_strength]. A value of [code]0.0[/code] disables stereo panning entirely, leaving only volume attenuation in place. A value of [code]1.0[/code] completely mutes one of the channels if the sound is located exactly to the left (or right) of the listener.
The default value of [code]0.5[/code] is tuned for headphones. When using speakers, you may find lower values to sound better as speakers have a lower stereo separation compared to headphones.
Expand Down
33 changes: 25 additions & 8 deletions drivers/pulseaudio/audio_driver_pulseaudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ Error AudioDriverPulseAudio::detect_channels(bool input) {
ERR_PRINT("pa_context_get_sink_info_by_name error");
}
}

return OK;
}

Expand All @@ -200,23 +199,31 @@ Error AudioDriverPulseAudio::init_output_device() {
return err;
}

switch (pa_map.channels) {
print_verbose("PulseAudio: detected " + itos(pa_map.channels) + " output channels");
pa_channels = pa_map.channels;
if (GLOBAL_GET("audio/driver/override_channels") && (pa_map.channels == 2)) {
pa_channels = GLOBAL_GET("audio/driver/override_speaker_channels");
pa_channel0 = GLOBAL_GET("audio/driver/override_channel_out");
print_verbose("PulseAudio: forcing " + itos(pa_channels) + " output channels, but outputting to " + itos(pa_channel0) + "," + itos(pa_channel0 + 1));
}

switch (pa_channels) {
case 1: // Mono
case 3: // Surround 2.1
case 5: // Surround 5.0
case 7: // Surround 7.0
channels = pa_map.channels + 1;
channels = pa_channels + 1;
break;

case 2: // Stereo
case 4: // Surround 4.0
case 6: // Surround 5.1
case 8: // Surround 7.1
channels = pa_map.channels;
channels = pa_channels;
break;

default:
WARN_PRINT("PulseAudio: Unsupported number of output channels: " + itos(pa_map.channels));
WARN_PRINT("PulseAudio: Unsupported number of output channels: " + itos(pa_channels));
pa_channel_map_init_stereo(&pa_map);
channels = 2;
break;
Expand All @@ -226,7 +233,7 @@ Error AudioDriverPulseAudio::init_output_device() {
buffer_frames = closest_power_of_2(tmp_latency * mix_rate / 1000);
pa_buffer_size = buffer_frames * pa_map.channels;

print_verbose("PulseAudio: detected " + itos(pa_map.channels) + " output channels");
print_verbose("PulseAudio: reserving " + itos(channels) + " bus channels");
print_verbose("PulseAudio: audio buffer frames: " + itos(buffer_frames) + " calculated output latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms");

pa_sample_spec spec;
Expand Down Expand Up @@ -416,11 +423,10 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) {
for (unsigned int i = 0; i < ad->pa_buffer_size; i++) {
out_ptr[i] = ad->samples_in[i] >> 16;
}
} else {
} else if (ad->channels == ad->pa_map.channels + 1) {
// Uneven amount of channels
unsigned int in_idx = 0;
unsigned int out_idx = 0;

for (unsigned int i = 0; i < ad->buffer_frames; i++) {
for (int j = 0; j < ad->pa_map.channels - 1; j++) {
out_ptr[out_idx++] = ad->samples_in[in_idx++] >> 16;
Expand All @@ -429,6 +435,17 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) {
uint32_t r = ad->samples_in[in_idx++] >> 16;
out_ptr[out_idx++] = (l + r) / 2;
}
} else {
// override_channels case
unsigned int in_idx = 0;
unsigned int out_idx = 0;
for (unsigned int i = 0; i < ad->buffer_frames; i++) {
in_idx += ad->pa_channel0;
for (int j = 0; j < ad->pa_map.channels; j++) {
out_ptr[out_idx++] = ad->samples_in[in_idx++] >> 16;
}
in_idx += ad->channels - ad->pa_map.channels - ad->pa_channel0;
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/pulseaudio/audio_driver_pulseaudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class AudioDriverPulseAudio : public AudioDriver {
pa_stream *pa_rec_str = nullptr;
pa_channel_map pa_map = {};
pa_channel_map pa_rec_map = {};
unsigned int pa_channels = 2;
unsigned int pa_channel0 = 0;

String output_device_name = "Default";
String new_output_device = "Default";
Expand Down
3 changes: 3 additions & 0 deletions servers/audio_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ void AudioDriverManager::initialize(int p_driver) {
GLOBAL_DEF_RST("audio/driver/enable_input", false);
GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "audio/driver/mix_rate", PROPERTY_HINT_RANGE, "11025,192000,1,or_greater,suffix:Hz"), DEFAULT_MIX_RATE);
GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "audio/driver/mix_rate.web", PROPERTY_HINT_RANGE, "0,192000,1,or_greater,suffix:Hz"), 0); // Safer default output_latency for web (use browser default).
GLOBAL_DEF_RST("audio/driver/override_channels", false);
GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "audio/driver/override_speaker_channels", PROPERTY_HINT_RANGE, "2,8,1"), 8);
Copy link
Member

Choose a reason for hiding this comment

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

Should mono configurations also be allowed? I'm not sure if you can still get a mono output on a PC intentionally in 2025. (For audio input, you can, e.g. if using a Bluetooth headset + microphone.)

Also, do configurations with 5 or 7 channels make sense? To my knowledge, this is what exists:

  • Mono, 1 channel
  • Stereo (2.0), 2 channels
  • 2.1, 3 channel. Seems to be abstracted away from the software, e.g. a soundbar with a subwoofer besides it. In practice, the software sees a 2.0 setup.
  • 5.1, 6 channels
  • 7.1, 8 channels

If 5 and 7 channels don't actually exist in real audio setups, then the property could have an enum hint to specify which values are allowed (and give them a description):

PROPERTY_HINT_ENUM, "Stereo:2,Surround 5.1:6,Surround 7.1:8"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like this, but it's so far outside of my knowledge and could be misleading about what we have implemented. What I propose now is simple and close to the C++ implementation. If I do more of this I will have to some surround sound hardware to plug my PC into so it's not done completely blind.

GLOBAL_DEF(PropertyInfo(Variant::INT, "audio/driver/override_channel_out", PROPERTY_HINT_RANGE, "0,6,1"), 0);

int failed_driver = -1;

Expand Down