Closed Vertgear closed 3 years ago
At a guess, this is probably related to the dependencies. The spk file only installs the minimal code that runs the FUSE filesystem and doesn't automatically install the system level dependencies or Plex files. This all happened on my system as part of the development process and so it never occurred to me to look into automating this for the SPK. This would be worthwhile but I won't have the time to figure it out in the near future.
If you haven't already, you'll need to install "Python3" from the base Synology package library. You should also install "ffmpeg", which may require you to enable the SynoCommunity package repository.
Once those are done, you'll also need to install a few extra packages for Python. To do so, you'll need to enable ssh (or telnet) access to your Synology (see the Terminal & SNMP section of the Control Panel) and login in as an admin-capable user (if you're connecting from a Windows machine, you can use Putty for ssh--Mac and Linux systems should already have the ssh command available). You'll then need to run the following commands to install the needed Python packages:
After that, you'll also still need to drop the Scanner files in to your Plex directory. On my system, these end up in the "/Plex/Library/Application Support/Plex Media Server/Scanners/Music" folder. You may need to go to the Control Panel and edit the Shared Folder settings to enable your user to see the Plex folder.
Hope that helps get you started.
Hi thanks, for the reply. I have seemingly did everything you have listed, but the package still won't start, I'll try to provide meaningful screenshots below.
I already have use those commands before, so that's why it says it's installed already
From those screenshots, it appears the package installs. A few other things to check:
ls /usr/bin/ | grep FLACCue
, does anything show up?flaccue
folder listed when you run the ls /
command?ls /flaccue/
command? If files show up in there, the FLACCue service is running.If point 1 fails, somehow the initialization script didn't make the correct linkage for running the code. You'll need to find out where the package is installed and create a symlink. On my machine, it gets installed at /volume1/@appstore/FLACCue/usr/bin/FLACCue
and so I would run ln -sf /volume1/\@appstore/FLACCue/usr/bin/FLACCue /usr/bin/
as the root user (sudo -i
). The "\" before the @ symbol escapes it for the Linux prompt.
If point 2 fails, somehow the initialization scripts didn't create the necessary folder for the process. You'll need to create this manually as the root user (sudo -i
):
mkdir /flaccue
chown plex:users /flaccue
chmod a+rwX /flaccue
If you do either of the above, try "Run" for the package in the Package Manager before going to point 3. Rebooting might also help but shouldn't be necessary.
If point 3 fails, run ps x -u plex
and look for a line that includes python3 /bin/FLACCue / /flaccue/
. If that's not running, try launching it manually. First try this as root and see if you get any errors (you should open a second ssh connection to check the /flaccue folder). If that works, use ctrl-c to exit and try running sudo --user=plex FLACCue / /flaccue/
and see if you get any errors.
If all of the above works and point 4 still fails, debugging becomes more complicated--this means everything up to the Plex layer is working and we'd need to figure out why Plex is not liking the setup. Let me know if you end up here and we can figure out some other things to try.
Hope that helps!
Point 1,2,3 failed, so I ran sudo -i ln -sf /volume1/\@appstore/FLACCue/usr/bin/FLACCue /usr/bin/
then ran
mkdir /flaccue
chown plex:users /flaccue
chmod a+rwX /flaccue
after that, the package started, and I could scan the library in plex using "FLAC Cue Scanner", and indeed it returned an album in split tracks, that was before in a single file, so whew, that finally works, thanks!
But after starting the scan, the plex activity for scanning pretty much got stuck. Had to restart my NAS because of it.
Also, will the "FLAC Cue Scanner" also work on a library that has mixed music, both single flac file+cue, and normal flac tracks?
Yeah, it appears Synology took away root privileges for package installation in DSM 7. Good thing from a security standpoint but means my install scripts no longer work. Luckily the workaround isn't too complex right now.
With regards to the stuck scanning, it tends to be a resource intensive process. Scanning my library with the cue scanner actually took several days. I didn't spend too much time investigating as the scanning tends to be a one time issue, but any time Plex accesses a track from within a cue sheet I am decoding the whole track and caching it in memory on the server (freeing the memory after the track hasn't been accessed for 60 seconds). I'm not sure if this might be what you were seeing, but my code is a relatively crude solution to a problem that, as far as I could tell, requires a fix internal to Plex for an elegant option. If you continue to see this issue, try running the scan overnight and see if it makes more progress.
As far as mixed libraries, you shouldn't see issues. My part of the scanner effectively works by finding any .cue files, modifying the Plex entries for all tracks listed in .cue files (sending them to the FLACCue Python code with the appropriate start and end times for the track), and then removing any files referenced by the .cue file from the scan. Any files not mentioned in a .cue file (or only mentioned in a .cue file that fails to fully parse) are parsed by the standard Plex Music scanner (sadly, I couldn't find any way to use the premium scanner here). In the version in this repository, the full disc files are still accessible as disc 9999 in the album, although I personally disabled this at home so only the individual tracks show up (commenting out line 90 in flaccuelib.py--having both was nice on systems without gapless playback support but I found it slightly more annoying to have albums play twice). Also, while named "FLAC", this code should work for any type of music file ffmpeg understands referenced by a .cue file. While most of the album/artist information is pulled from the .cue header, multi disc album support is handled by including "Disc #" at the end of the .cue filename (e.g. "Pink Floyd - Pulse Disc 1.cue").
Let me know if you have any other questions.
I see, I will try to leave the scanning overnight and see what then.
Thanks for the tip about disc 9999, I will definitely use it as well.
Just one last question, when adding a new library to plex, which path do I choose?
the new flaccue directory, so in my case /flaccue/volume2/HDD_NAS/Music
?
and the Scanner is supposed to be "FLAC Cue Scanner" and not "flaccuelib", correct?
The scanner should be FLAC Cue Scanner.
In theory, you should be able to point to either folder structure but I recommend pointing Plex to the original directory (i.e., without the /flaccue/
at the start). This will cause any non-cue tracks to avoid any interactions with my code and keep .cue tracks from going through my code twice--this shouldn't have any effect in theory, but there is no expected benefit and the potential for unintended "features". Basically, my code mirrors the original file system (although as read-only) and should only introduce any changes for files named very specifically by my scanner code (basically, the .flac file with .flaccuesplit.
and a start and stop time embedded in the "file" name).
After ~10hours, this is all it scanned, doesn't seem right.
The album on the right is a are normal flac files, the album on the left is a Flac+Cue, but still being shows as a single track
I'll attach the cue file of that album, idk, maybe there is something wrong there? COOL&CREATE - アゲアゲスパーク! .cue.txt
At a guess, this may be related to the Japanese characters. @nick4fake might understand this better, as he already submitted a fix for allowing UTF-8 in filenames, but the first thing to try would be a cue/flac combination only using Latin characters to isolate the failure. Do you have any cue/flac pairs using only Latin characters you could try this with? If you could put one or two of them in a separate folder and create a temporary Plex library pointing to that folder, we could see if the problem is with the package installation or just specific files. Or possibly copying and modifying the filename and cue sheet.
Ok, yeah, it works without a hiccup on a FLAC+CUE that doesn't contain Japanese characters.
If you change line 148 in flaccuelib.py (the first line of code in the read_cue function) to
with open(file, 'r', encoding='utf8') as f:
it might allow you to load the cue files into your library. Sadly, it doesn't seem to preserve the Japanese text. I'm not finding any documentation on easily loading the text correctly with a quick search--if we can the cue loaded correctly, the rest will hopefully fall in place. It shouldn't be a hard problem but I sadly don't have time to search for long right now.
Hello, I'm a complete greenhorn in the linux world, and I can't get this to work on my Synology, the spk file doesn't work for me. Thanks