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

Help getting this working #40

Closed
rome1983 opened this issue Dec 27, 2018 · 39 comments
Closed

Help getting this working #40

rome1983 opened this issue Dec 27, 2018 · 39 comments

Comments

@rome1983
Copy link

rome1983 commented Dec 27, 2018

Hi, I have a synology ds1815+ and I’m trying to figure out to change the parameters. I’m able to see MAKEMKV GUI on the webpage but need help getting it to find my optical disc drive.

@rome1983
Copy link
Author

Found my optical disc drive @ /dev/sg6 but on the webpage I get program can’t find any usable optical drives.

@jlesage
Copy link
Owner

jlesage commented Dec 27, 2018

Look at the container’s log: you will see clear messages about which Linux devices need to be exposed to the container.

@rome1983
Copy link
Author

The log only shows sg6 needing to be exposed and gives a warning that performance might suffer because it doesn't see /dev/sr*.

@C4Wiz
Copy link
Contributor

C4Wiz commented Dec 27, 2018

straight from my log:
[cont-init.d] 95-check-optical-drive.sh: found optical drive [/dev/sr0, /dev/sg10]

@jlesage
Copy link
Owner

jlesage commented Dec 27, 2018

You normally have to expose 2 devices. Can you provide the whole log?

@C4Wiz
Copy link
Contributor

C4Wiz commented Dec 27, 2018

edit the container, in the extra parameters section add:
--device /dev/sr0 --device /dev/sg0 --device /dev/sg1 --device /dev/sg2 --device /dev/sg3 --device /dev/sg4 --device /dev/sg5 --device /dev/sg6 --device /dev/sg7 --device /dev/sg8 --device /dev/sg9 --device /dev/sg10

this will keep you covered over reboots in case it changes

@rome1983
Copy link
Author

I can provide the whole log a few hours.

@rome1983
Copy link
Author

@ c4wiz are you using a synology nas? I will be back home in few hours. It would awesome to get this work.

@C4Wiz
Copy link
Contributor

C4Wiz commented Dec 27, 2018

@ c4wiz are you using a synology nas? I will be back home in few hours. It would awesome to get this work.

No, im Using unRAID v. 6.6.6

@rome1983
Copy link
Author

rome1983 commented Dec 27, 2018

I started it from the CLI like this.
docker run -d \

--name=makemkv \
-p 5800:5800 \
-v /docker/appdata/makemkv:/config:rw \
-v $HOME:/storage:ro \
-v $HOME/MakeMKV/output:/output:rw \
--device /dev/sg6 \
jlesage/makemkv

makemkv.html.zip

@jlesage
Copy link
Owner

jlesage commented Dec 27, 2018

Looks like one device is not properly detected. Could you provide the output of:

docker exec makemkv lsscsi -g -k

@rome1983
Copy link
Author

[0:0:0:0] disk HGST HDN726040ALE614 APGN /dev/sdc /dev/sg0
[1:0:0:0] disk HGST HDN726040ALE614 APGN /dev/sdd /dev/sg1
[2:0:0:0] disk HGST HDN726040ALE614 APGN /dev/sde /dev/sg2
[4:0:0:0] disk HGST HDN726040ALE614 APGN /dev/sda /dev/sg3
[5:0:0:0] disk HGST HDN726040ALE614 APGN /dev/sdb /dev/sg4
[10:0:0:0] disk Synology DiskStation PMAP /dev/synoboot /dev/sg5
[13:0:0:0] cd/dvd ASUS BW-16D1HT 3.01 - /dev/sg6

@jlesage
Copy link
Owner

jlesage commented Dec 29, 2018

Looks like the Linux CDROM driver (sr) is not loaded. Can you provide the output of the following command:

lsmod|grep sr

@jlesage
Copy link
Owner

jlesage commented Dec 29, 2018

It seems that Synology doesn't officially supports optical drives:
https://www.synology.com/en-global/knowledgebase/DSM/tutorial/Compatibility_List/Does_Synology_Product_support_external_DVD_RW_DVD_ROM_CD_ROM_or_CD_RW_drive

But it seems that some users were able to compile proper drivers and make it work.

@rome1983
Copy link
Author

rome1983 commented Dec 29, 2018

I just got it detected with sudo chmod 660 /dev/sg6 . about to try a disc now.

@jlesage
Copy link
Owner

jlesage commented Dec 29, 2018

Do you know what were the permissions and the owner of the device before the change? This is something that should have been caught by the detection script.

@rome1983
Copy link
Author

Before crw------- 1 root root
After crw-rw---- 1 root root

@rome1983
Copy link
Author

Also no extra parameters section on synology.

@jlesage
Copy link
Owner

jlesage commented Dec 29, 2018

To which value did you configured USER_ID and GROUP_ID?

@rome1983
Copy link
Author

Im trying to figure it out now because I keep getting error posix when trying to write to directory.

@rome1983
Copy link
Author

Just set it 0 to test and it works, will figure out permissions when it finish.

@rome1983
Copy link
Author

uid=1026(rome1931) gid=100(users) groups=100(users),101(administrators)
I tried 1026 and 100 without success.

@jlesage
Copy link
Owner

jlesage commented Dec 29, 2018

Look at the ownership and permission of the folder you mapped to /output.

@rome1983
Copy link
Author

I had figured it out, but the ripping speed is super slow. 1.1x
When I ripped as root it was 5.5x and I didnt let it finish to see top speed.

@rome1983
Copy link
Author

It took a while, but rip speed got faster. Thank you

@rome1983
Copy link
Author

No cdrom module on synology. Your detection script did detect it, right after the [ -, sg6] was group 0. I didn’t know that was the root group.

@rome1983
Copy link
Author

rome1983 commented Dec 31, 2018

The permissions kept changing on reboot. I was able to solve that with a udev rule and creating a cdrom group and adding myself to it.
SUBSYSTEMS=="usb", ATTRS{idVendor}=="", ATTRS{idProduct}=="", GROUP="cdrom", MODE="0660"

@agster27
Copy link

Hello! This is a great Container and love the work put into it! Can someone point me in the right direction on how other Synology users got a dvd drive to work?

The logs show the container can see the drive. How do I expose the dvd?

2019-01-24 02:48:19 stdout [cont-init.d] 95-check-optical-drive.sh: WARNING: for best performance, the host device - needs to be exposed to the container.
2019-01-24 02:48:19 stdout [cont-init.d] 95-check-optical-drive.sh: found optical drive [-, /dev/sg5], group 0.

@rome1983
Copy link
Author

Everything I did is in this thread.

@jlesage
Copy link
Owner

jlesage commented Jan 24, 2019

@agster27
Copy link

To expose the drive, see https://github.com/jlesage/docker-makemkv#access-to-optical-drives

In Synology you cannot pass a --device option to the container. Or at least I cannot figure out how! Sorry I was not more clear. I was curious if someone figured out how to pass the --device option.

@jlesage
Copy link
Owner

jlesage commented Jan 24, 2019

I guess you mean you cannot pass a device when using the UI to create the container?

@rome1983
Copy link
Author

Did you bother to read this thread?

@agster27
Copy link

Did you bother to read this thread?

@rome1983 I did! It was not clear how you passed the --device to the container in Synology. I read it a few times. Any help would be appreciated.

@agster27
Copy link

I guess you mean you cannot pass a device when using the UI to create the container?

I didn't try to pass --device when I "created" the container... I only tried it after I created it. I'll try that now! :)

@rome1983
Copy link
Author

You also need to change permissions on the drive. See above udev rule. Cdrom group doesn’t exist, you have to create it and add yourself to it.

@agster27
Copy link

agster27 commented Jan 24, 2019

@rome1983 and @jlesage I made the permission changes and so far it seems to be working. I still cannot figure out for the life of me how to "present" the device syntax when creating the container in Synology under the "Execute command" field. I tried to put just "--device /dev/sg05" in the field and the container would not start up. I think the syntax was/is wrong. I'll send a screen shot with an error.

You guys have been super helpful. I might have more questions if you do not mind.

@rome1983
Copy link
Author

rome1983 commented Jan 25, 2019

From the command line my config is
Not showing right on my phone
docker run -d
--name=makemkv
-p 5800:5800
-e USER_ID=1026
-e GROUP_ID=100
-v /volume1/docker/appdata/makemkv:/config:rw
-v $HOME:/storage:ro
-v /volume1/MyMedia/Movies:/volume1/MyMedia/Movies:rw
--device /dev/sg7
jlesage/makemkv

@S8ShowBob
Copy link

S8ShowBob commented Apr 3, 2024

And yet another new user who can't manage to use the BlueRay drive.

In the meantime I have read quite a few threads about it, but still can't get it to work.

I'm not using Docker on my Synology DS923+ (DSM 7.2.1-69057 Update 3), but the "Container Manager".
JDownloader-2, Handbrake, MKVToolNix work without any problems.

But with MakeMKV I can't get access to my "BUFFALO Optical Drive".
This message appears:

2024/04/03 21:34:19,stdout,[cont-init] 54-check-optical-drive.sh: no usable optical drive found.
2024/04/03 21:34:19,stdout,[cont-init] 54-check-optical-drive.sh:   --> the host device /dev/sg5 is not exposed to the container.
2024/04/03 21:34:19,stdout,[cont-init] 54-check-optical-drive.sh:   --> the host device - is not exposed to the container.
2024/04/03 21:34:19,stdout,"[cont-init] 54-check-optical-drive.sh: found optical drive [-, /dev/sg5], but it is not usable because:
2024/04/03 21:34:19,stdout,[cont-init] 54-check-optical-drive.sh: looking for usable optical drives... 

I tried my admin user (uid=1026, gid=101).

su@NAS:/$ cat /etc/passwd | grep -E 'su|root'
root:x:0:0::/root:/bin/ash`
su:x:1026:100::/var/services/homes/su:/bin/sh

Still no access, then i tried uid=0, gid=0 (root). Again, no access to it.
Then i tried like rome1983:

su@NAS:/$ ls -l dev/sg5
crw------- 1 root root 21, 5 Apr  3 21:07 dev/sg5

su@NAS:/$ sudo chmod 660 dev/sg5
su@NAS:/$ ls -l dev/sg5
crw-rw---- 1 root root 21, 5 Apr  3 21:07 dev/sg5

Still no access.
I guess I'll have to keep using the drive on my computer, the DS923+ don't accept it.
Or replace the "Container Manager" with Docker and try that.

But I would like to avoid that if possible.
(PS: The "Container Manager" is the new Docker)


UPDATE:

Well... it finally works.
Instead of creating the container the lazy way, I created a project in the "Container Manager" -> example.

There I had the possibility to add a compose.yml where I could add the device (and it's working).

compose.yml

version: '3'
services:
    makemkv:
        image: jlesage/makemkv:latest
        container_name: makemkv
        restart: unless-stopped
        ports:
          - "5802:5802"
          - "5902:5902"
        environment:
          MAKEMKV_KEY: *****
          USER_ID: 1026
          GROUP_ID: 101
          AUTO_DISC_RIPPER: 0
          APP_NICENESS: 0
          WEB_LISTENING_PORT: 5802
          VNC_LISTENING_PORT: 5902
          VNC_PASSWORD: *****
          MAKEMKV_GUI: 1
          DISPLAY_WIDTH: 1920
          DISPLAY_HIGHT: 1080
       volumes:
      - "/volume1/docker/appdata/makemkv:/config:rw"
      - "/volume1/video/storage:/storage:ro"
      - "/volume1/video/output:/output:rw"
    devices:
      - "/dev/sg5:/dev/sg5"

Drive eject doesn't work... but who cares...

final

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

No branches or pull requests

5 participants