Google Cast (Chromecast)
If your media device can be Cast to using this button on your phone/computer then multi-scrobbler can monitor it in order to scrobble music you play.
Connecting Devices
Section titled “Connecting Devices”Cast devices can be manually configured using file-based configuration OR automatically discovered using mDNS.
Manual Configuration
Section titled “Manual Configuration”Add each device’s name and IP address to devices in the file-based config. This works with every installation method, including Docker with default (bridge) networking. When devices is set, mDNS discovery is disabled unless useAutoDiscovery is explicitly set to true.
[ { "name": "MyCast", "type": "chromecast", "data": { "devices": [ {"name": "Living Room TV", "address": "192.168.0.115"} ] } }]mDNS Discovery
Section titled “mDNS Discovery”MS can also discover cast devices by listening for mDNS traffic on port 5353/UDP. The machine running MS must be able to send and receive multicast traffic on the same network as your cast devices.
- Local installation: no additional setup is required, other than allowing 5353/UDP through the host’s firewall.
- Docker with host networking (
network_mode: host): no additional setup is required. - Docker with default (bridge) networking: containers can’t see multicast traffic from the host’s network. Configure devices manually or add an mDNS reflector to your stack as described below.
mDNS Reflector with Docker
dockurr/mdns runs on the host’s network and copies mDNS traffic between your LAN and the Docker network MS uses, so MS can discover devices while staying on a bridge network.
Add it to the same compose stack as MS and give MS’s network a fixed bridge name:
services: multi-scrobbler: image: foxxmd/multi-scrobbler # ...your existing environment, volumes, ports, etc. networks: - ms
mdns: image: dockurr/mdns environment:
networks: ms: driver_opts:- 1.The host's firewall must allow 5353/UDP on both interfaces.
- 2.Replace
LAN_INTERFACEwith the name of the host's network interface on your LAN, such aseth0,enp3s0orwlan0. - 3.The second interface name must match
com.docker.network.bridge.name. If MS already uses a network you created, add the samedriver_optsto it and recreate the network. - 4.The reflector exits if the LAN interface is not connected, for example while Wi-Fi is still connecting at boot.
restart: on-failure:3retries a few times instead of restarting forever. - 5.Be aware that all mDNS traffic is copied between your LAN and the
msnetwork, not only Google Cast traffic.
What Media Does MS Scrobble?
Section titled “What Media Does MS Scrobble?”Cast devices report what type of media the current activity is (see metadata property here). The reported type is dependent on the application playing the media to correctly report it, the cast device does not magically know what the media is. If an application does not report a type it is always classified as unknown.
By default, MS will only track media that is reported as MusicTrack.
Allow Unknown Media Type
Section titled “Allow Unknown Media Type”Media with an Unknown (Generic) media type can be explicitly allowed by setting "allowUnknownMedia": true in the file-based configuration. This can also be configured to only allow unknown media types for specific applications by using a list of application names.
Example
Forcing Media Tracking
Section titled “Forcing Media Tracking”MS can be forced to track media from an application regardless of media type. This is useful if an application incorrectly reports a media type you are sure should be music. Set "forceMediaRecognitionOn" in the file-based configuration to a list of application names that should always be tracked.
Example
Cast Troubleshooting
Section titled “Cast Troubleshooting”Please include any/all logs with raw output if there are any errors encountered as this is critical to diagnosing issues.
To diagnose bad/incomplete track information or strange MS player behavior please turn on payload logging and include log output of the source running to help diagnose this issue. Either enable in config using the below example OR enable Debug Mode.
Example
[ { "name": "MyCast", "type": "chromecast", "data": { //... }, "options": { "logPayload": true } }]Configuration
Section titled “Configuration”Configuration Type
This is configuration for the ENV Config Type.
| Environmental Variable | Type | Default | Description |
|---|---|---|---|
CC_ID |
string | A globally unique ID EX myComponentId |
|
CC_NAME |
string | Value of CC_ID |
A vanity name EX My Cool Component |
CC_ENABLE |
boolean | true | Should this component be used? |
CC_BLACKLIST_DEVICES |
string | DO NOT scrobble from any cast devices on this comma-delimited list that START WITH these values | |
CC_WHITELIST_DEVICES |
string | ONLY scrobble from any cast device on this comma-delimited list that START WITH these values | |
CC_BLACKLIST_APPS |
string | DO NOT scrobble from any application on this comma-delimited list that START WITH these values | |
CC_WHITELIST_APPS |
string | ONLY scrobble from any application on this comma-delimited list that START WITH these values |
Bold/Italic = Required
Config Structure
This displays the structure of the File Configuration for a chromecast type Source with all possible properties, their shape, and descriptions/types. Use this to understand how to write a valid config.
Config Example
This displays an example config file of a chromecast Source File Configuration that adheres to the shown Config Structure.
- text mode lets you edit the JSON directly.
- tree mode gives you a guided point-and-click editing experience that always keeps the JSON syntax valid.
Both modes validate that the configuration is correct. Any errors show up as squiggly lines.
After you finish editing, switch to text and then copy all text to get a completed config.
Config Example Mobile Experience
This displays an example config file of a chromecast Source File Configuration that adheres to the shown Config Structure.
The example config file editor is meant for a larger screen experience so only the read-only example is shown. Please use this site on a tablet/laptop/desktop to enable file editor features.
[ { "id": "myCast", "name": "My Cast", "data": { "blacklistedDevices": [], "whitelistedDevices": [], "blacklistedApps": [], "whitelistedApps": [] } }]Config Structure
This displays the structure of the all-in-one (config.json) configuration with all possible properties, their shape, and descriptions/types. Use this to understand how to write a valid config.
Select the chromecast type from the respective sources node below, then expand it.
Config Example
This displays an example config file of a all-in-one (config.json) configuration that includes a chromecast Source that adheres to the shown Config Structure.
- text mode lets you edit the JSON directly.
- tree mode gives you a guided point-and-click editing experience that always keeps the JSON syntax valid.
Both modes validate that the configuraion is correct. Any errors show up as squiggly lines.
After you finish editing, switch to text and then copy all text to get a completed config.
Config Example Mobile Experience
This displays an example config file of a all-in-one (config.json) configuration that includes a chromecast Source that adheres to the shown Config Structure.
The example config file editor is meant for a larger screen experience so only the read-only example is shown. Please use this site on a tablet/laptop/desktop to enable file editor features.
{ "sources": [ { "type": "chromecast", "id": "myCast", "name": "My Cast", "data": { "blacklistedDevices": [], "whitelistedDevices": [], "blacklistedApps": [], "whitelistedApps": [] } } ]}