-
Notifications
You must be signed in to change notification settings - Fork 2
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
When clients are in an Idle group and one client's preferred stream starts, both clients play it #4
Comments
Shorter log:
|
snapserver control stream (concatenated into a json array): [
{
"jsonrpc": "2.0",
"method": "Stream.OnUpdate",
"params": {
"id": "Party 1",
"stream": {
"id": "Party 1",
"meta": { "STREAM": "Party 1" },
"status": "playing",
"uri": {
"fragment": "",
"host": "",
"path": "/librespot",
"query": {
"bitrate": "160",
"chunk_ms": "20",
"codec": "flac",
"devicename": "Party 1",
"name": "Party 1",
"sampleformat": "44100:16:2"
},
"raw": "librespot:////librespot?bitrate=160&chunk_ms=20&codec=flac&devicename=Party 1&name=Party 1&sampleformat=44100:16:2",
"scheme": "librespot"
}
}
}
},
{ "jsonrpc": "2.0", "method": "Group.OnStreamChanged", "params": { "id": "130666ad-cbb1-a433-6a64-3e5d97bde579", "stream_id": "Party 1" } },
{
"jsonrpc": "2.0",
"method": "Server.OnUpdate",
"params": {
"server": {
"groups": [
{
"clients": [
{
"config": {
"instance": 1,
"latency": 0,
"name": "",
"volume": { "muted": false, "percent": 100 }
},
"connected": false,
"host": {
"arch": "web",
"ip": "::ffff:192.168.0.666",
"mac": "66:66:66:66:66:66",
"name": "Snapweb client",
"os": "iPhone"
},
"id": "528e4925-d033-415f-95ea-ad852fd0ebcb",
"lastSeen": { "sec": 1627595355, "usec": 76512 },
"snapclient": {
"name": "Snapweb",
"protocolVersion": 2,
"version": "0.1.0"
}
}
],
"id": "6f8b43d4-d82e-d607-88f5-4daeef5d0c89",
"muted": false,
"name": "",
"stream_id": "Canard"
},
{
"clients": [
{
"config": {
"instance": 1,
"latency": 0,
"name": "",
"volume": { "muted": false, "percent": 100 }
},
"connected": true,
"host": {
"arch": "x86_64",
"ip": "127.0.0.1",
"mac": "66:66:66:66:66:66",
"name": "canard",
"os": "Arch Linux"
},
"id": "canard",
"lastSeen": { "sec": 1627679619, "usec": 995448 },
"snapclient": {
"name": "Snapclient",
"protocolVersion": 2,
"version": "0.25.0"
}
},
{
"config": {
"instance": 1,
"latency": 0,
"name": "kitchen",
"volume": { "muted": false, "percent": 100 }
},
"connected": true,
"host": {
"arch": "x86_64",
"ip": "127.0.0.1",
"mac": "66:66:66:66:66:66",
"name": "canard",
"os": "Arch Linux"
},
"id": "kitchen",
"lastSeen": { "sec": 1627679619, "usec": 995492 },
"snapclient": {
"name": "Snapclient",
"protocolVersion": 2,
"version": "0.25.0"
}
}
],
"id": "130666ad-cbb1-a433-6a64-3e5d97bde579",
"muted": false,
"name": "Canard",
"stream_id": "Party 1"
},
{
"clients": [
{
"config": {
"instance": 1,
"latency": 0,
"name": "bedroom-mark",
"volume": { "muted": false, "percent": 100 }
},
"connected": false,
"host": {
"arch": "x86_64",
"ip": "127.0.0.1",
"mac": "66:66:66:66:66:66",
"name": "canard",
"os": "Arch Linux"
},
"id": "bedroom-mark",
"lastSeen": { "sec": 1627679600, "usec": 207626 },
"snapclient": {
"name": "Snapclient",
"protocolVersion": 2,
"version": "0.25.0"
}
}
],
"id": "8a9f1bf6-313b-4510-b238-5f3587ba9447",
"muted": false,
"name": "",
"stream_id": "Canard"
}
],
"server": {
"host": {
"arch": "x86_64",
"ip": "",
"mac": "",
"name": "canard",
"os": "Arch Linux"
},
"snapserver": {
"controlProtocolVersion": 1,
"name": "Snapserver",
"protocolVersion": 1,
"version": "0.25.0"
}
},
"streams": [
{
"id": "Canard",
"meta": { "STREAM": "Canard" },
"status": "idle",
"uri": {
"fragment": "",
"host": "",
"path": "/tmp/mopidy.canard",
"query": {
"chunk_ms": "20",
"codec": "flac",
"name": "Canard",
"sampleformat": "48000:16:2"
},
"raw": "pipe:////tmp/mopidy.canard?chunk_ms=20&codec=flac&name=Canard&sampleformat=48000:16:2",
"scheme": "pipe"
}
},
{
"id": "Kitchen",
"meta": { "STREAM": "Kitchen" },
"status": "idle",
"uri": {
"fragment": "",
"host": "",
"path": "/tmp/mopidy.kitchen",
"query": {
"chunk_ms": "20",
"codec": "flac",
"name": "Kitchen",
"sampleformat": "48000:16:2"
},
"raw": "pipe:////tmp/mopidy.kitchen?chunk_ms=20&codec=flac&name=Kitchen&sampleformat=48000:16:2",
"scheme": "pipe"
}
},
{
"id": "Party 1",
"meta": { "STREAM": "Party 1" },
"status": "playing",
"uri": {
"fragment": "",
"host": "",
"path": "/librespot",
"query": {
"bitrate": "160",
"chunk_ms": "20",
"codec": "flac",
"devicename": "Party 1",
"name": "Party 1",
"sampleformat": "44100:16:2"
},
"raw": "librespot:////librespot?bitrate=160&chunk_ms=20&codec=flac&devicename=Party 1&name=Party 1&sampleformat=44100:16:2",
"scheme": "librespot"
}
}
]
}
}
},
{ "jsonrpc": "2.0", "method": "Group.OnNameChanged", "params": { "id": "130666ad-cbb1-a433-6a64-3e5d97bde579", "name": "Party 1" } },
{
"jsonrpc": "2.0",
"method": "Stream.OnUpdate",
"params": {
"id": "Party 1",
"stream": {
"id": "Party 1",
"meta": { "STREAM": "Party 1" },
"status": "idle",
"uri": {
"fragment": "",
"host": "",
"path": "/librespot",
"query": {
"bitrate": "160",
"chunk_ms": "20",
"codec": "flac",
"devicename": "Party 1",
"name": "Party 1",
"sampleformat": "44100:16:2"
},
"raw": "librespot:////librespot?bitrate=160&chunk_ms=20&codec=flac&devicename=Party 1&name=Party 1&sampleformat=44100:16:2",
"scheme": "librespot"
}
}
}
},
{
"jsonrpc": "2.0",
"method": "Stream.OnUpdate",
"params": {
"id": "Canard",
"stream": {
"id": "Canard",
"meta": { "STREAM": "Canard" },
"status": "playing",
"uri": {
"fragment": "",
"host": "",
"path": "/tmp/mopidy.canard",
"query": {
"chunk_ms": "20",
"codec": "flac",
"name": "Canard",
"sampleformat": "48000:16:2"
},
"raw": "pipe:////tmp/mopidy.canard?chunk_ms=20&codec=flac&name=Canard&sampleformat=48000:16:2",
"scheme": "pipe"
}
}
}
},
{ "jsonrpc": "2.0", "method": "Group.OnStreamChanged", "params": { "id": "130666ad-cbb1-a433-6a64-3e5d97bde579", "stream_id": "Canard" } },
{
"jsonrpc": "2.0",
"method": "Server.OnUpdate",
"params": {
"server": {
"groups": [
{
"clients": [
{
"config": {
"instance": 1,
"latency": 0,
"name": "",
"volume": { "muted": false, "percent": 100 }
},
"connected": false,
"host": {
"arch": "web",
"ip": "::ffff:192.168.0.666",
"mac": "66:66:66:66:66:66",
"name": "Snapweb client",
"os": "iPhone"
},
"id": "528e4925-d033-415f-95ea-ad852fd0ebcb",
"lastSeen": { "sec": 1627595355, "usec": 76512 },
"snapclient": {
"name": "Snapweb",
"protocolVersion": 2,
"version": "0.1.0"
}
}
],
"id": "6f8b43d4-d82e-d607-88f5-4daeef5d0c89",
"muted": false,
"name": "",
"stream_id": "Canard"
},
{
"clients": [
{
"config": {
"instance": 1,
"latency": 0,
"name": "",
"volume": { "muted": false, "percent": 100 }
},
"connected": true,
"host": {
"arch": "x86_64",
"ip": "127.0.0.1",
"mac": "66:66:66:66:66:66",
"name": "canard",
"os": "Arch Linux"
},
"id": "canard",
"lastSeen": { "sec": 1627679648, "usec": 14893 },
"snapclient": {
"name": "Snapclient",
"protocolVersion": 2,
"version": "0.25.0"
}
}
],
"id": "130666ad-cbb1-a433-6a64-3e5d97bde579",
"muted": false,
"name": "Party 1",
"stream_id": "Canard"
},
{
"clients": [
{
"config": {
"instance": 1,
"latency": 0,
"name": "bedroom-mark",
"volume": { "muted": false, "percent": 100 }
},
"connected": false,
"host": {
"arch": "x86_64",
"ip": "127.0.0.1",
"mac": "66:66:66:66:66:66",
"name": "canard",
"os": "Arch Linux"
},
"id": "bedroom-mark",
"lastSeen": { "sec": 1627679600, "usec": 207626 },
"snapclient": {
"name": "Snapclient",
"protocolVersion": 2,
"version": "0.25.0"
}
}
],
"id": "8a9f1bf6-313b-4510-b238-5f3587ba9447",
"muted": false,
"name": "",
"stream_id": "Canard"
},
{
"clients": [
{
"config": {
"instance": 1,
"latency": 0,
"name": "kitchen",
"volume": { "muted": false, "percent": 100 }
},
"connected": true,
"host": {
"arch": "x86_64",
"ip": "127.0.0.1",
"mac": "66:66:66:66:66:66",
"name": "canard",
"os": "Arch Linux"
},
"id": "kitchen",
"lastSeen": { "sec": 1627679648, "usec": 14684 },
"snapclient": {
"name": "Snapclient",
"protocolVersion": 2,
"version": "0.25.0"
}
}
],
"id": "fd017fd6-37c4-a8b9-8b41-e983445598aa",
"muted": false,
"name": "",
"stream_id": "Canard"
}
],
"server": {
"host": {
"arch": "x86_64",
"ip": "",
"mac": "",
"name": "canard",
"os": "Arch Linux"
},
"snapserver": {
"controlProtocolVersion": 1,
"name": "Snapserver",
"protocolVersion": 1,
"version": "0.25.0"
}
},
"streams": [
{
"id": "Canard",
"meta": { "STREAM": "Canard" },
"status": "playing",
"uri": {
"fragment": "",
"host": "",
"path": "/tmp/mopidy.canard",
"query": {
"chunk_ms": "20",
"codec": "flac",
"name": "Canard",
"sampleformat": "48000:16:2"
},
"raw": "pipe:////tmp/mopidy.canard?chunk_ms=20&codec=flac&name=Canard&sampleformat=48000:16:2",
"scheme": "pipe"
}
},
{
"id": "Kitchen",
"meta": { "STREAM": "Kitchen" },
"status": "idle",
"uri": {
"fragment": "",
"host": "",
"path": "/tmp/mopidy.kitchen",
"query": {
"chunk_ms": "20",
"codec": "flac",
"name": "Kitchen",
"sampleformat": "48000:16:2"
},
"raw": "pipe:////tmp/mopidy.kitchen?chunk_ms=20&codec=flac&name=Kitchen&sampleformat=48000:16:2",
"scheme": "pipe"
}
},
{
"id": "Party 1",
"meta": { "STREAM": "Party 1" },
"status": "idle",
"uri": {
"fragment": "",
"host": "",
"path": "/librespot",
"query": {
"bitrate": "160",
"chunk_ms": "20",
"codec": "flac",
"devicename": "Party 1",
"name": "Party 1",
"sampleformat": "44100:16:2"
},
"raw": "librespot:////librespot?bitrate=160&chunk_ms=20&codec=flac&devicename=Party 1&name=Party 1&sampleformat=44100:16:2",
"scheme": "librespot"
}
}
]
}
}
},
{ "jsonrpc": "2.0", "method": "Group.OnNameChanged", "params": { "id": "130666ad-cbb1-a433-6a64-3e5d97bde579", "name": "Canard" } }
] |
I wonder, would it be possible to catch unnamed groups that have only one client and update its stream based on config? (and name it at the same time...) |
Hi @markferry - glad to see someone else finds this tool useful! I hadn't noticed your issue yet, but I actually saw this behavior myself the other day. I added some behavior that actually just muted groups like this, to work around it - see this commit range: 5a424a7...main I wonder if that solves the problem well enough for you? If not, I can look into trying to handle it more robustly. |
Thanks Andrew, just back at this now. The commits on I'll dig deeper tomorrow, but in the meantime I've noticed:
Here, for example is the flickering of the
|
@markferry I'm surprised, honestly - this fixed the similar problems I was seeing at my house. But, clearly, it's not the right answer. I'll dig into this a little bit tonight and see if I can't figure something out. I wrote this whole thing on some fancy new ruby async libraries and didn't write tests or anything, so there's probably horrible bugs to work out. I appreciate the report, and the patience! (Of course, if you think you know how to fix it already, PRs are always welcome - but otherwise I'll work on this a bit tonight. 😄 ) |
os: Arch linux
snapclient: 0.25.0
snapserver: 0.25.0
First off, I realise this is a side-effect of how Snapcast works when removing clients from groups ;)
In this scenario:
c1
andc2
s1
,s2
)s0
is lower priority and plays to boths1
ands2
To repro:
s0
such thatc1
andc2
form a playing groupg0
.s0
->c1
andc2
remain ing0
which is Idles1
-> the group splitsResult:
c1
is in groupg1
playings1
c2
is in groupg2
playings1
<-- DOH!Expected:
c2
remains in groupg0
which is IdleConfig:
The result is the same even with more clients in
g0
. All clients end up in individual groups playings1
.log.txt
The text was updated successfully, but these errors were encountered: