You are not logged in.

#26 2022-11-06 16:32:51

Strangiato
Member
Registered: 2020-01-10
Posts: 382

Re: solved-Streaming over LAN hangs after switching from wi-fi to ethernet

Streaming for 1 hour while connected to wi-fi:

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-3600.00 sec  13.7 GBytes  3980 KBytes/sec  192             sender
[  5]   0.00-3600.05 sec  13.7 GBytes  3979 KBytes/sec                  receiver

iperf Done.

Streaming for 1 hour while connected to wired network:

- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-3600.00 sec  38.8 GBytes  11309 KBytes/sec  51435             sender
[  5]   0.00-3599.99 sec  38.8 GBytes  11309 KBytes/sec                  receiver

iperf Done.

'Transfer' values for sender and receiver are the same. Does this mean data is not lost while streaming?
My router does not support jumbo frames.

Offline

#27 2022-11-06 21:28:36

ectospasm
Member
Registered: 2015-08-28
Posts: 273

Re: solved-Streaming over LAN hangs after switching from wi-fi to ethernet

Strangiato wrote:

Streaming for 1 hour while connected to wi-fi:

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-3600.00 sec  13.7 GBytes  3980 KBytes/sec  192             sender
[  5]   0.00-3600.05 sec  13.7 GBytes  3979 KBytes/sec                  receiver

iperf Done.

Streaming for 1 hour while connected to wired network:

- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-3600.00 sec  38.8 GBytes  11309 KBytes/sec  51435             sender
[  5]   0.00-3599.99 sec  38.8 GBytes  11309 KBytes/sec                  receiver

iperf Done.

'Transfer' values for sender and receiver are the same. Does this mean data is not lost while streaming?
My router does not support jumbo frames.

If you stream over TCP, it does mean no packets were lost.  But the Retr column indicates quite a few retries, for both WiFi and wired Ethernet.  Are you sure streaming with Roc or pipewire is streaming using TCP?  You may want to look at socket statistics (ss), find the ports you're streaming over, and see if the line starts with udp or tcp.  You can try this while streaming with either Roc or pipewire:

sudo ss -plaunt | grep -iE 'roc|pipewire'

If it says udp at the beginning of any matching lines, then you're definitely losing packets (UDP has no guarantee of packet arrival).  For real-time streaming this is desirable, but on flaky networks it can cause the stuttering you're experiencing. 

If both say udp, you may want to see if you can configure either to go over TCP.  But if it gets really out of whack, TCP can cause undesirable audio when all of the packets are retransmitted and gobbledegook comes out of your speakers.  Video might also be horribly distorted when this happens.

Last edited by ectospasm (2022-11-06 21:33:30)

Offline

#28 2022-11-06 22:37:29

Strangiato
Member
Registered: 2020-01-10
Posts: 382

Re: solved-Streaming over LAN hangs after switching from wi-fi to ethernet

Roc uses udp, pipewire uses tcp. The outputs from my previous comment were gotten while streaming with Roc.
Yesterday I installed kernel-zen on both laptop and desktop and the stuttering was reduced since then
(iwth wi-fi and ethernet), but not completely eliminated. Audio quality while streaming has improved too.
However, the audio stutters more frequently and sometimes I can even hear a slight noise while streaming
with Roc and running the mainline kernel on both machines. Do you have any idea why?

Offline

#29 2022-11-06 22:40:47

Koatao
Member
Registered: 2018-08-30
Posts: 95

Re: solved-Streaming over LAN hangs after switching from wi-fi to ethernet

Hello,

10Mbps on a wired LAN set up for fast-ethernet (100Mbps) is very low.
With iperf3, you should be close to the max throughput.

Did you run iperf3 with nothing else running on both the client and the server? Did you connected both directly to each other (without using a device like a switch, a hub, a router or a firewall between them)?

Did you try with a different client? and with a different server?

Identifying what is slowing the network is the best way to improve your performance.

As for the original issue, I think the behavior you experiences is the behavior I would have expected.
TCP is a transport protocol, it does not provide any session-like features so if you just start opening a new TCP socket (with the wired connection) and you don't close properly the former one (with the wifi connection), you cannot stream over as long as the server does not close the former TCP connection by itself (by timeout).

Offline

#30 2022-11-06 23:07:22

Strangiato
Member
Registered: 2020-01-10
Posts: 382

Re: solved-Streaming over LAN hangs after switching from wi-fi to ethernet

Koatao wrote:

Hello,

10Mbps on a wired LAN set up for fast-ethernet (100Mbps) is very low.
With iperf3, you should be close to the max throughput.

Hello.
What are you talking about?

Did you run iperf3 with nothing else running on both the client and the server? Did you connected both directly to each other (without using a device like a switch, a hub, a router or a firewall between them)?

I ran iperf3 while streaming audio and browsing the internet using the laptop. I have a modem/router between the machines.

Did you try with a different client? and with a different server?

No. i only have two machines.

Identifying what is slowing the network is the best way to improve your performance.

Yes, I agree. smile

As for the original issue, I think the behavior you experiences is the behavior I would have expected.
TCP is a transport protocol, it does not provide any session-like features so if you just start opening a new TCP socket (with the wired connection) and you don't close properly the former one (with the wifi connection), you cannot stream over as long as the server does not close the former TCP connection by itself (by timeout).

I understand your technical explanation. But from an end user perspective, I do not consider it the expected behavior.

Offline

#31 2022-11-12 02:33:31

ectospasm
Member
Registered: 2015-08-28
Posts: 273

Re: solved-Streaming over LAN hangs after switching from wi-fi to ethernet

