Author Topic: Powerfile C200-RAM Won't Load Disk into Drive  (Read 9157 times)

lworthington

  • Newbie
  • *
  • Posts: 8
    • View Profile
Powerfile C200-RAM Won't Load Disk into Drive
« on: October 03, 2008, 06:45:22 am »
I just got a Powerfile C200-RAM (R200) and it was automatically detected and loaded once I plugged it in.  I am able to send commands to load a disk into the machine and eject a disk, but when I try to ID a disk, or even send a 'load disk into drive' command nothing happens. 

Looking at the powerfile log I see the following when trying to ID:
10      10/02/08 23:41:11.097           Receive string: MESSAGE 67             <0xb5a9bb90>
10      10/02/08 23:41:11.097           Received MESSAGE 67             0x80d3c70 device: 107 <0xb5a9bb90>
10      10/02/08 23:41:11.097           Received Message type 14 ID 0 from 4 to 107 (device: 107) resp 1 <0xb5a9bb90>
10      10/02/08 23:41:11.097           Socket::SendMessage type 14 id 0 from 107 to 4 <0xb5a9bb90>
<repeats until I stop the pending task>

When trying to run the 'Load disk into drive' command from the pluto admin site I get the following log info:
10      10/02/08 22:58:13.920           Receive string: MESSAGE 79             <0xb5a9bb90>
10      10/02/08 22:58:13.920           Received MESSAGE 79             0x80d3c70 device: 107 <0xb5a9bb90>
10      10/02/08 22:58:13.921           Received Message type 1 ID 701 from 0 to 107 (device: 107) resp 1 <0xb5a9bb90>
01      10/02/08 22:58:13.921           JukeBox::Load_from_Slot_into_Drive -- bad drive 0 or cannot lock drive (nil) <0xb5a9bb90>
10      10/02/08 22:58:13.921           Socket::SendMessage type 4 id 0 from 107 to 0 <0xb5a9bb90>
10      10/02/08 23:18:23.617           Receive string: MESSAGE 79             <0xb5a9bb90>
10      10/02/08 23:18:23.617           Received MESSAGE 79             0x80d3c70 device: 107 <0xb5a9bb90>
10      10/02/08 23:18:23.617           Received Message type 1 ID 701 from 0 to 107 (device: 107) resp 1 <0xb5a9bb90>
01      10/02/08 23:18:23.617           JukeBox::Load_from_Slot_into_Drive -- bad drive 0 or cannot lock drive (nil) <0xb5a9bb90>
10      10/02/08 23:18:23.617           Socket::SendMessage type 4 id 0 from 107 to 0 <0xb5a9bb90>

If I try to play a disk through the orbiter I get the following log info:
10      10/02/08 23:42:20.750           Receive string: MESSAGE 80             <0xb5a9bb90>
10      10/02/08 23:42:20.750           Received MESSAGE 80             0x80d3c70 device: 107 <0xb5a9bb90>
10      10/02/08 23:42:20.750           Received Message type 1 ID 701 from 10 to 107 (device: 107) resp 1 <0xb5a9bb90>
01      10/02/08 23:42:20.750           JukeBox::Load_from_Slot_into_Drive -- no available drives <0xb5a9bb90>
10      10/02/08 23:42:20.750           Socket::SendMessage type 4 id 0 from 107 to 10 <0xb5a9bb90>

I can connect this powerfile to my MCE PC and browse through all of the disks, identify them, and play them so I know it isn't the unit itself...  I can also use "mtx -f /dev/sg6 load 1 0" on the command line and load disk slot 1 into drive 0 without any problems.  Can anyone help out?  I'm a little new to LinuxMCE...


lworthington

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Powerfile C200-RAM Won't Load Disk into Drive
« Reply #1 on: October 05, 2008, 06:14:28 am »
Any help is appreciated - including how to get more detailed logging information, where to look, where to start...  I've checked out the code and am looking through the Powerfile directory now but would appreciate any hints or tips.

I've also deleted the device and had LMCE redetect it and I'm still having the same problem...

shall9505

  • Making baby steps
  • Posts: 2
    • View Profile
Re: Powerfile C200-RAM Won't Load Disk into Drive
« Reply #2 on: October 05, 2008, 08:00:39 am »
It looks like it only works with Windows (not NT) and Mac OS 9

"It connects to any host computer running Windows 98 SE, Millennium Edition, or 2000. Alternatively, you can integrate it into a Macintosh OS 9-based network, but the changer doesn't yet work with Mac OS X."

There is some information at: http://pcworld.about.com/news/Jan192001id38742.htm

