|
From: | Andreas Zeiler |
Subject: | [Linphone-developers] [PATCH] Linux Mediastreamer2: Sound loop when interrupting RTP connection |
Date: | Thu, 14 Nov 2013 15:26:03 +0100 |
Hello, I had an issue with a interrupted RTP stream and alsa playing. When I interrupted the RTP stream by killing the sender or just disconnect receiver or sender from network the receiver played a sound loop which related to the selected buffersize. Depending on calculation and setting of the alsa parameters in the function “alsa_set_params” in the “src/alsa.c”-file the variable stop_threshold had been set to an bad value. By default this value should be set to buffersize. The problem occurs after calling “snd_pcm_hw_params_set_periods_near” when the variable “pariods” gets set by “exact_ulvalue”. In this case “exact_ulvalue” is the wrong variable. It shoud be the variable “exact_uvalue” which is also in the “snd_pcm_hw_params_set_periods_near”-call. This rises “periods” to a very high value, and thus the “stop_threshold”-value will be set to periods*periodsize. This generates a loop if the RTP connection gets interrupted. This bug is also in the current mediastreamer version!!! So here is a patch: --- mediastreamer-2.8.2-nopatched/src/alsa.c 2012-02-17 10:16:20.000000000 +0100 +++ mediastreamer-2.8.2-patched/src/alsa.c 2013-11-14 14:48:11.000000000 +0100 @@ -165,7 +165,7 @@ ms_warning("alsa_set_params: The number of periods %d is not supported by your hardware.\n " "==> Using %d instead.", periods, exact_uvalue); } - periods=exact_ulvalue; + periods=exact_uvalue; if (snd_pcm_hw_params_get_buffer_size(hwparams, &buffersize)<0){ buffersize=0; With kind regards Andi armStone: Pico-ITX ARM based Single Board Computer F&S Elektronik Systeme GmbH, Stuttgart, Germany Geschaeftsfuehrer: Holger Froelich, Guenther Scholz Handelsregister Stuttgart HRB 18493, VAT DE178964418 |
[Prev in Thread] | Current Thread | [Next in Thread] |