Linux - DVD insertion displays Browse menu

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
artrafael Offline
Team-XBMC Forum Moderator
Posts: 6,353
Joined: Jul 2010
Reputation: 112
Location: USA
Post: #1
I recently upgraded both my XBMC systems from Dharma to Eden and now when I insert a commercial movie DVD into the drive, a dialog menu pops up asking me if I want to browse videos, music, pictures, or files. This is the same type of menu that pops up when I insert a thumbdrive that contains files into a USB port. It's as if the DVD is being mis-identified as a data disc containing various types of files rather than as movie DVD. This did not occur with Dharma on either system.

Also, when I clear the pop-up menu, the DVD does not start playing even though I have the behavior set to "Play DVDs automatically." I have to manually select the "PLAY DISC" menu option to get the movie to play. In Dharma, the auto-play on insert option worked correctly.

By contrast, when I insert an audio CD into the same drive, it would automatically play without the pop-up menu. This is the expected behavior (for both Eden and Dharma).

Both systems are running the production version of Eden on top of Ubuntu (one is on Natty and the other is on Oneiric). The OS was unchanged on either system when I upgraded XBMC from Dharma to Eden.

Here is the relevant section of the debug log, which shows DialogSelect.xml being displayed after DVD insertion:
http://pastebin.com/zK90DiN5

For comparison, I booted up one of my machines from a thumbdrive installed with Dharma and here is the same section of the debug log, which shows XBMC preparing to play the disc after DVD insertion:
http://pastebin.com/aei4senS

I'm assuming this is a bug and not a new "feature" with Eden? Anyway, thanks in advance for any help anyone can offer.
(This post was last modified: 2012-04-07 09:20 by artrafael.)
find quote
Lasall Offline
Junior Member
Posts: 4
Joined: May 2012
Reputation: 0
Post: #2
I got the same problem. Did you find a fix for that?
find quote
artrafael Offline
Team-XBMC Forum Moderator
Posts: 6,353
Joined: Jul 2010
Reputation: 112
Location: USA
Post: #3
Unfortunately, no. After almost 2 months without a reply, I was beginning to think I was the only one with this problem or the only Luddite still watching movies on physical DVDs. Big Grin

I ended up disabling the option to play discs automatically for both video DVDs and music CDs. This prevents the XBMC pop-up menu from appearing when a DVD is inserted. Initially, I had only disabled the DVD option to play discs automatically (since the handling of CDs was working fine), but that still resulted in the XBMC pop-up when a DVD is inserted. I found out that if I also disabled the audio CD option for autoplay, then the XBMC pop-up did not appear when a DVD is inserted.

As a result, CD/DVD playing must be manually initiated via the "PLAY DISC" menu option... not as positive on the WAF scale as the autoplay behavior she was acccustomed to in Dharma, but certainly better than if she had to deal with the pop-up menu. Big Grin
find quote
spontex Offline
Member
Posts: 95
Joined: Jan 2012
Reputation: 0
Post: #4
Thank you for this trick. This menu is nonsense for DVD Videos and should not appear if a VIDEO_TS folder is found on the DVD (or should contain a first "Play disc" command). The same thing applies to Blu-ray discs.
find quote
jurialmunkey Offline
Skilled Skinner
Posts: 677
Joined: Feb 2013
Reputation: 45
Post: #5
I was having the same problem so I created a simple bash script that will send xbmc a command to play the dvd when it is inserted.

First up, you need xbmc-send
Code:
sudo apt-get install xbmc-eventclients-xbmc-send

Then create a script called xbmc-autodvd in /usr/bin with the following contents.

Code:
#!/bin/bash
DVDLOCK=~/xbmc-dvdlock
if [ "$1" == "LOCK" ] && [ -n "$2" ];
then
  touch $DVDLOCK
  sleep $2
  rm $DVDLOCK
fi
if [ "$1" != "PLAY" ];
then
  exit
fi
if [ -f $DVDLOCK ];
then
  exit
else
  sleep $2
  xbmc-send -a playdvd
fi

Now make it executable (sudo chmod a+x /usr/bin/xbmc-autodvd).
Now what we need to do is create a UDEV rule that automounts the dvd drive and runs the script. In /etc/udev/rules.d/ create a file called 82-cdrom.rules with the following line

Code:
SUBSYSTEM=="block", KERNEL=="sr0", SYMLINK+="cdrom cdrw dvd dvdrw" RUN+="/usr/bin/xbmc-autodvd PLAY 3"

You will need to change the "sr0" depending on which device node your dvd drive is at. Mine is at /dev/sr0 hence the sr0 (I know I should use rules that make a more persistent match, but using sr0 is quick and easy and it is unlikely to change unless I change my hardware configuration or the order my usb devices are plugged in). What this line does is when udev detects the device it runs our xbmc-autodvd script. The "PLAY" argument tells the script to play the dvd in the drive, and the "3" tells it to wait 3 seconds before it does so to give the drive time to automount. You might need to change this to a larger value, but I found 3 seconds was a good time for me.

Finally, I found that when I resumed my system from suspend, if there was a dvd in the drive it would start playing, which I found annoying. So I created a file in /etc/pm/sleep.d/ called 99_autodvd with the following:
Code:
#!/bin/sh

case "${1}" in
  resume|thaw)
    /usr/bin/xbmc-autodvd LOCK 5
        ;;
  *)
    ;;
esac

Make sure you make that executable (sudo chmod a+x /etc/pm/sleep.d/99_autodvd)
The "LOCK" argument tells the script to create a lock file for 5 seconds which the PLAY part of the script checks for and if it exists will prevent the drive from autoplaying when it automounts on resume. You can change the amount of time the lock file exists by changing the number after "LOCK".

Hope this works for everyone as well as it does for me. My DVD drive is an external usb one, so I don't know if it works for internal ones, but I would assume it does.
find quote
spontex Offline
Member
Posts: 95
Joined: Jan 2012
Reputation: 0
Post: #6
Thank you! Mixed this post with this one in order to also make Blu-rays play, both on insertion and inside XBMC!
find quote