Bug 96208

Summary: Audio lag issue in large bandwidth network
Product: Spice Reporter: Dharmesh <dharmesh4u>
Component: serverAssignee: Spice Bug List <spice-bugs>
Status: RESOLVED NOTOURBUG QA Contact:
Severity: critical    
Priority: high CC: bugzilla
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Dharmesh 2016-05-25 11:35:32 UTC
Hello,

I am using aSpice client installed on custom Android device with dual core processor and 1 GB RAM. I have both Ethernet and WiFi network interface.

Spice server(0.12.7) and Qemu configured in Ubuntu(14) Linux machine. The VM  guest OS(Buildroot) plays SWF flash animation file with audio.

I have faced audio lag issue about around 1 second through Ethernet and for different routers with Higher bandwidth.

In some routers, I have got audio sync and all things work perfect.

I have checked VM logs and found that the low bandwidth messages for routers which work for me while others have higher bandwidth values.

I have checked same behavior in Samsung Galaxy Note-II phone. 

Can any one help me to solve this issue??
Comment 1 Victor Toso 2016-05-25 12:56:41 UTC
(In reply to Dharmesh from comment #0)
> Hello,
> 
> I am using aSpice client installed on custom Android device with dual core
> processor and 1 GB RAM. I have both Ethernet and WiFi network interface.
> 
> Spice server(0.12.7) and Qemu configured in Ubuntu(14) Linux machine. The VM
> guest OS(Buildroot) plays SWF flash animation file with audio.
> 
> I have faced audio lag issue about around 1 second through Ethernet and for
> different routers with Higher bandwidth.
> 
> In some routers, I have got audio sync and all things work perfect.

I don't really think the problem is the network but the audio decoding.

> I have checked VM logs and found that the low bandwidth messages for routers
> which work for me while others have higher bandwidth values.

How cool is that? With lower bandwith the audio works! In the code I can see on sound.c:

> delay_val = main_channel_client_is_low_bandwidth(mcc) ? 0 : 1; 
> if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY, &delay_val, sizeof(delay_val)) == -1) {
...

But I don't really think it would be related to your problem.

> I have checked same behavior in Samsung Galaxy Note-II phone. 
> 
> Can any one help me to solve this issue??

I have played with real-time audio decoding on Android and I got really frustrated with the outcome. That was 3 years ago so I hope it is much better now. That being aSpice is not really maintained by us so I'm not sure how we can help with this client.

If this client is based on spice-gtk, one could play with SPICE_DISABLE_CELT or SPICE_DISABLE_OPUS but I'm not aware of other ways to change audio configuration.
Comment 2 Dharmesh 2016-05-26 04:57:35 UTC
(In reply to Victor Toso from comment #1)
> (In reply to Dharmesh from comment #0)
> > Hello,
> > 
> > I am using aSpice client installed on custom Android device with dual core
> > processor and 1 GB RAM. I have both Ethernet and WiFi network interface.
> > 
> > Spice server(0.12.7) and Qemu configured in Ubuntu(14) Linux machine. The VM
> > guest OS(Buildroot) plays SWF flash animation file with audio.
> > 
> > I have faced audio lag issue about around 1 second through Ethernet and for
> > different routers with Higher bandwidth.
> > 
> > In some routers, I have got audio sync and all things work perfect.
> 
> I don't really think the problem is the network but the audio decoding.
> 
> > I have checked VM logs and found that the low bandwidth messages for routers
> > which work for me while others have higher bandwidth values.
> 
> How cool is that? With lower bandwith the audio works! In the code I can see
> on sound.c:
> 
> > delay_val = main_channel_client_is_low_bandwidth(mcc) ? 0 : 1; 
> > if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY, &delay_val, sizeof(delay_val)) == -1) {
> ...
> 
> But I don't really think it would be related to your problem.
> 
> > I have checked same behavior in Samsung Galaxy Note-II phone. 
> > 
> > Can any one help me to solve this issue??
> 
> I have played with real-time audio decoding on Android and I got really
> frustrated with the outcome. That was 3 years ago so I hope it is much
> better now. That being aSpice is not really maintained by us so I'm not sure
> how we can help with this client.
> 
> If this client is based on spice-gtk, one could play with SPICE_DISABLE_CELT
> or SPICE_DISABLE_OPUS but I'm not aware of other ways to change audio
> configuration.

Thanks for reply.

In Virtual manager(in Ubuntu OS) client, I never faced any audio lag issue and everything works perfect in it. 

Yes in Android device, client is based on spice-gtk and it uses gstreamer. SPICE_DISABLE_CELT and SPICE_DISABLE_OPUS flags are already set to true. 

Do I need to try celt for audio instead gstreamer?
Comment 3 Victor Toso 2016-05-26 09:05:45 UTC
(In reply to Dharmesh from comment #2)
> Thanks for reply.
> 
> In Virtual manager(in Ubuntu OS) client, I never faced any audio lag issue
> and everything works perfect in it. 
> 
> Yes in Android device, client is based on spice-gtk and it uses gstreamer.
> SPICE_DISABLE_CELT and SPICE_DISABLE_OPUS flags are already set to true.

So you can set this environments variables for aSpice (in the android device)? This tells the spice-server (host machine, where QEMU is) the capabilities of the client.

I suggest you to set (disable) only SPICE_DISABLE_CELT or SPICE_DISABLE_OPUS, not both.
 
> Do I need to try celt for audio instead gstreamer?

If you have access to the logs in aSpice, feel free to attach the logs from SPICE_DEBUG=1 and GST_DEBUG=4

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.