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

DM was the only one who could hear music #74

Closed
arcanjl opened this issue Feb 16, 2023 · 21 comments · Fixed by #78
Closed

DM was the only one who could hear music #74

arcanjl opened this issue Feb 16, 2023 · 21 comments · Fixed by #78
Labels
bug Something isn't working needs more info

Comments

@arcanjl
Copy link

arcanjl commented Feb 16, 2023

So last night I hosted my first game with this, and nobody but me could hear the music. Did I have something switched off? Any thoughts?

@arcanjl arcanjl added the bug Something isn't working label Feb 16, 2023
@action-jay
Copy link

I'm troubleshooting this one too. The headless player seems to work well enough if I log in as a player on my local machine, but my group said they couldn't hear anything until they loaded Syrinscape in a separate tab. Will do some digging around but not sure exactly what to look for in the console

@arcanjl
Copy link
Author

arcanjl commented Feb 18, 2023 via email

@frondeus
Copy link
Owner

Ugh, that doesn't sound good.
The music should just play. Perhaps there is a bug with session management on my side? (Players do not connect properly to the session created by GM).

Few questions:

  • What browsers your players are using?
  • Are there any errors in the console?
  • Do players have sliders to control volume?
  • If yes, does anything happen when they change the volume?

@frondeus
Copy link
Owner

Also, what version of Foundry and what version of my module are you using?

@action-jay
Copy link

action-jay commented Feb 19, 2023

Hi @frondeus! Love this addon. Thanks for looking at this.

  • Foundry version: 10.291

  • Syrinscape Control: 0.4.0-beta5

  • Using Chrome in most cases. One or two players may be on Firefox

  • I recreated issue by logging in as a player in Chrome incognito. Start a mood going as the GM, no sound from the player window.

  • If you log in as GM first, then log out and back in as a player in the same Incognito session, it does work. This tells me it's maybe a Syrinscape cookie we're dealing with?

Some more clues:

  • At the Syrinscape Online control panel, I don't see the affected players connecting a device
  • Player view does see the volume control and currently playing mood, no effect changing the slider
  • Player view generates an error on load if there's a mood playing. Example:

Uncaught (in promise) Error: undefined. User Bri lacks permission to update Playlist [sXVcZslwIcMN9emY]
[No packages detected]
at ServerDatabaseBackend._updateDocuments (/C:/Program%20Files/Foundry%20Virtual%20Tabletop/resources/app/dist/database/backend/server-backend.mjs:1:3830)
at async Semaphore._try (/C:/Program%20Files/Foundry%20Virtual%20Tabletop/resources/app/common/utils/semaphore.mjs:101:17)

Hope this helps! 🐾

@arcanjl
Copy link
Author

arcanjl commented Feb 20, 2023 via email

@Llewinidas
Copy link

Just as an FYI, I was having issues with players not being able to hear audio as well just using the regular syrinscape online player and web app this past week. I needed all of my players to rejoin the syrinscape campaign to get it to work properly again so this may not be an issue directly with your mod.

(also, I haven't followed the updates on this mod closely but do I understand correctly that it should work now without the players needing to have a separate app or tab open to syrinscape's players??)

@frondeus
Copy link
Owner

@Llewinidas

(yes, the beta version of 0.4.0 has integrated the Syrinscape headless player directly into the foundry. Players do not need separate tab or app anymore)

Ooor they should not need it but then we have this bug :)

I think I have an idea what went wrong but for the next couple of weeks, I'm bit busy. I hope i can find few hours during the weekend to debug it properly.

@arcanjl
Copy link
Author

arcanjl commented Mar 11, 2023

Any updates?

@frondeus
Copy link
Owner

Sorry, not yet. My personal life was quite demanding in the few past weeks. Everything should go back to normal soon so I can properly debug it :)

@arcanjl
Copy link
Author

arcanjl commented Mar 12, 2023 via email

@Tackian
Copy link

Tackian commented Mar 15, 2023

Same problem here. I got sound but my players dont.

@LukeAbby
Copy link

I troubleshooted this for a while and it looks like players are sending the wrong auth token for whatever reason, despite having the right auth token available programmatically

