matbee-eth / chromecast-audio-stream

Stream your Windows PC's audio to the Chromecast
MIT License
955 stars 76 forks source link

Is there supposed to be a delay? #104

Open danielscissorhands opened 6 years ago

danielscissorhands commented 6 years ago

Hi. The chromecast stream hack works great in Windows 10, but there is a about a 3 second DELAY to my old stereo's speakers so if I pause the music, or adjust the volume it will take a few seconds to change on my stereo. Is there supposed to be a delay, or did i do something wrong?

I turned the volume on my laptop all the way down, so that the music on my laptop doesn't come out of my laptop. And I am adjusting the volume coming through my stereo using the volume control in VLC media player.

PS: I used a a 3.5mm (male) to rca (male) adapter to plug the chromecast into the AUX input on the back of my stereo.

NvrBst commented 6 years ago

I also notice this. I am running the latest version on a Win 10 x64 machine, using a Google Home (regular) I love that this splits the audio, so the sound still comes from the system's speakers, but also casts to the device as well. Exactly what I am looking for.

However this delay is hard to use this with. When I set it up on my laptop (very old test laptop), the software works, however there is about a 3s delay from the audio to the speaker (tested running an audio delay test video on youtube). On the same system, casting the same youtube video via Chrome Cast (Tab), there is almost 0 delay. So 0 delay is possible, but this disabled the system speakers.

I decided to try it on another newer machine, and running the same test produced about a 1s delay. So I believe the delay is coming from the ffmpeg conversion? On the newer machine the delay dropped from 3s to 1s. To make this useful for music, we would need something like a 50-200ms delay to not hear the echo between the rooms.

Is there a way to tweek the ffmpeg to reduce the delay more? Would this help reduce the delay? I do see options like "preset=superfast, tune=zerolatency" in the ffmpeg.

Else maybe my "newer" machine just isn't new enough. Are other people using this software with a very minimal (unnoticeable) delay? Should I just be upgrading to the 8th gen i7 cpu?

Is there another way to get a copy of the audio without adding as much delay or using a cpu intensive program like ffmpeg? Something like the native chrome tab cast uses to get it's 0 delay through wifi.

I've also experimented with a Bluetooth transmitter, but again, I got around a 500ms delay which was just on the verge of hearing the echo between the rooms which annoyed me too much.

SamDel commented 6 years ago

Here's wat happens when you use this tool:

So there's always a delay. When you try to reduce the buffer on the Chromecast you can get worse sound quality and hickups.

When Chrome casts a video it works like this (I think): -Chrome starts downloading the video. -On the same moment it sends a message to the Chromecast device to start downloading the same video. -When both have a small buffer they start playing, that will be around the same time.

richard987 commented 5 years ago

where are the settings for the chromecast buffer? so i can experiment to try to reduce the lag

SamDel commented 5 years ago

There's no setting for that, as far as I know.