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

Cast Local File in ChromeOS Crostini Linux VM: Not Working #439

Open
darethehair opened this issue Jan 24, 2024 · 4 comments
Open

Cast Local File in ChromeOS Crostini Linux VM: Not Working #439

darethehair opened this issue Jan 24, 2024 · 4 comments

Comments

@darethehair
Copy link

darethehair commented Jan 24, 2024

So close yet so far! I have been trying to find a CLI utility to cast media, and so far 'catt' has the best chance of working, but not quite yet:

Playing an MP3 stored on my website from within the Crostini VM shell works great:

darren@penguin:~$ sudo /root/.local/bin/catt cast http://mywebsite/test.mp3
Casting remote file http://mywebsite/test.mp3...
Playing "test" on "Downstairs Speaker"...

Playing a copy of the same MP3 as a local file hangs for a little while, then fails:

darren@penguin:~$ sudo /root/.local/bin/catt cast test.mp3
Casting local file test.mp3...
Playing "test" on "Downstairs Speaker"...
Serving local file(s).
Error: Playback of local file has failed.

If I can make this work, then I will be able to set up some crontab schedules to play media at my local non-profit thrift shop at designated times -- with the benefit of being able to 'cast' it from a central PC.

@darethehair
Copy link
Author

More tests and results...

I eventually figured out how to use 'pychromecast' myself to cast an audio file to a Chromecast speaker 'by name', just like 'catt' can, even working in a ChromeOS Crostini environment using the simple 'http-server' webserver, and it works fine:

dmenns@penguin:~$ /home/dmenns/castaudio.py "Downstairs Speaker" http://192.168.5.45:8080/test.mp3
argument list ['/home/dmenns/castaudio.py', 'Downstairs Speaker', 'http://192.168.5.45:8080/test.mp3']
Downstairs Speaker

When I try the same thing with 'catt' using similar instructions, it hangs and eventually fails:

dmenns@penguin:~$ catt -d "Downstairs Speaker" cast http://192.168.5.45:8080/test.mp3
ERROR: [generic] Unable to download webpage: (<urllib3.connection.HTTPConnection object at 0x7d3289e91e10>, 'Connection to 192.168.5.45 timed out. (connect timeout=20.0)') (caused by TransportError("(<urllib3.connection.HTTPConnection object at 0x7d3289e91e10>, 'Connection to 192.168.5.45 timed out. (connect timeout=20.0)')"))
Error: Remote resource not found.

Even though I have found this workaround, I would still like to be able to use 'catt' as my sole utility in this environment, since it appears to work well for casting 'web pages' which I also want/need to do.

@skorokithakis
Copy link
Owner

Hmm, is Catt maybe detecting and sending the wrong IP for its host?

@darethehair
Copy link
Author

Another successful test of an alternate app 'chromecast-cli' (https://github.com/erkstruwe/chromecast-cli):

dmenns@penguin:~$ chromecast --host 192.168.4.35 play http://192.168.5.45:8080/test.mp3
Playing http://192.168.5.45:8080/test.mp3
Status IDLE

This works OK, but I prefer the ability of Catt to target the host on its name rather than its (possibly changing over time) IP address.

Is there something I can do to help diagnose what might be going off-track with Catt in this case?

@skorokithakis
Copy link
Owner

Hm, you'd need to find which host CATT has detected for itself and is sending to the Chromecast, but I'm afraid I don't remember the code enough to remember where that variable is set... I think the problem is that it's detecting the wrong host, though.

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

2 participants