The Powerfile relies on MediaFinder software to access the discs inside the changer. If you can figure out what commands MediaFinder sends to access the discs you would have a start on the solution.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Powerfile C200-RAM Won't Load Disk into Drive
« Reply #3 on: October 05, 2008, 10:13:05 pm »
okay,

disregard shall9505. That does not apply here because we have drivers specifically to handle talking to the Powerfile jukeboxes.

the Powerfile C200 was the first jukebox supported. I don't think we have added support for the R200.

You'd have to modify the source in src/Powerfile_C200 to add drive identifiers for your particular device, and then compile.

-Thom

lworthington

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Powerfile C200-RAM Won't Load Disk into Drive
« Reply #4 on: October 06, 2008, 04:07:27 am »
OK - This is my first time to look at the LMCE code so I may be way off...  One thing I see missing is in this section of PowerfileJukebox.cpp:

if (vsFF[1] == "cd/dvd" &&
                        (
                        0 == 1
                        || /* Powerfile C200 */      (vsFF[2] == "TOSHIBA" /* && vsFF[3] == "DVD-ROM" */ && vsFF[4] == "SD-M1212")
                        || /* Powerfile R200 DLC */  (vsFF[2] == "MATSHITA" /* && vsFF[3] == "DVD-RAM" */ && vsFF[4] == "SW-9585S")
                        || /* Sony VAIO XL1B2 */     (vsFF[2] == "MATSHITA" /* && vsFF[3] == "DVD-RAM" */ && vsFF[4] == "SW-9584" )
                        )
                        )

looking at the output of lsscsi my drive is a MATSHITA DVD-RAM SW-9572.  Could this really be as easy as adding in

|| /* Powerfile C200-RAM (R200) */    (vsFF[2] == "MATSHITA" && vsFF[4] == "SW-9572")

and if so do I make the package with
./make_package.sh Powerfile_C200 <version(how do I find this)> 1737 (that is the ID that shows up when I select the Powerfile_C200 Device Template)

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: Powerfile C200-RAM Won't Load Disk into Drive
« Reply #5 on: October 06, 2008, 04:50:50 am »
Looks like there is a similar constuction right above that as well, that probably would need expanding too.
"Change is inevitable. Progress is optional."
-- Anonymous


tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Powerfile C200-RAM Won't Load Disk into Drive
« Reply #6 on: October 06, 2008, 05:03:21 am »
once this is done, a simple make bin should suffice to create the binary. The resulting Powerfile_C200 can be copied into /usr/pluto/bin ..... the trick is, to copy it immediately after reloading the router, so that you can do it before the device starts again.

-Thom

lworthington

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Powerfile C200-RAM Won't Load Disk into Drive
« Reply #7 on: October 06, 2008, 05:56:16 am »
make bin from that directory and the src directory didn't work...

root@dcerouter:/root/lmce/charon-merge/src/Powerfile_C200# make
make: *** No targets specified and no makefile found.  Stop.
root@dcerouter:/root/lmce/charon-merge/src/Powerfile_C200# make bin
make: *** No rule to make target `bin'.  Stop.

root@dcerouter:/root/lmce/charon-merge/src# make -C Powerfile_C200 bin
make: Entering directory `/root/lmce/charon-merge/src/Powerfile_C200'
make: *** No rule to make target `bin'.  Stop.
make: Leaving directory `/root/lmce/charon-merge/src/Powerfile_C200'

I RTFM here http://wiki.linuxmce.org/index.php/Building_From_Source  - do I need to build everything or is there an easier way?


« Last Edit: October 06, 2008, 06:13:03 am by lworthington »

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Powerfile C200-RAM Won't Load Disk into Drive
« Reply #8 on: October 06, 2008, 01:18:33 pm »
Yes. you need to go to the top level directory and build everything, first. It will grab all dependencies, and make the makefiles and set up the development environment in the process.

Once the build is done, you can copy everything from /usr/pluto/lib to charon-merge/src/lib and then run make on Powerfile_C200.

-Thom

p.s. Also, noticed there are some drive specific things too in /usr/pluto/pnp/Powerfile.sh .

I'll be around from work to help, when i get a few moments free.


lworthington

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Powerfile C200-RAM Won't Load Disk into Drive
« Reply #9 on: October 07, 2008, 05:23:43 am »
 Back to the drawing board...  I got it to compile, and when I put the binary in place it detected the two drives and created them as child devices under the Powerfile_C200, but thats as far as it got.  I get this error over and over now in the logs:

