Skip to content
  • Volker Rümelin's avatar
    46744732
    alsaaudio: change default playback settings · 46744732
    Volker Rümelin authored
    
    
    The currently used default playback settings in the ALSA audio
    backend are a bit unfortunate. With a few emulated audio devices,
    audio playback does not work properly. Here is a short part of
    the debug log while audio is playing (elapsed time in seconds).
    
    audio: Elapsed since last alsa run (running): 0.046244
    audio: Elapsed since last alsa run (running): 0.023137
    audio: Elapsed since last alsa run (running): 0.023170
    audio: Elapsed since last alsa run (running): 0.023650
    audio: Elapsed since last alsa run (running): 0.060802
    audio: Elapsed since last alsa run (running): 0.031931
    
    For some audio devices the time of more than 23ms between updates
    is too long.
    
    Set the period time to 5.8ms so that the maximum time between
    two updates typically does not exceed 11ms. This roughly matches
    the 10ms period time when doing playback with the audio timer.
    After this patch the debug log looks like this.
    
    audio: Elapsed since last alsa run (running): 0.011919
    audio: Elapsed since last alsa run (running): 0.005788
    audio: Elapsed since last alsa run (running): 0.005995
    audio: Elapsed since last alsa run (running): 0.011069
    audio: Elapsed since last alsa run (running): 0.005901
    audio: Elapsed since last alsa run (running): 0.006084
    
    Acked-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
    Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
    Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20230121094735.11644-10-vr_qemu@t-online.de>
    46744732
    alsaaudio: change default playback settings
    Volker Rümelin authored
    
    
    The currently used default playback settings in the ALSA audio
    backend are a bit unfortunate. With a few emulated audio devices,
    audio playback does not work properly. Here is a short part of
    the debug log while audio is playing (elapsed time in seconds).
    
    audio: Elapsed since last alsa run (running): 0.046244
    audio: Elapsed since last alsa run (running): 0.023137
    audio: Elapsed since last alsa run (running): 0.023170
    audio: Elapsed since last alsa run (running): 0.023650
    audio: Elapsed since last alsa run (running): 0.060802
    audio: Elapsed since last alsa run (running): 0.031931
    
    For some audio devices the time of more than 23ms between updates
    is too long.
    
    Set the period time to 5.8ms so that the maximum time between
    two updates typically does not exceed 11ms. This roughly matches
    the 10ms period time when doing playback with the audio timer.
    After this patch the debug log looks like this.
    
    audio: Elapsed since last alsa run (running): 0.011919
    audio: Elapsed since last alsa run (running): 0.005788
    audio: Elapsed since last alsa run (running): 0.005995
    audio: Elapsed since last alsa run (running): 0.011069
    audio: Elapsed since last alsa run (running): 0.005901
    audio: Elapsed since last alsa run (running): 0.006084
    
    Acked-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
    Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
    Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20230121094735.11644-10-vr_qemu@t-online.de>
Loading