Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very long delay (>30secs) on macOS Sierra 10.12.6 #221

Closed
rossco255 opened this issue Nov 22, 2018 · 26 comments
Closed

Very long delay (>30secs) on macOS Sierra 10.12.6 #221

rossco255 opened this issue Nov 22, 2018 · 26 comments

Comments

@rossco255
Copy link

Hello! Very glad to find this app, the lack of Chromecast connectivity on both Spotify and iTunes is maddening.

I installed using homebrew, and the functionality is all there, but there's a latency of over 30 seconds between the computer and the Chromecast. I use Soundflower regularly without any such problems. Is this the sort of thing that switching to ffmpeg rather than node might help?

@polyzen
Copy link
Contributor

polyzen commented Nov 22, 2018

Sure is. IIRC the wav format doesn't work yet on macOS, but that would reduce latency even more.

Edit: I haven't switched to the Homebrew install method yet. Perhaps wav support works there.

@rossco255
Copy link
Author

Wav is just noise. Flac however has the delay down to a much more manageable 8 seconds.

@polyzen
Copy link
Contributor

polyzen commented Nov 23, 2018

I think I got 8 seconds with mp3 at 320 kbps as well.

@diegotrigo
Copy link

diegotrigo commented Dec 15, 2018

I think I got 8 seconds with mp3 at 320 kbps as well.

What about sample rate? I'm still stuck with 30sec delay on both node and ffmpeg.

@polyzen
Copy link
Contributor

polyzen commented Dec 18, 2018

The default, 44100.

@pasikarkkainen
Copy link

8 seconds is still a very long delay. Which setting needs to be tweaked to get it to something tolerable, like less than one second?

@vojczejk
Copy link

vojczejk commented Feb 8, 2019

Experiencing same behavior on Debian 9, mkchromecast v0.3.7.

@pasikarkkainen
Copy link

@muammar Any idea what's the reason for the huge delay? Is there some big audio buffer in use?

I guess I need to start reading the sources to figure it out..

@muammar
Copy link
Owner

muammar commented Feb 9, 2019 via email

@polyzen
Copy link
Contributor

polyzen commented Feb 9, 2019

Sonos here as well.

@pasikarkkainen
Copy link

@polyzen hmm, so you have ~8 seconds delay with Sonos, but @muammar doesn't.. how much is your delay/latency, @muammar ?

@polyzen
Copy link
Contributor

polyzen commented Feb 13, 2019

Apparently the node backend on macOS has <2s delay, but according to this comment, it should also be possible with ffmpeg?

@muammar
Copy link
Owner

muammar commented Feb 17, 2019

This is with ffmpeg in macOS. I am casting to my sonos speakers using aac with 500k.

https://photos.google.com/share/AF1QipPb0Fn2IdBxKtlW9hk0_7GpuSdHuk4P_L67qKtWWodYjrh6crBOChY_YRksmU8tPg?key=VkdkWUxhRV9ROUIxTkNVcHNwVGU4Wl9QNlV6RHlR

The video SUCKS but shows the idea :).

@legolasdimir
Copy link

I am seeing the same delay on xubuntu 18.04 LTS I am very new to this. Has anyone found any settings that can be tweaked to reduce or eliminate the delay?

@viktorsmari
Copy link

viktorsmari commented Mar 18, 2019

I also have around ~30s delay on Ubuntu Studio (16.04, 18.10, 19.04) when casting to Chromecast Audio.

muammar added a commit that referenced this issue Apr 7, 2019
According to
home-assistant/core#16319 this
commit should help with delay. It helped me to go from 17 seconds to
3 seconds delay when using chromecast. Related to #221, #61 and
  probably #104.
@muammar
Copy link
Owner

muammar commented Apr 7, 2019

If some of you are interested, please check out this b6d0b3b.

@viktorsmari
Copy link

viktorsmari commented Apr 7, 2019

If some of you are interested, please check out this b6d0b3b.

If I want to test it on Linux, I need to build it right?
Are there build instructions in the docs somewhere? I cannot find it

EDIT:
In the setup.py I found this:
python3 setup.py build
python3 setup.py install
Which created a new bin/mkchromecast - which I use to run the program.

And now the delay is 24 seconds

Am I missing a step?

@muammar
Copy link
Owner

muammar commented Apr 7, 2019

If some of you are interested, please check out this b6d0b3b.

If I want to test it on Linux, I need to build it right?
Are there build instructions in the docs somewhere? I cannot find it

EDIT:
In the setup.py I found this:
python3 setup.py build
python3 setup.py install
Which created a new bin/mkchromecast - which I use to run the program.

And now the delay is 24 seconds

Am I missing a step?

The easiest way would be to clone the repo (I think you already did that), and inside it do bin/mkchromecast --yourflagshere.

@viktorsmari
Copy link

viktorsmari commented Apr 7, 2019

But would that use the latest commit?
I pulled from the git repo and the bin/mkchromecast file's timestamp was still +3 weeks old, so I guess the binary was not updated even though the repo has new commits.

So how can I use the latest commit?

@muammar
Copy link
Owner

muammar commented Apr 7, 2019

But would that use the latest commit?
I pulled from the git repo and the bin/mkchromecast file's timestamp was still +3 weeks old, so I guess the binary was not updated even though the repo has new commits.

So how can I use the latest commit?

bin/mkchromecast is just a python script. If you use it, it will load the updated modules that I changed in the last commit.

@muammar
Copy link
Owner

muammar commented Apr 7, 2019

I forgot to mention that before executing the application you have to verify that you are in the latest commit with git pull.

@viktorsmari
Copy link

Thanks for clarifying. On Ubuntu 19 the delay is still long, around 25 seconds.

@jphein
Copy link

jphein commented Nov 14, 2019

mkchromecast v0.3.8.1
I am getting a 30 second delay on Ubuntu 19.10.
Changed settings to ffmpeg, wav, 96000. Reduced to around 3 seconds.

@jruh23
Copy link

jruh23 commented Jan 8, 2020

Debian 9, regardless of the mkchromecast configuration (codec, backend, etc) and version (tested 0.3.9, 0.3.8, and 0.3.7) and regardless weather using alsa or pule delays of at least 20 seconds.

@sillydan1
Copy link

Debian 10, I will always get around 30-38 seconds of delay. The very first time I ran mkchromecast I got 27 seconds, but that's probably just a fluke

@muammar
Copy link
Owner

muammar commented May 7, 2020

I think this helps: 30f4e85 I will close this report but feel free to reopen.

@muammar muammar closed this as completed May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests