twinkle icon indicating copy to clipboard operation
twinkle copied to clipboard

Redesign audio playback

Open LubosD opened this issue 10 years ago • 5 comments

Audio playback code in t_audio_tx is very badly designed. Audio device underruns are standard part of the code's lifecycle and are even used to detect jitter buffer emptiness.

This results in crackling sound with PulseAudio. It also makes it very difficult to implement #3 properly.

Correct design should not do any sleeps in the audio thread. It should poll the RTP/decode/jitter logic for more data. If none are given, silence should be generated.

I also recommend only using a fixed sample rate such as 44100 for playback and resample incoming audio via libresample. This makes it easy for injected sounds (DTMF, end of call beep, etc.) to always have the same quality.

LubosD avatar Jun 05 '15 21:06 LubosD

I started writing some code in a feature branch 'feature/9'.

It is clear that 3-way conferencing will also need to be reworked from audio perspective. I.e., it will first be removed in this branch and later re-implemented.

LubosD avatar Jun 09 '15 13:06 LubosD

Happy anniversary! Anyhting new around here? Pulseaudio is crackling happily for the years past, can't say it's "usable".

grinapo avatar Jun 16 '19 08:06 grinapo

The check for libsamplerate needs to be added to CMakeLists.txt

penguineer avatar Jan 31 '20 11:01 penguineer

I cherry-picked the two commits from feature/9 to the current master (involves conflict resolution) and the audio-quality improved. Might be a good direction to go, although I would prefer if pulseaudio could be invoked directly.

penguineer avatar Jan 31 '20 11:01 penguineer

The check for libsamplerate needs to be added to CMakeLists.txt

I think @LubosD was aware of this. :smirk:

https://github.com/LubosD/twinkle/blob/0fbcea8799ce47ce40b4b43944ff36c7fb996e9a/CMakeLists.txt#L28

fbriere avatar Apr 01 '20 13:04 fbriere