alexdelorenzo / cast_control

📺 Control Chromecasts from Linux and D-Bus

Home Page:https://alexdelorenzo.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some clarifications please, my experience.

fantore opened this issue · comments

Hi Alex. Thanks for this interesting tool, I got interested in Hacker News.

I spent some time installing it in Debian Buster (Kanotix distro).

First of all, I needed all this requisites: python3-gi-cairo pycairo python3-setuptools pkg-config libcairo2-dev libjpeg-dev libgif-dev python3-dev libgirepository1.0-dev

I have no previous experience using mpris+playerctl and README is not clear about next steps after having installed this util.

Anyway after some googling, I did this:

I installed playerctl and:
chromecast_mpris -l 10 -n "Estudio TV"

It seems my chromecast is detected:

DEBUG:pychromecast.socket_client:[Estudio TV(192.168.5.10):8009] Connected!

and is detected by playerctl:

playerctl -l Estudio_TV

BUT if I play with playerctl
play -p Estudio_T

I got this

WARNING:pychromecast.controllers:PLAY command requested but no session is active.

What am I missing? Could ypu please clarifiy examples to play on chromcast a loca video file or URL, if possible?

Thanks in advance for your help. I feel important to expand the README with practical examples for new users.

Francisco

Hi @fantore, thanks for taking the time to try out chromecast_mpris and to file a bug report.

BUT if I play with playerctl
play -p Estudio_T
I got this
WARNING:pychromecast.controllers:PLAY command requested but no session is active.
What am I missing? Could ypu please clarifiy examples to play on chromcast a loca video file or URL, if possible?

I renamed my Chromecast to "Estudio TV" to test this out, and I get the same error as you do when I use playerctl to issue the play command when there is no content playing:

❯ playerctl -l
Estudio_TV
❯ playerctl status -p Estudio_TV
Stopped
❯ playerctl play -p Estudio_TV
❯
[other shell]
WARNING:pychromecast.controllers:PLAY command requested but no session is active.

However, when I cast a song to the Chromecast and then issue the play command with playerctrl, it works.

export URL="http://ccmixter.org/content/gmz/gmz_-_Parametaphoriquement.mp3"
❯ playerctl open "$URL" -p Estudio_TV
# wait a bit for it to start playing

❯ playerctl status -p Estudio_TV
Playing
❯ playerctl pause -p Estudio_TV
❯ playerctl play -p Estudio_TV

The above successfully plays a song on the Chromecast, and then pauses and plays it without any warnings emitted from chromecast_mpris.

I use go-cast to cast to the Chromecast, but you can use castnow or Mkchromecast, and Gnomecast is a GUI app for casting from Linux. Normally, I'd suggest catt, however it relies on an old version of pychromecast and chromecast_mpris uses a newer version (there's a PR here, though), so they don't play well together without using virtualenvs.

Can you try issuing play with playerctl while media is playing on your Chromecast, and see if you still get the same warning? You should be able to use the shell commands I provided in the second example without modifying them too much.

It seems to me the issue is that chromecast_mpris or its dependency mpris_server are allowing a play command to be issued even if no media is playing on the Chromecast, but I could be wrong.

Thanks in advance for your help. I feel important to expand the README with practical examples for new users.

No problem, and thanks for the tip, I'll expand the documentation with some examples.

edit: added Gnomecast link

I hope I was able to answer your questions sufficiently, @fantore. If this problem persists, or if you have any further questions, please feel free to reopen or comment on this issue again. However, due to the lack of activity, I'm going to close this issue for now.