[PLUGIN] YouTube Cast Receiver

Works perfectly in 3.066 for X86. Thank you good sir

Sorry for the late response.
Just updated and tested some more, here’s some extra stuff I found:

  • Changing volume in the YouTube app doesn’t do anything.
  • My phone’s screen turned off at some point, then when I went back in the Youtube app, the seekbar was no longer in sync with playback. It lagged behind by about a minute or so.

As for the queue problem, I will DM you the logs in a second!

Plugin updated to improve transition from another music service (thanks @lizard_dude for helping me test it).

1 Like

Just wanted to chime in and say the plugin also works wonderfully on Raspberry Pi Zero!

tested on v2.773 and v2.779 works perfectly! I was waiting a long time for a plugin like this! thank you @patrickkfkan

Thanks for this plugin, it is great. Any idea why it wouldn’t be working on a Volumio 3.066 x86 on Virtualbox. I can see the cast to option and it works fine from the host machine, but cannot see the cast to option from other machines on the same network. Could it be due to the bridged network?

My best guess is that your VM is blocking multicast packets from / to other machines on the network. I’ll try running Volumio 3.066 in VirtualBox and see if I can reproduce this.

@prjcarr , So I have setup Volumio 3.066 on VirtualBox (version 6.1), set networking to Bridged and leave all other options as the default. Interestingly, I can see the VM as a cast device from other machines on the network. So it seems that VirtualBox itself isn’t blocking traffic.

If you SSH into the Volumio VM, and run ifconfig, what do you see? Can you PM the results to me so I can have a look?

Maybe this plugin is not working with volumio 3.015 Pi4

Or maybe you neglected again to check the system time.

Thanks for your help and confirming it works on a VM. I was able to dig deeper and figure it out. I was using wifi and not LAN, and apparently for Virtualbox in bridged mode that means the mac address is shared. I think this messes up multicast packets. I switched over to LAN and looks like everything works.

What’s the chances of getting this working for YouTube music? I tested with the YT Music app for android and the cast button finds volumio and tries to connect, but the connection fails. I think YT music is just some sort of wrapper for YT anyway so the cast technology should be fairly similar if not the same? YT music is a free download if you have time to look into it. It would be awesome to have this functionality on volumio.

Chances are low. Although YouTube Music looks similar to YouTube, the casting protocol used is different. The one YouTube Music uses requires device authentication. Put simply, this means you can only cast YouTube Music to devices that are authorised by Google, and Volumio is not one of them. Casting from YouTube on the other hand does not require authentication, and IMO is still being used only for the sake of maintaining compatibility with legacy Smart TVs.

why is my device not working ?
I scanned using the YouTube application, it didn’t appear in the cast list.
Is this because I also installed Spotify Connect on my device ?
How do I make sure this plugin runs correctly on my device ?

we will look for you in the crystal ball …i see nothing… this is the fog i guess…or are we missing a log?
do you have crystal ballz 2 day patrick?

Try the following:

  1. Make sure your phone and Volumio are connected to the same network
  2. Go to the plugin settings and change the Listening Port to some other value. Default is 8098. You can try 8099, for instance.

If still no go, then some logs will help indeed:

  1. Go to <your_volumio_address>/dev and enable ‘live log’.
  2. Go to the plugin settings and enable verbose logging.
  3. Now disable the plugin, followed by re-enabling it.
  4. Copy the Live Log and send it to me (preferably in a text file).
1 Like

one question. i have 2 rasberries with the plugin installed but the one i can find it only from my mobile devices. the other one i can find it from mobile and windows. Do i have to change maybe the listening port on the one? Or maybe because i m using different version of volumio? thanks

I suspect this could be due to the Windows machine not picking up the network broadcast made by the plugin. If your mobile can see both devices, then so should the desktop. I don’t think changing the listening port would make a difference. Try restarting the browser and see if it helps.

i tried from two computers and the same thing. from mobiles finding both. it can be the version of the volumio? but weird since on mobile is working fine.

I can’t deactivate the plugin, every time I deactivate the plugin I find the Volumio service restarts and the log doesn’t work when Volumio restarts.
This logs when the Volumio service start again :

Starting Live Log…
error: Failed callmethod call: TypeError: Cannot read property ‘stop’ of undefined
info: CoreCommandRouter::volumioGetState
info: CorePlayQueue::getTrack 0
info: CoreCommandRouter::volumioGetQueue
info: CoreStateMachine::getQueue
info: CorePlayQueue::getQueue
info: CoreCommandRouter::executeOnPlugin: system , getHwuuid
info: CALLMETHOD: system_controller system enableLiveLog true
info: CoreCommandRouter::executeOnPlugin: system , enableLiveLog
info: Launching a new LiveLog session
info: CALLMETHOD: music_service ytcr configSaveConnection [object Object]
info: CoreCommandRouter::executeOnPlugin: ytcr , configSaveConnection
volumio : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/sbin/ifconfig eth0
pam_unix(sudo:session): session opened for user root by (uid=0)
pam_unix(sudo:session): session closed for user root
volumio : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/sbin/ifconfig wlan0
pam_unix(sudo:session): session opened for user root by (uid=0)
pam_unix(sudo:session): session closed for user root
info: CoreCommandRouter::getUIConfigOnPlugin
info: CoreCommandRouter::executeOnPlugin: multiroom , getMultiroom
info: CoreCommandRouter::volumioGetState
info: CorePlayQueue::getTrack 0
info: CoreCommandRouter::volumioGetVisibleSources
info: CoreCommandRouter::executeOnPlugin: my_music , getDisabledSources
info: CoreCommandRouter::executeOnPlugin: appearance , getUiSettings
info: CoreCommandRouter::executeOnPlugin: wizard , getShowWizard
info: CoreCommandRouter::executeOnPlugin: system , getShowWizard
info: CoreCommandRouter::executeOnPlugin: system , getPrivacySettings
rpi_firmware_get_throttled: 13 callbacks suppressed
Under-voltage detected! (0x00050005)
Under-voltage detected! (0x00050005)
Under-voltage detected! (0x00050005)
error: Upnp client error: Error: connect ECONNREFUSED 127.0.0.1:6600
rpi_firmware_get_throttled: 12 callbacks suppressed
Voltage normalised (0x00000000)
Voltage normalised (0x00000000)