Skip to content
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

Snapcast players won't play when added to Playergroup #3086

Closed
1 task done
craigbeat opened this issue Oct 26, 2024 · 11 comments
Closed
1 task done

Snapcast players won't play when added to Playergroup #3086

craigbeat opened this issue Oct 26, 2024 · 11 comments

Comments

@craigbeat
Copy link

craigbeat commented Oct 26, 2024

What version of Music Assistant has the issue?

2.4.0b2

What version of the Home Assistant Integration have you got installed?

2024.5.1

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

  • Yes

The problem

When I set up a Playergroup that contains any Snapcast player, the all the devices in that group will play except for the Snapcast devices. This is true even if the Snapcast device is the only device in the group. If I choose the Snapcast device on it's own (not the group) it works. Here is an example error:
2024-10-26 10:22:15.465 WARNING (MainThread) [music_assistant] Error while unload provider Snapcast: 'NoneType' object has no attribute 'state' 2024-10-26 10:22:15.471 INFO (MainThread) [music_assistant.snapcast.snapserver] Starting builtin Snapserver... 2024-10-26 10:22:17.490 INFO (MainThread) [music_assistant.snapcast] Started connection to Snapserver 127.0.0.1:1705 2024-10-26 10:22:17.490 INFO (MainThread) [music_assistant] Loaded player provider Snapcast 2024-10-26 10:23:29.029 ERROR (MainThread) [music_assistant] Error doing task: Task exception was never retrieved Traceback (most recent call last): File "/app/venv/lib/python3.12/site-packages/music_assistant/server/providers/snapcast/__init__.py", line 511, in play_media ugp_stream = ugp_provider.ugp_streams[media.queue_id] ^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'ugp_streams' 2024-10-26 10:23:29.284 INFO (MainThread) [music_assistant.streams] Start Queue Flow stream for Queue Test generic - crossfade: False

How to reproduce

  • Enable the 'Playergroup' player provider
  • Enable the 'Snapcast' player provider and configure for internal Snapcast server
  • Create a new Playergroup and add a Snapcast player (e.g. An android device with the snapcast app installed)
  • Select the Snapcast player and play a track to confirm Snapcast is working
  • Select the Playergroup you created and try playing the same song

Music Providers

Tried with both Spotify and YouTube music

Player Providers

Snapcast
Playergroup

Full log output

music-assistant.log

Additional information

No response

What version of Home Assistant Core are your running

2024.10.4

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Raspberry Pi

@OzGav
Copy link
Contributor

OzGav commented Oct 26, 2024

Can you please use the terminology from the docs so we know what you are referring to. There is no GENERIC group in MA

@craigbeat craigbeat changed the title Snapcast players won't play when added to Generic Group Snapcast players won't play when added to Playergroup Oct 26, 2024
@craigbeat
Copy link
Author

Updated to remove and replace 'generic' with Playergroup. Thanks.

@OzGav
Copy link
Contributor

OzGav commented Oct 26, 2024

Have you then used a Snapcast Sync Group or a Universal Group?

@craigbeat
Copy link
Author

Yes. Snapcast sync groups work on their own as well, but not in Player group / Universal Group.

@OzGav
Copy link
Contributor

OzGav commented Oct 26, 2024

So you are trying to group snapcast with something else?

@craigbeat
Copy link
Author

Correct. It's a convoluted set up that started with a Chromecast Audio going to Line-In on a device that then routes that stream via Snapcast. If I put the CCA in a group with the Snapcast devices, I could play to that group and get multi-room audio, and still be able to use the 'Cast' feature.

It has now evolved somewhat that I am only using Snapcast in the garden, but still want the audio in my house at the same time via exeisting Google Audio devices. I don't need it to sync, but I do have a little HA script that runs that pulls Chromecast players in closer sync by checking the seek position of the Snapcast players, and this works if I manually start the multiple player groups, but ideally, having everything in a Universal Playergroup would be more convenient. I've tried using the HA Group, but it doesn't work with the sync script I created.

Thanks again - Music Assistant has been a great help in getting close to where I want to be for my home audio.

@OzGav
Copy link
Contributor

OzGav commented Oct 27, 2024

@SantiagoSotoC thoughts on universal groups with snapcast?

@SantiagoSotoC
Copy link
Member

There seems to be a bug in the code, easy to fix, at least according to the log, tomorrow I will try to fix it

@SantiagoSotoC
Copy link
Member

SantiagoSotoC commented Oct 27, 2024

@marcelveldt , this line

ugp_provider: PlayerGroupProvider = self.mass.get_provider("ugp")
should have to be replaced by the following ?

ugp_provider: PlayerGroupProvider = self.mass.get_provider("player_group")
Edit: I've already checked, that's the problem, I'm going to open the pr

@SantiagoSotoC
Copy link
Member

Should fix the problem : music-assistant/server#1756

@craigbeat
Copy link
Author

Thank you! The fix works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants