Hi,
we added some debugging code to the alsa plugin and found out that it hangs in
the call to
snd_pcm_htimestamp(alsa->pcm_handle, &frames, &tstamp);
we have tried to replace all calls to this function with calls to
frames = snd_pcm_avail (alsa->pcm_handle);
That mostly solves the problem. Unfortunately sometimes there is very loud
noise, instead of normal sound. Sounds like it plays a block of uninitialized
memory. I am not an alsa expert, so maybe somebody with more knowledge of alsa
has an idea what could be wrong here.
See below for our patch (line numbers may differ, because I have removed the
debugging code from the patch)
Regards
Gerald
@@ -337,19 +346,22 @@ static void rdpsnd_alsa_close(rdpsndDevicePlugin* device)
if (!alsa->pcm_handle)
return;
+ frames = snd_pcm_avail (alsa->pcm_handle);
+/*
status = snd_pcm_htimestamp(alsa->pcm_handle, &frames, &tstamp);
if (status != 0)
frames = 0;
-
+*/
@@ -560,42 +576,54 @@ static void rdpsnd_alsa_wave_play(rdpsndDevicePlugin*
device, RDPSND_WAVE* wave)
if (alsa->wLocalTimeClose)
{
wCurrentTime = GetTickCount();
-
- if (snd_pcm_htimestamp(alsa->pcm_handle, &frames, &tstamp) == -EPIPE)
+
+ if (snd_pcm_avail (alsa->pcm_handle) == -EPIPE)
{
@@ -607,19 +635,27 @@ static void rdpsnd_alsa_wave_play(rdpsndDevicePlugin*
device, RDPSND_WAVE* wave)
}
free(data);
- snd_pcm_htimestamp(alsa->pcm_handle, &frames, &tstamp);
+ frames = snd_pcm_avail (alsa->pcm_handle);
Von: Marc-Andr Moreau [mailto:[email protected]]
Gesendet: Samstag, 16. Mrz 2013 03:03
An: Gerald Richter - ECOS
Cc: [email protected]; [email protected]
Betreff: Re: [Freerdp-devel] Sound not working in 1.1 Beta1
Hi Gerald,
It turns out I had avoided closing the device every time:
https://github.com/FreeRDP/FreeRDP/blob/master/channels/rdpsnd/client/alsa/rdpsnd_alsa.c#L330
For some reason the older code was *opening* the device on a close pdu, never
understood why. Opening instead of closing was causing issues which is why I
changed the logic a bit to be more proper. This might require some further
investigation. Maybe try to add some debug output in that file and figure out
the sequence of events leading to the error?
On Fri, Mar 15, 2013 at 12:27 PM, Gerald Richter - ECOS <[email protected]
<mailto:[email protected]> > wrote:
Hi,
thanks for your feedback, could you tell me where in the code the device is
closed? Then I will try to make it a NOP and see if this changes the situation.
Thanks & Regards
Gerald
Von: Marc-Andr Moreau [mailto:[email protected]
<mailto:[email protected]> ]
Gesendet: Freitag, 15. Mrz 2013 17:14
An: Gerald Richter - ECOS
Cc: [email protected]
<mailto:[email protected]> ; [email protected]
<mailto:[email protected]>
Betreff: Re: [Freerdp-devel] Sound not working in 1.1 Beta1
Hi,
One main difference is that the new code actually closes the ALSA device when
the server sends a close pdu. I have no idea why, but servers like windows 7
and windows 8 constantly open and close the sound device. Technically, we could
avoid closing the device and simply reset its state, which might fix this issue.
On Fri, Mar 15, 2013 at 8:30 AM, Gerald Richter - ECOS <[email protected]
<mailto:[email protected]> > wrote:
Hi,
We are try to use the current git build of xfreerdp (2013-03-15).
We are not able to redirect sound output properly while using alsa, we've no
pulseaudio installed. With older builds (from last year) the sound output
worked.
The sound is audible for 1-2 seconds and stops after we get a warning like
"Warning: requested sound buffer size 17600, got 7526 instead". We tried to
raise up the prealloc size in /proc/asound/card0/pcm*p/sub0/prealloc to the
maximum value which had no effect. After configuring the dmix plugin for alsa
the buffer warnings disappeared, but this didn't change the behaviour at all.
There are no problems with sound while using other applications.
Maybe someone has an idea to resolve this issue.
Thanks & Regards
Gerald
alsa.config:
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dsp0 {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 32768
rate 44100
}
bindings {
0 0
1 1
}
}
ctl.mixer0 {
type hw
card 0
}
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar <http://p.sf.net/sfu/appdyn_d2d_mar>
_______________________________________________
Freerdp-devel mailing list
[email protected]
<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/freerdp-devel
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Freerdp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freerdp-devel