matthias4217 / jukebox-ultra-nrv Goto Github PK
View Code? Open in Web Editor NEWThis project forked from etiandre/jukebox-ultra-nrv
Multi-user jukebox for LAN use
Home Page: https://gitlab.com/club-jeux-int/jukebox-ultra-nrv
This project forked from etiandre/jukebox-ultra-nrv
Multi-user jukebox for LAN use
Home Page: https://gitlab.com/club-jeux-int/jukebox-ultra-nrv
I add a song, then delete it before it actually starts to play and this doesn't work it seems.
When clicked, displays a menu with "add to main playlist", "see/copy url" and maybe more ?
(When implemented, it fixes #32)
Sometimes it's a bit too big.
I'm not sure how to do this :
When the jukebox is called in the shell "by hand" to be executed by python3.6, it runs just fine. But when setting up a systemd service as such:
# /etc/systemd/system/jukebox.service
[Unit]
Description=Jukebox service
[Service]
WorkingDirectory=/home/hackademint/jukebox-ultra-nrv/
ExecStart=/usr/bin/python3.6 run.py
Restart=always
User=hackademint
Group=hackademint
[Install]
WantedBy=default.target
then it seems to have a hard time getting the sound card's master control. The 41th line of the main.py script in jukebox/src/, which is:
amixer_out = subprocess.check_output(['amixer', 'get', "'Master',0"]).decode()
fails as the alsa mixer does not find the master control:
amixer: Unable to find simple control 'Master',0
while this definitely does not happen when ran "by hand". A fix that I found was to add the keyword argument shell=True to the check_output() function:
amixer_out = subprocess.check_output(['amixer', 'get', 'Master'], shell=True).decode()
This way, it seems that the subprocess call is made just like from an actual shell, so it works well.
Also, selecting the 'Master' control seems preferable to me, as alsamixer automatically resolves it to 'Master',0 when called, but I'm not too sure on that one.
When removing the currently playing song from the jukebox using the corresponding black cross button, the entry is removed yes, but firstly the song does not really stop:
and secondly also, the entire server seems to simply exit without any error message:
while the youtube embeded video still runs and is still interactive but without any sound produced though.
Update the readme to show how to setup the Jukebox.
Should we drop it and use another way to search on youtube ? (maybe with youtube-dl
, since it is possible to use the cli option ytsearch:
, like #14)
INFO in playlist: Adding track https://horskh.bandcamp.com/track/victim
File "playlist.py", line 36, in add
track["album"], track["duration"],
KeyError: 'album'
version mkIII-0.6.6
It should not appear if it is not on the blacklist, or if the source is not specified in the config.py
.
Nothing is stored in track_info where it should be.
For now, most of the app is in french, but it would be cool to handle other languages (even if not providing translations, making it easier to add some in the future).
Youtube-dl should support soundcloud search. (scsearch:
)
Add a favicon
In order to be selected by keyboard
A settings to change the theme (light/dark/90s).
Sometimes, the jukebox bugs, and I have to restart it manually. A button on the web interface could be better.
My only interrogation is the same as #3.
When browsing a ftp through a browser, we can fetch the url of a resource. However, it is encoded with %20
replacing spaces, accents replaced by %xx
. We should parse it when needed.
When executed in Python version 3.7, the asynchronous routine calls generate Exceptions like this:
Exception in callback MPV.__init__.<locals>.mpv_event_extractor() at /usr/local/lib/python3.7/dist-packages/mpv.py:276
handle: <Handle MPV.__init__.<locals>.mpv_event_extractor() at /usr/local/lib/python3.7/dist-packages/mpv.py:276>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/mpv.py", line 254, in _event_generator
raise StopIteration()
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/local/lib/python3.7/dist-packages/mpv.py", line 278, in mpv_event_extractor
for event in _event_generator(self.handle):
RuntimeError: generator raised StopIteration
Exception in thread Thread-27:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/home/hackademint/jukebox-ultra-nrv/jukebox/__init__.py", line 27, in player_worker
self.mpv = MyMPV(None) # we start the track
File "/home/hackademint/jukebox-ultra-nrv/jukebox/src/MyMPV.py", line 10, in __init__
self.playlist_pos = 0
File "/usr/local/lib/python3.7/dist-packages/mpv.py", line 493, in setter
_mpv_set_property_string(self.handle, name.encode(), str(proptype(value)).encode())
File "/usr/local/lib/python3.7/dist-packages/mpv.py", line 174, in wrapper
ErrorCode.raise_for_ec(func, *args)
File "/usr/local/lib/python3.7/dist-packages/mpv.py", line 59, in raise_for_ec
raise ex(ec, *args)
AttributeError: ('mpv property is not available', -10, <MpvHandle object at 0x7f39c1724bf8>, b'playlist-pos', b'0')
Exception in callback MPV.__init__.<locals>.mpv_event_extractor() at /usr/local/lib/python3.7/dist-packages/mpv.py:276
handle: <Handle MPV.__init__.<locals>.mpv_event_extractor() at /usr/local/lib/python3.7/dist-packages/mpv.py:276>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/mpv.py", line 254, in _event_generator
raise StopIteration()
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/local/lib/python3.7/dist-packages/mpv.py", line 278, in mpv_event_extractor
for event in _event_generator(self.handle):
RuntimeError: generator raised StopIteration
When looking it up, it seems to be due to python3.7 changing the way things work in asyncio (PEP 479), thus introducing this new bug. The fix that is adviced is to surround generator yields with a try-except clause. For example:
yield next(seq)
needs to be replaced by:
try:
yield next(seq)
except StopIteration:
return
Although the exception in itself seems to be raised by mpv, making the jukebox available to python3.7 shouldn't be too much of a hassle. If it is really too complex to solve yourselves, maybe consider declaring the jukebox to require python3.6 for now ?
We currently use the Alsa mixer directly. Maybe it would be better to use the volume of mpv.
For now, it seems that the Youtube iframe makes the page larger than the screen size. We should correct it.
When doing a search with !url
, use youtube-dl to fetch it.
If people open a ftp to which the jukebox can connect, youtube-dl is able to play it.
mai 14 23:12:21 hackademint python3.6[20735]: JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
mai 14 23:12:21 hackademint python3.6[20735]: ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave
mai 14 23:12:21 hackademint python3.6[20735]: couldn't open play stream: No such file or directory
mai 14 23:16:18 hackademint python3.6[20735]: ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave
mai 14 23:16:18 hackademint python3.6[20735]: Cannot connect to server socket err = No such file or directory
mai 14 23:16:18 hackademint python3.6[20735]: Cannot connect to server request channel
mai 14 23:16:18 hackademint python3.6[20735]: jack server is not running or cannot be started
mai 14 23:16:18 hackademint python3.6[20735]: JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
mai 14 23:16:18 hackademint python3.6[20735]: ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave
mai 14 23:16:18 hackademint python3.6[20735]: couldn't open play stream: No such file or directory
The jukebox seems to sometimes generate internal errors when trying to load a song that will then fail to play and the jukebox just goes to the next song in the current playlist. When trying again with the same song, it does not fail every time. The error does not seem to be consistent with resolution, length, volume, ...
Adds a page giving statistics :
When a song has finished playing, it may raise a Segmentation Fault.
Version 0.6.5
For now, there is nothing, and since the source code is available publicly, I feel like it would be better to have one.
See #3
We should not do a dirty (but useful) hack to get metadata from the bandcamp html, but instead rely on youtube-dl the same way as it is done in soundcloud.
File "backends/search/youtube.py", line 42, in search
raise Exception("nothing found on youtube")
Exception: nothing found on youtube
Version : mkIII-0.6.9
(last confirmed in mkIII-0.8.4)
Did search with https://www.youtube.com/watch?v=bipmm792YFE&list=PL326E728CF5AA4CBF&index=14
. https://www.youtube.com/watch?v=bipmm792YFE
works fine.
The problem is that youtube-dl think this is a playlist, and not an element in a playlist. (see #7 )
Tracks are currently stored after they have been added for the first time. However, they may lack some metadata when they have been searched (album for songs from Youtube, duration for songs from jamendo...).
I propose we add a button to the verso of tiles to update the information.
We could either do an other research on the track url with the same function as the current search, or implement a better search function with Youtube-dl
version mkIII-0.6.6
Actuellement, vous utilisez alsaaudio.Mixer()
pour controler le volume audio. Si vous ne mettez pas d'arguments, il cherchera par défaut la carte son 'Master'. Cependant, la carte son ne s'appelle pas toujours 'Master'. Notamment, quand pulseaudio est installé, la carte son principale est renommée en 'Speaker'.
Il faudrait donc utiliser alsaaudio.mixers()
pour obtenir la liste des cartes sons, puis soit choisir la première, soit permettre aux gens de mettre le nom de leur carte son (en mettant 'Master' par défaut). Et après quand tu créé un Mixer alsaaudio, tu fais alsaaudio.Mixer(control=[nom du contrôle])
After playing a song, the volume is set to 100%.
I'm sure we could improve the current design.
We should check if username isn't already taken, if name length isn't too long...
With this : https://github.com/invicnaper/spotify-dl, it may be able to use Spotify, but it is a little old and I haven't tested it
File "/home/membre/soft/jukebox-ultra-nrv/jukebox/src/playlist.py", line 59, in add
(track_id, user_id))
sqlite3.OperationalError: database is locked
Version : mkIII-0.6.7
Since this version, there can be simultaneous access to the database in several threads. We must implement a lock.
Create a help/about page on the jukebox.
It should display the list of websites loaded, the address of the Github repository and maybe more.
Refactor users :
We should rewrite the logging system, separating production from development and showing only informations needed.
Often, the same songs are listened several time in a short period. It could be interesting to download them and put them in cache. However, I don't know what's the best way to do it : most popular songs or most recent ?
When addind a song from the suggestions, mpv cannot play it. However, adding the same song by doing a search works fine. I haven't tested if it affected other sources than Youtube.
Version : mkIII-0.6.3
How to fix : we should probably focus on what url is stored in the database, it is possible that the media has been moved.
Concerning #20, we could fix both, as #20 is currently partially fixed.
I suggest we add a new "Settings" page with an equalizer. It is probably done in a similar way than we have a volume slider.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.