mxlgv / dino

This is Dino+ A modern XMPP/Jabber client software, based on Dino
GNU General Public License v3.0
15 stars 9 forks source link

[Bug] Windows calls have sound artifact #39

Closed Psayker closed 5 months ago

Psayker commented 6 months ago

When make calls from windows outgoing audio steam can have sound artifact.

igsha commented 5 months ago

DirectSound

The root of the problem is a directsound element from GStreamer that produce sound artifacts by itself. It can be reproduce by audio recodring and playback (num-buffers=2000 - is about 20 seconds):

$ gst-launch-1.0 -e directsoundsrc num-buffers=2000 ! audioconvert ! audioresample ! opusenc ! oggmux ! filesink location=out.ogg
$ gst-launch-1.0 filesrc location=out.ogg ! decodebin ! audioconvert ! audioresample ! autoaudiosink

Currently DirectSound is depretected. It seems no one is interested to fix this problem in gstreamer.

Wasapi

The successor of directsound element is wasapi - wasapisrc and wasapisink. The pipeline to test wasapisrc audio recording:

$ gst-launch-1.0 -e wasapisrc num-buffers=2000 ! audioconvert ! audioresample ! opusenc ! oggmux ! filesink location=out.ogg

There is no sound issues with this element. But capabilities are very limited. Also it is impossible to change volume level of the microphone directly from gstreamer.

Wasapi2

The more advanced successor is a wasapi2src element. But it is not available in mingw environment and I don't know all characteristics. It is available starting from Windows 10.

Comparison

The comparison of different audio recording elements from gstreamer: characteristic directsoundsrc wasapisrc wasapi2src
format caps S16LE only F32LE both F32LE and S16LE
rate caps any only 44100 any
channels caps 1 or 2 only 2 any
can gstreamer change microphone volume level yes no yes
sound artifacts yes no unknown
mxlgv commented 5 months ago

Fixed: https://github.com/mxlgv/dino/pull/54