Comments (12)
Hello!
Yes, this piece of code starts a new python process that will only be used to play music on a specific server, but to be honest, I didn't thought that many process could start delaying the instantiation, so help me with some information.
How many servers/bot instances are will trying to execute before this delay starts to apper?
What do you mean by a bot that required too many shards?
As a result, the song cannot be played.
Is there a error being throwed in this situation? If yes, can you show me a screenshot?
from vulkan.
How many servers/bot instances are will trying to execute before this delay starts to apper?
- The bot I tested has about 36,000 participating servers.
- The number of instances is one.
I think it is one because the delay started while creating an instance when the play command was used immediately after loading the bot. - My bot had 37 shards.
What do you mean by a bot that required too many shards?
- I'm not good at English, so I think I used the wrong expression.
Bots with about 5 shards are likely to have the same problem.
As a result, the song cannot be played.
Is there a error being throwed in this situation? If yes, can you show me a screenshot?
- As shown in the screenshot below, the message 'NoneType' object has no attribute 'connect' is displayed.
The cause of this is identified as a problem with trying to connect before the instant load is complete.
However, I don't think waiting for instant load to complete is a solution to the problem.
from vulkan.
- My bot had 37 shards.
Actually i didn't knew what is a shard, but then i look up and found this link and now i think that i get what you are saying.
Well, first of all, the whole Vulkan revolves around multiprocessing and having a Python process just to play the music, so that the music playback doesn't soffer when many requets come from Discord.
But for that, i needed to create a new instance of the bot itself, so this function came about
Vulkan/Parallelism/PlayerProcess.py
Lines 369 to 372 in f4e9e46
For bots without shards the connection was always established before the VCommandsType.Play got to the Player Process and it always worked, but in your case it's not working. A simple solution that could "fix" this, is to put some sort of wait on line 260 below and wait for the bot connection to establish.
Vulkan/Parallelism/PlayerProcess.py
Lines 259 to 263 in f4e9e46
I have already patched this in this commit
But as you pointed out, it's not a real fix because there might be a huge delay to create this instance. However, any other solution would completely change the way Vulkan handles multiprocessing, and that takes a fair amount of time and effort.
If possible, try this solution and see if this fix is working for you, let me know any updates!
Thanks for reporting this issue! :)
from vulkan.
Thank you for your kind reply!
As expected, the problem of not playing is solved, but it seems that it will take some time to load.
However, since it is executed once per server, I think that it can be used to some extent if the uptime is maintained well!
I'll leave a reply after checking if it worked.
thank you!
from vulkan.
As a result, it was not effective for me.
It took about 5 minutes to bring in sharding, so I thought it was too much.
I'm looking at the following two things in different ways.
- Bring only certain shards
- Replication of the main process
I will continue to find a way and I will inform you if you find a solution.
If you know how to solve it, you would be grateful if you share it.
Thank you for your help!
from vulkan.
In the following days I'll work in a Vulkan version to allow you to choose when the Bot should start a new process to play the song or when it should start the song playback in the same process, which will fix your delay problem.
from vulkan.
Hello!
As a result of many hours of work, I patched this in this PR #37, take a look of what has changed and how to set up the project for your usage.
Thanks for the report!
If you had any questions, just let me know!
from vulkan.
Oh! Thank you!
I tried the updated code right away.
However, a connection-related error occurred.
[ERROR CONNECTING TO VC] -> 'NoneType' object has no attribute 'connect'
[ERROR IN PLAY SONG FUNCTION] -> 'NoneType' object has no attribute 'is_connected', <class 'AttributeError'>
As a result, the following error occurred.
I modified the int and tried many things, but it didn't work for me.
Thank you for trying!🥹
from vulkan.
I think this error is related to the first error you reported.
The error happens because the Bot is still loading and I used a function that retrieves the voiceChannel and this function returned None, which was an unexpected behavior.
I tried to fix that in this comit 97996a1.
Please check if everything is alright.
from vulkan.
I tried again with the new code and the same error occurred.
[ERROR CONNECTING TO VC] -> 'NoneType' object has no attribute 'connect'
[ERROR IN PLAY SONG FUNCTION] -> 'NoneType' object has no attribute 'is_connected', <class 'AttributeError'>
I think it's harder to trace the cause than I thought...
from vulkan.
Are you sure that you have the latest bot version? And if you set up the attribute SONG_PLAYBACK_IN_SEPARATE_PROCESS to False as was described in the Settings page?
Because the function that are throwing this error is that:
If you take a look in the line 338 the execution will not pass this part until the property self.__voiceChannel
is different from None, and the error you are reporting right now tells that 'NoneType' object has no attribute 'connect', so, I think that you are not using the correct version.
from vulkan.
Thanks for your time and tries, @kimjunsung04.
I'm closing this issue for now, but you can come back and report any issue at any time!
from vulkan.
Related Issues (20)
- Bot fails to play certain Youtube videos HOT 2
- Bot does not like mobile Youtube links (m.youtube.com) HOT 1
- Bug
- Add autoplay? HOT 3
- [Enhancement]: Docker comtainerization HOT 2
- Bug HOT 2
- Bot goes to "sleeping" state immediately after starting playback HOT 3
- Bug HOT 1
- Googlevideo returning 403 forbiddenBug HOT 4
- Bug ImportError: cannot import name 'SlashCommandOptionType' from 'discord.enums' HOT 4
- Bot searches for YT Song instead of actually playing the one on Spotify. HOT 2
- bot not showing music commands HOT 2
- When I try to queue a Spotify playlist it doesn't work... HOT 3
- [Enhancement] Add custom command HOT 3
- [Suggestion] Soundcloud and Local File support HOT 2
- [Suggestion] Make the bot as administrator HOT 2
- Improper token has been passed HOT 4
- Bot won't play Deezer links gotten from the Share button HOT 5
- "This interaction failed" - Permission Issue
- Bug URL could not be processed with spotify link
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vulkan.