[LINUX] Playing (legit) DVDs over LAN
#1
Hi,

This took me a lot of hacking, so I thought I'd share with everyone.

I've got an Acer Revo, great machine, increased the hard drive, looking at mounting it behind the screen, it works a treat for everything I need. And all I need on it is XBMC.

However. It doesn't have a DVD drive.

I've got a lovely set up, but if I have a DVD which I haven't ripped, then it all comes tumbling down. So!

I've managed to configure my DVD drive in my main PC to be shared over the network and playable as a normal DVD on XBMC.

The problem I had, was that because Hollywood DVDs are restricted/locked/messed up they won't play over the network.

This is my new setup to take care of that. On my PC (not my XBMC machine):
I downloaded, compiled and installed DVDfs as detailed in the instructions:
http://www.jspenguin.org/software/dvdfs/
and then I was able to mount the DVDs unencrypted.

To get it mounting somewhat automatically, rather then typing:
dvdfs-amd64 /media/dvd
each time, I created a file:
/sbin/mount.dvdfs
which contains:
#!/bin/bash
dvdfs-amd64 $2 -o umask=777 -o allow_other

This allows me to put a line in fstab which will add the file type to the end of the mount command and call it with all the mount parameters
/etc/fstab
dvdfs-amd64 /media/dvd dvdfs defaults,ro,noauto,user 0 0
(ok, so that's just the line I added)

The dvdfs as the type means that when it mounts it, it will run "mount.dvdfs" which is the bash file created above (which of course has executable permissions!)

It starts with dvdfs-amd64 because that's what comes up as the source when it's mounted and you type "mount".
So the system doesn't think /dev/sr0 is mounted on /media/dvd, it thinks that dvdfs-amd64 is mounted on /media/dvd.
If the two don't match, you have issues unmounting them as a user.

If you have it as /dev/sr0 then it will mount automatically with dvdfs when you insert the disc, however you then get issues unmounting it, and I wanted it so I can just click a few buttons and it all looks swish (and it appears in the devices section in nautilus) (After XBMC has stopped accessing the DVD, it takes 90 seconds before something stops and the device is no longer marked as busy and you can unmount it)

It's using fuse, and thus my /etc/fuse.conf contains one line:
user_allow_other

And all that's left is to have it shared by samba, so /etc/samba/smb.conf
[cdrom]
comment = Samba server's CD-ROM
read only = yes
locking = no
path = /media/dvd
guest ok = yes
(yes, my samba config contains more lines, but the rest is out of the box, this is the section I added......ok, I just uncommented it)

Then, back on the XBMC machine, I added a video resource pointing to that particular samba share, and navigated to cdrom/VIDEO_TS/VIDEO_TS.IFO and then the main menu appeared. It starts a little stuttery, but after that there's no network issues. Both machines are on 100meg LAN.

Now I just need to fix the IP of my PC so XBMC doesn't loose it or something silly. Only outstanding issue is that the path is a path and doesn't pop up saying "You've inserted a DVD" or anything. Which is detracts from the swish, but not enough to make it much less sexy.

Anyway, hope this helps someone. Thanks to all who helped make XBMC what it is today, great stuff.
Reply
#2
Hey tazr42,

I have a similar style setup. Running a raspberry pi with OpenELEC and a headless Arch Linux fileserver box (also running SAB, couchpotato, sickbeard ... all the good stuff)

Anyway i was looking for a while for a similar solution and stumbled upon your post. I built on it a little, I'm using Autofs to automate the mounting and unmounting of the DVD. Here's a good resource Arch Linux Autofs Wiki
Also, I edited the custom mount command to be able to either mount DVD's or CD's to the same location. (program for cd decryption "fuse-cdfs" )

mount command named "mount.ROMfs" (changed the name)
Code:
#!/bin/bash

mType=$(cdrecord -prcap dev=/dev/cdrom 2>/dev/null | grep 'Current:'|cut -d: -f 2 )

if [ $mType = 'DVD-ROM' ]
then
        dvdfs-amd64 $2 -o allow_other -o device=/dev/sr0
        exit
fi
if [ $mType = 'CD-ROM' ]
then
        fuse-cdfs $2 -o allow_other -o device=/dev/sr0 -o cache-directory=/tmp
        exit
fi

code for unmount command named "umount.ROMfs"
Code:
#!/bin/bash
fusermount -u -z $1

Here is the code for the Autofs template files
On my system located here:
/etc/autofs/auto.master
Code:
# Sample auto.master file
# Format of this file:
# mountpoint map options
# For details of the format look at autofs(5).

/mnt              /etc/autofs/auto.misc                     --timeout=1

/etc/autofs/auto.misc
Code:
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage

cdrom           -fstype=ROMfs                              :autofs-amd64
Reply
#3
Hello
This seems to be exactly what I wad looking for.
One question though will Xbmc recognice the share as a true dvd / cd drive using this method?
Will it be able to autostart the playing when a new cd or dvd is inserted for example?

Any reasons for using smb rather than nfs?

Many thanks
Reply
#4
Xbmc will not recognize this share as a real DVD/CD just a regular share. I keep meaning to look into it, but haven't had the time ... or will.

You can set the share up as NFS if you like doesn't have to be samba
Reply
#5
Thanks for the fast reply.
Seems I will have to live without the autoplay disc feature then.
Anyway the information in this thread seems very useful and interesting. I will try it this weekend.
Reply
#6
i also have an acer revo connected to my tv downstairs. the few times i would want to view a physical dvd i would use sshfs to connect to my fedora laptop upstairs via wifi. then i would navigate to the dvd drive from within the xbmc menu and play the dvd. (it tends to buffer a lot so i usually copy the iso to the revo or rip them down to mkv's).
Reply
#7
You could look to use iscsi to attach the DVD drive as an alternative.
I used paragon net burner in the past to do the same thing from a windows host, worked well with a copy of anydvd on the host.
Reply
#8
I have not tested it nor do i have a need (dont use dvds), but theoretically if you where to mount the NFS share of the dvd drive to where xbmc expects a dvd to be mounted on the HTPC file system the auto run may work. It depends on how XBMC handles DVDs, does it just check for files in the DVD drive mnt or does it wait for an OS event that happens when the DVD drive is activated, this would make it or break it.

Like i said have not tested it so this could all be BS but just thought I'd throw that out there.
Reply
#9
What about a API call from the box hosting the DVD/CD. The directories and files would be static.

When it comes to JSON/RPC api i'm completely green, is it possible to start playback of a nfs or smb shared file or directory?
Reply

Logout Mark Read Team Forum Stats Members Help
[LINUX] Playing (legit) DVDs over LAN0