The Zen kernel has certain patches and configuration for some purpose, but I don't know exactly what they are (I'm not familiiar with the Zen kernel).  Since you're getting slightly better performance with it, it likely has tweaks to improve network throughput.  The introduction of audio noise is a bit concerning, but that may be because the Zen kernel is exposing your unreliable network in a different way.

If you're going to try kernels to workaround your audio stuttering problem, I would suggest the linux-rt (Linux Real-Time) kernel.  From what I understand, it's configured and patched to give low latency, for audio workstations, and other systems that have real-time requirements.  You may fare better with that.  It's no guarantee, but we've already established your network is slow and unreliable

Offline

#32 2022-11-12 03:08:17

Strangiato
Member
Registered: 2020-01-10
Posts: 382

Re: solved-Streaming over LAN hangs after switching from wi-fi to ethernet

ectospasm wrote:

The Zen kernel has certain patches and configuration for some purpose, but I don't know exactly what they are (I'm not familiiar with the Zen kernel).  Since you're getting slightly better performance with it, it likely has tweaks to improve network throughput.  The introduction of audio noise is a bit concerning, but that may be because the Zen kernel is exposing your unreliable network in a different way.

If you're going to try kernels to workaround your audio stuttering problem, I would suggest the linux-rt (Linux Real-Time) kernel.  From what I understand, it's configured and patched to give low latency, for audio workstations, and other systems that have real-time requirements.  You may fare better with that.  It's no guarantee, but we've already established your network is slow and unreliable

I tested linux-rt since my previous comment. linux-zen gave me better results.
I also did some tests to debug the network, did ping to an Android phone and got packet loss regardless the laptop was connected to wi-fi or wired network. I also did a direct wired connection laptop to desktop, without the modem/router between them, ran ping for several hours and got no packet loss or RX error with the Realtek NIC of the desktop. My conclusion is that the network cable and the ethernet NICs of my machines are not causing the network problems and probably the culprit is my modem/router. Fortunately, my ISP will upgrade my internet service and replace the modem/router on 15th november. Let's see the result. smile

Thanks.

Offline

#33 2022-11-13 01:48:52

ectospasm
Member
Registered: 2015-08-28
Posts: 273

Re: solved-Streaming over LAN hangs after switching from wi-fi to ethernet

Sounds like you have a bad switch inside your router, if a direct connection between your laptop and your desktop doesn't show any packet loss.  Encouraged to hear your ISP will replace your router, that's good news!

Offline

#34 2022-11-20 14:31:56

Strangiato
Member
Registered: 2020-01-10
Posts: 382

Re: solved-Streaming over LAN hangs after switching from wi-fi to ethernet

My modem/router was replaced twice. Yes, the first modem/router had a bizarre continuous packet loss. I plugged the LAN cable and immediately the packet
loss statistics of my NIC started to increase continuously. The second modem/router works as expected. Now my Realtek NIC does not report any RX error
and the packet loss in the LAN has stopped.

Currently I'm unable to reproduce the issue when switching between wi-fi and ethernet initialy described. And I no longer need the network dispatcher linked in my first comment. My wi-fi adapter is automatically disabled when I connect the LAN cable even without the dispatcher.

Audio streaming over LAN is no longer stuttering. I have configured pulse.latency parameter of zeroconf-discover module available since pipewire 
0.3.60 in the /etc/pipewire/pipewire.conf file of my laptop...

{   name = libpipewire-module-zeroconf-discover
    args = {
              pulse.latency = 2500
    }
}

and now I can stream without stuttering even over wi-fi 2.4 ghz. Since this topic was created, my modem/router was replaced, I replaced mainline kernel
with linux-zen, iwd, networkmanager and pipewire were updated. I'm not sure what exactly solved my problems but the more important is that everything
works well now. smile

Thank you very much for your help ectospasm and Koatao.

Last edited by Strangiato (2022-11-26 20:03:13)

Offline

#35 2022-11-26 17:58:36

ectospasm
Member
Registered: 2015-08-28
Posts: 273

Re: solved-Streaming over LAN hangs after switching from wi-fi to ethernet

Strangiato wrote:

My modem/router was replaced twice. Yes, the first modem/router had a bizarre continuous packet loss. I plugged the LAN cable and immediately the packet
loss statistics of my NIC started to increase continuously. The second modem/router works as expected. Now my Realtek NIC does not report any RX error
and the packet loss in the LAN has stopped.

Currently I'm unable to reproduce the issue when switching between wi-fi and ethernet initialy described. And I no longer needs the network dispatcher linked in my first comment. My wi-fi adapter is automatically disabled when I connect the LAN cable even without the dispatcher.

Audio streaming over LAN is no longer stuttering. I have configured pulse.latency parameter of zeroconf-discover module available since pipewire 
0.3.60 in the /etc/pipewire/pipewire.conf file of my laptop...

{   name = libpipewire-module-zeroconf-discover
    args = {
              pulse.latency = 2500
    }
}

and now I can stream without stuttering even over wi-fi 2.4 ghz. Since this topic was created, my modem/router was replaced, I replaced mainline kernel
with linux-zen, iwd, networkmanager and pipewire were updated. I'm not sure what exactly solved my problems but the more important is that everything
works well now. smile

Thank you very much for your help ectospasm and Koatao.

Be sure to mark this topic as SOLVED, to help anyone else who might find this thread useful.  Sounds like your router was faulty all along!  Starting with error-free network equipment is a prerequisite for ironing out these sorts of problems.  I'm glad you finally got it resolved!

Offline

#36 2022-11-27 12:11:55

Strangiato
Member
Registered: 2020-01-10
Posts: 382

Re: solved-Streaming over LAN hangs after switching from wi-fi to ethernet

ectospasm wrote:

Be sure to mark this topic as SOLVED, to help anyone else who might find this thread useful.

Done. smile

Offline

Board footer

Powered by FluxBB