Sony XL1B2

From MythTV Official Wiki
Revision as of 16:10, 11 January 2009 by Nodedog (talk | contribs)

Jump to: navigation, search

A Firewire 200-DVD changer with a double-layer burner. Does MythTV or Linux support this device?

Document.png - Specs {{{2}}}

It is possible to use this unit with Linux and MythTv, several patches have been developed or are under development to fully support this unit. I encourage anyone who is interested to ask about this device on the appropriate mailing list(s) and to add any relevant feature requests so that this device and perhaps other similar ones can be supported properly.

To get this device working you will need to ensure that ieee1394, sbp2, scsi changer and scsi cd rom/dvd support are enabled in your Kernel. If all is well then the unit will appear as 2 scsi devices 1 changer device and 1 scsi cdrom /dvd device e.g. /dev/sg2 and /dev/sr0. It is also possible to create a udev rule to give the changer a suitable symlink, the changer is a type8 sg device. Although I have experienced issues with mtx locking up when this is created after bootup.

The mtx command is used to control the changer, MythTv and other application can use this command to change discs. You will currently need a patch for mtx in order for it to work correctly with the Sony VAIO media changer, you can ask for this on the mtx mailing list at http://sourceforge.net/mail/?group_id=4626. This patch also adds some feedback to stdout in order to help integration with other applications. When working correctly the device will show something like the following


# mtx -f /dev/sg2 altquerymode status
 Storage Changer /dev/sg2:1 Drives, 201 Slots ( 1 Import/Export ) Data Transfer Element 0:Empty
     Storage Element 1 IMPORT/EXPORT:Empty
     Storage Element 2:Full
     Storage Element 3:Empty
......
     Storage Element 200:Empty
     Storage Element 201:Empty

Support for the changer is now available in the latest mtx although it uses a slightly different syntax than above.

Support for batch CD ripping, changer inventory and playback of loaded DVDs in MythVideo have been added to my local copy of myth, although this support is very preliminary it has been tested and does work correctly. The jobs are currently offloaded to mtd and run in the background. It should also be possible to support multiple changers or changers other than the Sony utilising these patches. Please ask on the appropriate Myth mailing lists if any details are required I will do my best to help (alternately you can try nodenet at hotmail dot com, although you may be filtered as spam :) ). It will also be possible to add support for MythArchive and batch DVD ripping in a similar manner.

It's worth noting that currently when batch ripping CDs if a faulty disc is encountered, the device may become disabled and unresponsive. A patch for this has been submitted (to sbp2) that allows the device to recover and has removed the need for a reboot when this problem occurs, it is of course still possible that the ripping process may try and read a faulty disc indefinitely if there is a problem. You can ask for this patch at https://lists.sourceforge.net/lists/listinfo/linux1394-devel

It may also be useful to use the regionset utility to set the region code of the changer drive if you are not in region 1 (current default).

mythdvdchangerload.sh

#!/bin/bash

#chng=`dmesg | grep  -e 'ch .*sg[0-9] type 8' | tail -1 |  sed -e 's/.*\(sg[0-9]\).*/\/dev\/\1/'`
#the above can be used to find most recent device no of changer

#udev rules now creates ch0 for type8 sg device
#chng=/dev/ch0
#symlink only works if changer connected b4 power on of server otherwise causes mtx to lock up
chng=`ls -l /dev/ch0 | sed -e 's/.*\(sg[0-9]\).*/\/dev\/\1/'`

if /usr/local/sbin/mtx -f $chng altquerymode drivestatus | grep -q "Slot: Empty"
then
   echo "Good!...Changer drive is empty"
else
   echo "Changer is still loaded.... attempting to unload drive"

   if /usr/bin/eject -v /dev/sr0 | grep -q "eject command succeeded"
   then
      echo "Eject command succeeded (drive spindown)"
   else
      exit 0
   fi

   /usr/local/sbin/mtx -f $chng altquerymode unload

   if /usr/local/sbin/mtx -f $chng altquerymode drivestatus | grep -q "Slot: Empty"
   then
      echo "Good!...Changer drive is now empty"
   else
      echo "Error: Changer is still loaded...aborting"
      exit 0
   fi
fi

if /usr/local/sbin/mtx -f $chng altquerymode load $1 | grep -q "Status: OK"
then
   echo "Slot $1 load succeeded...waiting 5 seconds for disc to settle"
   sleep 5
else
   exit 0
fi

exit 1


mythdvdchangerunload.sh

#!/bin/bash

# chng=`dmesg | grep  -e 'ch .*sg[0-9] type 8' | tail -1 |  sed -e 's/.*\(sg[0-9]\).*/\/dev\/\1/'`
#the above can be used to find most recent device no of changer

#udev rules now creates ch0 for type8 sg device
#chng=/dev/ch0
#symlink only works if changer connected b4 power on of server otherwise causes mtx to lock up
chng=`ls -l /dev/ch0 | sed -e 's/.*\(sg[0-9]\).*/\/dev\/\1/'`

if /usr/local/sbin/mtx -f $chng altquerymode drivestatus | grep -q "Slot: Empty"
then
   echo "Good!...Changer drive is empty"
else
   echo "Changer is still loaded.... attempting to unload drive"
 
   if /usr/bin/eject -v /dev/sr0 | grep -q "eject command succeeded"
   then
      echo "Eject command succeeded (drive spindown)"
   else
      exit 0
   fi

   /usr/local/sbin/mtx -f $chng altquerymode unload

   if /usr/local/sbin/mtx -f $chng altquerymode drivestatus | grep -q "Slot: Empty"
   then
      echo "Good!...Changer drive is now empty"
   else
      echo "Error: Changer is still loaded...aborting"
      exit 0
   fi
fi

exit 1