The thing that finally worked for me was having everyone who couldn't hear sound follow these steps in a test world:

  1. Login as a gamemaster account.
  2. Set the Syrinscape api key to the correct and current token.
  3. Save changes.
  4. Refresh the page.
  5. Click on something on the page, anything works, and Syrinscape sound should work now. The click is required in general across any webpage, see Consider a "Start sound" button when trying to play before interaction #76, it's a browser behaviour. It's not strictly related to this issue at all but your players may be confused thinking sound is "lagging" on refresh.

I personally set the auth token to be junk data before these steps for each player but I'm not even sure if that's required. After that sound worked for all of them, even when they switched back to a player and even in another world. My best guess is that #61 or something was attempted to be implemented and the secret api key is only persisted and used correctly as a GM. This is probably hard to debug for the maintainer because, well, they always have logged in as a GM to set the auth token.

@Tackian
Copy link

Tackian commented Mar 17, 2023

Luke when you say Login as a gamemaster account it means you need to give the the gamemaster permission to the players ?

@LukeAbby
Copy link

LukeAbby commented Mar 17, 2023

@Tackian

Luke when you say Login as a gamemaster account it means you need to give the the gamemaster permission to the players ?

You could do it that way, but that's not required, and it's not a permanent thing fortunately. The only reason why your players can't use their regular login privileges is because they need to set the auth token, once, ever and then it should work thereon out even when they switch back to their regular account and priveleges.

The reason why I say it's not required to do it that way is because personally I didn't want to give players gamemaster permission on an important world. For this reason I created a new world and enabled only the fvtt-syrin-control module there. Then I had my players follow these steps, they all could login to the default "Gamemaster" account with no password. These were the steps I was trying to explain.

Maybe you use the Forge where user management is a bit different? I'm not super familiar with the Forge but in that case, yes you might have to give all your players GM permissions temporarily. I'd expect that it can still be on a new test world though.

@frondeus
Copy link
Owner

@arcanjl , @Tackian , @action-jay are there by any chance logs on GM browser saying:

SyrinControl | SocketLib registered | Player

?

@action-jay
Copy link

Morning @frondeus ! I hopped on to check for the SocketLib entry in the console, and looks like you've fixed this with beta 6. Good work! My players are going to be stoked 🐾

@karpana
Copy link

karpana commented Apr 3, 2023

@Tackian

Luke when you say Login as a gamemaster account it means you need to give the the gamemaster permission to the players ?

You could do it that way, but that's not required, and it's not a permanent thing fortunately. The only reason why your players can't use their regular login privileges is because they need to set the auth token, once, ever and then it should work thereon out even when they switch back to their regular account and priveleges.

The reason why I say it's not required to do it that way is because personally I didn't want to give players gamemaster permission on an important world. For this reason I created a new world and enabled only the fvtt-syrin-control module there. Then I had my players follow these steps, they all could login to the default "Gamemaster" account with no password. These were the steps I was trying to explain.

Maybe you use the Forge where user management is a bit different? I'm not super familiar with the Forge but in that case, yes you might have to give all your players GM permissions temporarily. I'd expect that it can still be on a new test world though.

Based on the description you've provided this seems to be either a variable scoping problem (variables are either stored in world or in client, with client being stored in cookies).

Or, what is more likely, that something in this module is "expecting" to find a client-scope variable (even if empty or garbage) before being able to use the "correct" auth key, which is likely in the world scope.

I've run into this variable scoping problem with the LockView module, and the Devs for that module opened up this issue with Foundry proper

foundryvtt/foundryvtt#8828

This issue was closed as duplicate, referencing these issues
https://github.com/foundryvtt/foundryvtt/issues/8227
foundryvtt/foundryvtt#4804

Not sure if this helpful or not, but the fact that "setting an Auth key" in a garbage/throwaway foundry world got me thinking about this.

Cheers,
Karpana

@arcanjl
Copy link
Author

arcanjl commented Apr 3, 2023 via email

@karpana
Copy link

karpana commented Apr 3, 2023

To be honest .. not sure...

I see this item was closed last week (just noticed) ...
so I'm assuming that @frondeus has this all figured out.

@frondeus
Copy link
Owner

frondeus commented Apr 3, 2023

Yep :) And your investigation is true, the true user scope would prevent this bug from happening (or at least would make it much easier to debug).

To anyone else - please update your module to 0.4.0 stable version which fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs more info
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants