philippe44 / LMS-Cast

Chromecast to LMS bridge
64 stars 10 forks source link

FreeBSD #3

Closed 1337sup3rh4x0r closed 8 years ago

1337sup3rh4x0r commented 8 years ago

Hi there, am I correctly assuming that there is no executable for FreeBSD yet? I tried to install this plugin on my LMS which is running in a FreeNAS (FreeBSD based) jail but on the settings page it won't start. Your guide states that after I tick the "Start the Bridge" box I should choose an executable but I don't have a drop down menu or anything to do so. Also I don't have a generate button to create a config file and the "Configuration file missing - create one by clicking "generate" or, if autosave is on, refresh this page" message doesn't go away. The server.log states:

[16-03-06 21:40:10.2557] Plugins::CastBridge::Squeeze2cast::configHandler (251) /usr/home/lms/prefs/castbridge.xml
[16-03-06 21:40:19.2859] Plugins::CastBridge::Squeeze2cast::start (82) no binary set

but the config file doesn't exist. The castbridge.log is created but completely empty.

philippe44 commented 8 years ago

Hi - Unfortuntaley, I don't build for FreeBSD. Most of options are here, but I don't have a build system / QEMU solution for it and I cannot test.

philippe44 commented 8 years ago

But, if you want, this plugin can run on any computer, it does not have to be colocated with LMS. You can even run it on a raspberry pi zero ($5)

1337sup3rh4x0r commented 8 years ago

So basically I just execute the arm binary on a rapsberry and it automatically detects my chromecasts and emulates Squeeze devices for each which will then automatically be detected by LMS?

Really that easy?

philippe44 commented 8 years ago

Yes and because there is only few things to tweak with chromecast, it should work out of the box. You have a manual in the zip package and a small command line help for options as well.

1337sup3rh4x0r commented 8 years ago

Sounds almost too good to be true. How resource intensive is LMS-to-Cast? Could I run it on an existing pi that already runs a home automation server, or would you advise to set up a separate pi for this task?

philippe44 commented 8 years ago

:-) - It's not very CPU intensive. Of course it depends if you transmit mp3, flac or pcm 24 bits @ 192 Khz, that does change network throughput, but in general it is a few percent, so it can coexist happily with anything else. As a comparison, one of my other bridges the LMS to AirPlay which does resampling, volume scaling and decoding to transform everything to 44.1Khz 16 bits PCM takes less than 20% of a Pi 2 when 3 players are fully active at the same time, using WiFi as a network attachement - and this is way more processing complexity than castbridge You might want to use the -i option only once to build a config (although this is not fully necessary). With that option, it searches for CC, write a config file and exit. You just have then to edit the config if you want to and then re-start squeeze2cast. It's really that simple with CC (the UPnP version is much more complicated). I cannot promise you that there will be no issues at all, some users have minor problems (see logitech forum) but in general, it is very painless

1337sup3rh4x0r commented 8 years ago

Sounds great, I will test it in the coming days. Thank you for elaborating!

1337sup3rh4x0r commented 8 years ago

Somehow I can't execute the binary on my Raspberry B+. I keep getting this:

root@pi:~/Bin# bash squeeze2cast-armv6hf
squeeze2cast-armv6hf: squeeze2cast-armv6hf: cannot execute binary file

Am I missing something?

philippe44 commented 8 years ago

Has squeeze2cast-armv6hf the execute bit set ? (chmod +x squeeze2cast-armv6hf)

1337sup3rh4x0r commented 8 years ago

yes, I had thought of that Strangely it now runs with calling it without bash

root@pi:~/Bin# ./squeeze2cast-armv6hf
[11:31:22.533469] main:1175 Starting squeeze2cast version: v0.2.0.2-dev-1 (Mar  5 2016 @ 17:41:04)

[11:31:22.536681] main:1178 

!!!!!!!!!!!!!!!!!! ERROR LOADING CONFIG FILE !!!!!!!!!!!!!!!!!!!!!

[11:31:22.537761] main:1206 Buffer path /tmp
[11:31:22.554382] Initialize:807 UPnP init success - 192.168.217.29:49152
[11:32:07.909691] AddCastDevice:912 [0xb0a08]: adding renderer (CCK)
[11:32:07.911011] AddCastDevice:916 [0xb0a08]: cannot get mac CCK
[11:32:08.262502] CastConnect:380 [0xb0a08]: SSL connection opened [0xb220a960]
[11:32:08.284780] slimproto_thread_init:1007 [0x536f8] connecting to 192.168.217.218:3483
[11:32:08.288096] slimproto:885 [0x536f8] connected
[11:32:08.289237] sendHELO:132 [0x536f8] cap: Model=squeezelite,ModelName=SqueezeLite,AccuratePlayPoints=0,HasDigitalOut=0,MaxSampleRate=96000,pcm,aif,flc,mp3

I'm almost certain I also tried that last night, but maybe I was a bit tired :)

This way it is all working now. Thank you for the help! Streaming to two CCs simultaneously uses about 5% of my pi's CPU. All good! Now the only thing left that would be nice to have would be to get them play in sync. But I guess that's not possible technically?

philippe44 commented 8 years ago

I did not see your command line at first: do not invoke bash first. This is a C compiled file, not a script. Just type at the command line ./squeeze2cast-armv6hf

philippe44 commented 8 years ago

Since version 0.2, there is a sync capability: create a sync group using a Chromcast controller application. That group will appear as a new LMS "virtual" player and will be usable exactly as other CC devices, just they will play in sync within the CC group. You cannot sync with other LMS devices (only my AirPlay bridge allows that). Still, this is not bad as individual players will still be there in addition to the new sync group(s). There is one parameter you might want to tweak for the group and this is . To generate a config file, launch only once "squeeze2cast-armv6hf -i config.xml". It will discover the players, write a config file and exit. Then you can edit it

1337sup3rh4x0r commented 8 years ago

Ok, but that only works for CC Audio devices. And as of now I am not ready to replace all my Chromecasts with new ones :)

Anyway, I think this issue is resolved now, again thank you very much!