1       10/06/08 22:18:59       118 (spawning-device)   ^[[1;00mStarting... 1^[[1;00m
1       10/06/08 22:18:59       118 (spawning-device)   ^[[1;00mFound /usr/pluto/bin/Powerfile_C200^[[1;00m
10      10/06/08 22:18:59.959           Device: 118 starting.  Connecting to: localhost <0xb6a6b6c0>
10      10/06/08 22:18:59.962           Setting timeout for socket 4 to 20 <0xb6a6b6c0>
Return code: 139
3       10/06/08 22:19:01       118 (spawning-device)   ^[[1;31mDevice died... count=1/50 dev=118^[[1;00m
Mon Oct  6 22:19:01 CDT 2008 died

When I put the old binary back and reload its back to normal and the child devices are removed.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Powerfile C200-RAM Won't Load Disk into Drive
« Reply #10 on: October 07, 2008, 06:06:45 am »
okay... segfault hell...

good news is, you have all the development dependencies installed, so this next part isn't so bad.

you may want to try getting the LinuxMCE-0710 branch.

after you've checked it out, do the following search and replace:

 (/svn/branches/LinuxMCE-0710) and building against that, to avoid any possible problems... before going into the Powerfile_C200 directory, copy over the libraries from /usr/pluto/lib to src/lib ..

do the following search and replace from the src/ directory:

Code: [Select]
find . -iname Makefile -exec sed -e 's/<-mkr_t_compile_defines->/-DKDE_LMCE -DDEBUG -DTHREAD_LOG -DLOG_ALL_QUERIES -I\/opt\/libxine1-pluto\/include -I\/opt\/libsdl1.2-1.2.7+1.2.8cvs20041007\/include -I\/opt\/libsdl1.2-1.2.7+1.2.8cvs20041007\/include\/SD/' -i '{}' \;
find . -iname Makefile -exec sed -e 's/<-mkr_t_compile_libs->/-L\/opt\/libxine1-pluto\/lib -L\/opt\/libsdl1.2-1.2.7+1.2.8cvs20041007\/lib/' -i '{}' \;

and then do the compile.

-Thom

lworthington

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Powerfile C200-RAM Won't Load Disk into Drive
« Reply #11 on: October 07, 2008, 07:02:07 am »
Thom,

Thanks for your help so far.  I'll check this out tonight and give it another shot tomorrow...

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Powerfile C200-RAM Won't Load Disk into Drive
« Reply #12 on: October 07, 2008, 07:41:41 pm »
for a quick try/hack you can also mess with LD_LIBRARY_PATH

basically you create a shell script wrapper named /usr/bin/Powerfile_C200 with the following content:

Code: [Select]
#!/bin/bash
export LD_LIBRARY_PATH=/path/to/your/checkout/trunk/src/lib
/path/to/your/checkout/trunk/src/Powerfile_C200 $@

best regards,
Hari
rock your home - http://www.agocontrol.com home automation

lworthington

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Powerfile C200-RAM Won't Load Disk into Drive
« Reply #13 on: October 08, 2008, 08:41:41 pm »
OK - got it compiled and working with the LinuxMCE_0710 branch.  It recognizes the drives and I can load and ID them now.  Tried to watch one and rip one but both failed - will have to look into that. 

Couple other bugs I need to look more into:

1) My device reports that it has 2 drives, but it really only has one.  This may be because mine is messed up, but I see that LMCE is trying to load disks into it so regardless I have to hack it to think there is only one for my model.
2) 'ID All' is broken - it constantly tries to load the next disk into the drive while the previous one is still in there being identified.  It eventually times out and tries the next.  I loaded 22 disks and directed LMCE to ID All and when I came back 1, 4, 7, 10, 13, 16, 19, 22 were found, the rest not.
3) If there are any problems while a disk is in a drive then that drive goes away in the UI and I have to use mtx manually to unload the drive before I can continue.  Clearly the correct solution to this is fix the problem that makes the drive go away, but I'd like to add the ability to run a generic unload.
4) For some reason my device is getting offlined.  This shows up in dmesg:
Oct  8 11:57:34 dcerouter kernel: [  194.264867] ch 8:0:3:0: CDB: Test Unit Ready: 00 00 00 00 00 00
Oct  8 11:57:34 dcerouter kernel: [  194.265037] ch 8:0:3:0: scsi: Device offlined - not ready after error recovery
I don't think it is the Powerfile because I don't any problems in XP.   Powercycling the device doesn't fix it, rebooting my server doesn't fix it.  I can unplug it from my server and plug it straight into my laptop and it works instantly.  Anyways - something else to look in to.

I am curious if anyone else is interested in this...  The reason I got the Powerfile R200 in the first place was because the video wiki says it is supported, so if other people are having problems please let me know.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Powerfile C200-RAM Won't Load Disk into Drive
« Reply #14 on: October 08, 2008, 08:48:22 pm »
fantastic that the driver runs now!

The people I know who have Powerfiles have the C200's not the R200's.. hmmm....

trying to think what we could tell you to push you forward.

-Thom