GithubHelp home page GithubHelp logo

Comments (8)

philippe44 avatar philippe44 commented on May 18, 2024

I've seen this on a few systems and unfortunately I have no idea what's happening. In some cases, TCP packets sent to the UPnP device (Sonos or other) takes forever to reach it, it happens in bursts and buffering is not enough to deal with that. I assume it's network configuration/prioritization related, but I really don't understand. There is nothing special in the code at that place, just a send() of bytes that sometimes return after more than a couple of sec, even if the other party is supposed to be ready. It's a blocking send, but I've tried using a non-blocking socket and verify it's ready for writing with no better result. The thread which is sending packets over HTTP has nothing else to do, so even if it's suspended in the send, it does not prevent anything else to run. And there is no reason why the send would block for long because the data are sent from a UDP source, so they arrive in real time, it's not like TCP should suspend the connection because the player is full ... basically, no idea again except look at your router for some traffic prioritisation maybe.

from airconnect.

realLaotse avatar realLaotse commented on May 18, 2024

I used to have a similar problem which solved itself magically if replacing the flac codec with pcm wav.

from airconnect.

tedd4u avatar tedd4u commented on May 18, 2024

from airconnect.

philippe44 avatar philippe44 commented on May 18, 2024

Any help on finding this issue would be really appreciated. I've seen it on Windows, Linux and MacOS .... The difference with pcm vs flac is that each send() in PCM is 1408 bytes, so closer to MTU where in flac, each call is less as data are compressed. I'm wondering if there is not something funny with Nagle/MSS and all that. I tried that route a while ago but could find anything

from airconnect.

philippe44 avatar philippe44 commented on May 18, 2024

I've added TCP_NODELAY in 0.2.0.4 - I can't remember if I tried that in the past. Let me know how it works

from airconnect.

tedd4u avatar tedd4u commented on May 18, 2024

from airconnect.

philippe44 avatar philippe44 commented on May 18, 2024

That's correct, Sonos does not accept PCM raw format, it must be encapsulated into WAV or AIFF (which is really horrible ...)

from airconnect.

philippe44 avatar philippe44 commented on May 18, 2024

closed for inactivity

from airconnect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.