[Bug 781249] directsoundsrc: Correctly calculate segsize and segtotal

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon May 8 14:14:05 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=781249

Sebastian Dröge (slomo) <slomo at coaxion.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #350998|none                        |committed
             status|                            |

--- Comment #3 from Sebastian Dröge (slomo) <slomo at coaxion.net> ---
Comment on attachment 350998
  --> https://bugzilla.gnome.org/attachment.cgi?id=350998
Use latency-time and buffer-time settings

commit 1a8610f8f8305f20a235aa4fe78ab3fb0c785df4
Author: Nirbheek Chauhan <nirbheek at centricular.com>
Date:   Wed May 3 22:50:27 2017 +0530

    directsoundsrc: Use latency-time and buffer-time settings

    Earlier, the plugin was ignoring those settings and blindly setting
    buffer-time to 2 seconds and latency-time to 200ms, which forced all
    pipelines to have a minimum latency of 200ms + sink latency.

    The values of segsize and segtotal were also not derived correctly.
    Now we obey these values, and you can get close to the previous
    behaviour by setting buffer-time and latency-time manually. Note that
    they are set in microseconds.

    As a consequence, when we haven't received enough data from the
    device, we now sleep for a time proportional to the data remaining.
    However, Directsound is a deprecated API so it maintains its own
    software ringbuffer which updates at arbitrary intervals. Hence we
    might have to wait a full segsize to get the last 10% of data. To
    avoid tight loops, we clamp our sleep floor at 10ms.

    In my testing, this keeps the wakeups not-too-high (proportional to
    the latency-time set on the source). Further improvements should be
    made by fixing the WASAPI audio source plugin instead of this.
    Directsound is deprecated and as the comments explain, it is
    impossible to get low latency, decent quality, or good performance
    from it.

    Based on a patch by Sebastian Dröge <sebastian at centricular.com>

    https://bugzilla.gnome.org/show_bug.cgi?id=781249

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list