Open
Description
Bevy version
main aaccbe8
[Optional] Relevant system information
- Fedora Linux 40 (Workstation Edition)
$ uname -a Linux fedora 6.8.11-300.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 27 14:53:33 UTC 2024 x86_64 GNU/Linux
What you did
Basic audio playing on Space press or Mouse1 release:
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Update, signal)
.run();
}
fn signal(
mut commands: Commands,
asset_server: Res<AssetServer>,
keyboard_input: Res<ButtonInput<KeyCode>>,
mouse_button_input: Res<ButtonInput<MouseButton>>,
) {
if keyboard_input.just_pressed(KeyCode::Space) || mouse_button_input.just_released(MouseButton::Left) {
commands.spawn((
AudioBundle {
source: asset_server.load("sounds/breakout_collision.ogg"),
settings: PlaybackSettings::DESPAWN
},
));
}
}
Then loopback desktop audio to microphone.
Pressed record button in Audacity. Measure latency in VLC program from click to sound by selecting range in Audacity:
Then latency can be then calculated from selection view below in Audacity:
What went wrong
- I have expected that latency in Bevy is lower than in VLC audio player.
- Instead, latency is 4 times higher in Bevy, than in VLC (
$144/35=4.1$ ).
Additional information
- Tried changing ogg to wav with no improvement.
- Tried
--release
flag with no improvement. - Tried to increase poll resolution:
No improvement.
app .insert_resource(Time::<Fixed>::from_hz(600.0)) .add_systems(FixedUpdate, signal)
- Tried to preload audio to resource with no improvement.
- Tried Kira with preloading with no improvement.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status