Zune-Online.com - User Forum
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 19, 2008, 07:08:53 am


Login with username, password and session length


Pages: [1] 2   Go Down
  Print  
Author Topic: Current Status of Amarok with libmtp  (Read 10293 times)
0 Members and 2 Guests are viewing this topic.
Mammlouk
Newbie Zuner
*
Offline Offline

Posts: 17


View Profile WWW
« on: February 08, 2007, 07:17:46 pm »

O.k. everyone here's the current status from my experience using Amarok and libmtp.  I will post updates as the status changes whether by updates to libmtp or my own miraculous mistakes that somehow help.

Amarok 1.4.5/libmtp 0.1.3
Connect:  Yes
Disconnect: Yes
List Music: Yes
List Videos: No (Probably capable but not working because Amarok is only for Music)
List Pictures: No (Probably capable but not working because Amarok is only for Music)
List Wallpapers: No (Probably capable but not working because Amarok is only for Music)
Upload Files: No
Download Files: No
Delete Files: Yes














Logged
Kostas
Zune-Online.com
Administrator
Hero Zuner
*****
Offline Offline

Posts: 1207



View Profile WWW
« Reply #1 on: February 13, 2007, 11:45:51 pm »

I use debian. I've seen that amaroK in debian doesn't support libmtp. I haven't checked how to make it support it. How did you do it ?
Logged

-- Zune-Online.com Share your Zune experience!
Mammlouk
Newbie Zuner
*
Offline Offline

Posts: 17


View Profile WWW
« Reply #2 on: February 14, 2007, 03:50:27 am »

I did basically the same thing found here:

http://thecrosstalk.blogspot.com/2007/01/amarok-music-manager.html

It has been updated with newer info in the past few days, but the basic concepts are exactly the same.

While the howto may be written for Ubuntu, the same process should work well for any debian based distro.  If you have any questions or trouble please let me know and I will help as much as I can.
Logged
Kostas
Zune-Online.com
Administrator
Hero Zuner
*****
Offline Offline

Posts: 1207



View Profile WWW
« Reply #3 on: February 20, 2007, 06:40:44 am »

I also compiled from source and installed amaroK on Debian. After installing it I found out I should add manually an MTP device (I named it Zune) for it to connect with my Zune. The automatic detection didn't work for me.

Also I have to run amaroK as root. This is because the MTP library is not allowed to access Zune if not root. I didn't have time to check how this can get bypassed.

If you run:
sudo mtp-files
you'll see every file type is listed. So I believe amaroK chooses not to list non-audio files.
« Last Edit: February 20, 2007, 06:49:39 am by Kostas » Logged

-- Zune-Online.com Share your Zune experience!
Mammlouk
Newbie Zuner
*
Offline Offline

Posts: 17


View Profile WWW
« Reply #4 on: February 20, 2007, 11:07:16 am »

Odd that you cannot access the Zune without being root.  Have you tried checking to see what groups your non root user is in.  Make sure that it is part of the USB group.  If it's not already, then add it and that may fix the problem.  I run everything without root, but I'm sure that Kubuntu has a different set of default user privileges.

I figured as much about libmtp being able to see all the files and audio only being a limit of Amarok.  I hadn't thought to run mtp-files Smiley  Good find Kostas! Hopefully I will have some free time this week to play around some more.  If onl there was a libmtp build for Windows.  I'd like to try accessing the Zune with libmtp in Windows after allowing the Zune software to authenticate since linux can't access the device while it's in use by the Virtual Machine.
Logged
Kostas
Zune-Online.com
Administrator
Hero Zuner
*****
Offline Offline

Posts: 1207



View Profile WWW
« Reply #5 on: February 20, 2007, 07:45:36 pm »

Debian doesn't have libmtp available as a package (at least the x64 edition I use). When compiling it from source, after:
./configure
make
sudo make install
  (or even better on Debian based systems:  sudo checkinstall . You'll need to have installed the "checkinstall" package)

the user should also run:
sudo bash hotplug.sh

This will add the required information for MTP in the udev interface. (When asked if I want the old interface also I answered "no" without really knowing what his means Smiley ).
After this procedure MTP works with Zune from a normal usr account.

I also tried to play with VMware and Zune Software and interrupt Windows while Zune was connected and then tried to connect amaroK. But the connection gets reset and amaroK still doesn't have read/write access. If there is a way for MTP not to reset the already established connection it could work.

A Readme file in the libmtp source code is giving some information about compiling it on Visual C++ . It doesn't mention it, but it could be working also in Cygwin environment. I haven't tested it.

In any case its important here to hack the libmtp code to authenticate when connecting to the Zune Player like the official Software does.
« Last Edit: February 20, 2007, 07:59:19 pm by Kostas » Logged

-- Zune-Online.com Share your Zune experience!
Mammlouk
Newbie Zuner
*
Offline Offline

Posts: 17


View Profile WWW
« Reply #6 on: February 21, 2007, 12:47:34 am »

O.k. glad you have that working right now!

I think by the old interface they probably mean the original libnjb interface that libmtp is based on, but I'm not sure.

I think that maybe it isn't possible to use MTP without it disrupting whatever current connection due to the actual protocol itself.  It's possible (maybe probable) that it is designed to require a connection auth for every single action, but again I'm not sure Smiley

I know that the libmtp team has said it should be able to compile on Windows with very little trouble, becasue they left all of the portability code in from libnjb, but it has yet to be tested.  Running libmtp in cygwin is a good idea though.  I will see if I can test it tomorrow if I have time between school and family.

I definitely agree that it is important to get libmtp to provide it's own authentication and not rely on it from elsewhere.  I was wondering if there is any way to send previously captured USB Packets to a device.  Then we could capture the packets of how Windows connects and resend them to see if the device would at least go into a connected status.  If so maybe there could be a temporary hack to have libmtp send your captured authentication packet (would have to be captured and imported by every user on there own).  It's not the ideal way to go about it, but it would be a start.
Logged
Mammlouk
Newbie Zuner
*
Offline Offline

Posts: 17


View Profile WWW
« Reply #7 on: February 21, 2007, 01:01:57 am »

I also saw on zuneboards.com that some of the guys were having luck using the Windows Portable Device API aka WPD.  There haven't been any recent updates on it, but It sounds at least somewhat promising.  I can't find any cross platform library for it.  Closest I found was someone trying to wrap it in C# here:

http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_22140377.html?qid=22140377

I imagine that it is just an API that wraps around MTP, but don't know for sure.  Maybe it's worth digging further..?
Logged
Kostas
Zune-Online.com
Administrator
Hero Zuner
*****
Offline Offline

Posts: 1207



View Profile WWW
« Reply #8 on: February 23, 2007, 01:37:12 am »

libmtp works fine with other MTP devices which don't need authentication.
I am not sure what the above link is about but using the USB hack to make Zune visible in Windows Explorer I believe this WPD driver is used.

The problem is that when Zune Software is closed the WPD has the same functionality as libmtp (no read/write access).

Read more here:
http://www.zune-online.com/news/zune/use-zune-as-a-usb-external-disk.html
Logged

-- Zune-Online.com Share your Zune experience!
Mammlouk
Newbie Zuner
*
Offline Offline

Posts: 17


View Profile WWW
« Reply #9 on: February 28, 2007, 10:10:15 am »

I get what you mean.  Posted on ZuneBoards today they talked about instead of starting a sync with the Zune software just getting it to connect and the searching via windows explorer using the hard drive hack.  This allows you to drag and drop files to and from the zune.

I was playing with that a little and decided to get back to work trying to do things via linux and here's what I found.  It's not a great discovery, but at least somewhat useful...

If you connect the zune via Zune software running in VMWare and then close the VMWare-player the Zune stays in a connected status.  Now open Amarok and connect to your MTP device (Zune).  Now when Amarok is getting the list of files your Zune goes into Synchronizing status.  You are now able to download tracks from the Zune into your local collection without any issues!  It's a small victory, but I think its at least something. Cheesy
Logged
Kostas
Zune-Online.com
Administrator
Hero Zuner
*****
Offline Offline

Posts: 1207



View Profile WWW
« Reply #10 on: February 28, 2007, 05:18:58 pm »

If you check a previous posting I also checked having Zune connected to the Software and closing VMware but I didn't succeed... What do you mean by "closing VMware". I have tried to even kill VMware while connected, but amaroK still resets the connection.
Logged

-- Zune-Online.com Share your Zune experience!
Mammlouk
Newbie Zuner
*
Offline Offline

Posts: 17


View Profile WWW
« Reply #11 on: March 01, 2007, 05:28:54 pm »

I had also checked it before with no joy.  I spent a couple hours last night trying to do it again with no luck.  I think it may be a timing thing where you have to get it just right.  I will keep trying to figure out what I may have done differently when it worked and will keep you updated.  I promise I'm not making it up or imagining it.  I have plenty of files on my PC now that were previously only accessible in VMWare.
Logged
Kostas
Zune-Online.com
Administrator
Hero Zuner
*****
Offline Offline

Posts: 1207



View Profile WWW
« Reply #12 on: March 01, 2007, 10:02:38 pm »

Quote
I promise I'm not making it up or imagining it.
If you don't provide video doing it, I'll have to ban you from this forum Tongue

I was reading the USB sniffed data you got and compared them with mine. I noticed some minor differences, but most of them are of course the same.

Somewhere at the beginning of the handshake Zune Software send a Certificate and Zune player responds to it. I was wondering if this could be a "login" session. Only bout half of my packet was the same with yours. I am not expert but this could be an exchanging of session keys or something. I hope its just for DRM stuff.
Logged

-- Zune-Online.com Share your Zune experience!
Mammlouk
Newbie Zuner
*
Offline Offline

Posts: 17


View Profile WWW
« Reply #13 on: March 02, 2007, 07:32:11 pm »

I've seen the same characteristics comparing my USB log to a few others I've seen online.  I definitely agree that the software sends an initiation to the Zune and then the Zune responds based on what it is initially given.  The hard thing about getting native authentication working in Linux is figuring out if there is any special way the initiation is formed and whether or not the Zune neds any special response from software based upon it's reply to the initiation.  If only we had some sort of auth functions in libmtp and we could try to reverse the hash from the USB packets (I think I read they are SHA1?) and attempt to send it to the Zune.
Logged
Kostas
Zune-Online.com
Administrator
Hero Zuner
*****
Offline Offline

Posts: 1207



View Profile WWW
« Reply #14 on: March 05, 2007, 07:35:53 pm »

I managed to do it once with amaroK. I had amaroK connected to my Zune, connected the virtual USB of Zune to VMware, Zune Software connected to Zune, disconnected it and was able to copy files from my Zune to my PC's collection. But not sync files from my collection to Zune.

Anyway I can't do it again, I don't have it in video.... So I'll ban myself also off the forum Tongue

EDIT: now when I do this amaroK looks like copying files from Zune. The funny part is it shows a process bar which delays as it would if the copy process was real! When I copy 1 track it ends in 2-3 seconds and for full albums or full artists it delays accordingly. But at the end of the process I get the message:
"Sorry, 10 files could not be organised"

Also at the during the copy process Zune shows "Connected", not "Synchronizing" and its hard drive is not working.

I suppose libmtp believes everything is fine, but in the end nothing has been transfered.
« Last Edit: March 05, 2007, 07:44:07 pm by Kostas » Logged

-- Zune-Online.com Share your Zune experience!
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC


© 2006-2007 Zune-Online.com
Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM

ZuneList.com - The Best Sites about Zune Top Zune Sites Microsoft Zune Player Top Site List Zune MAX Top Zune Fans Add to Technorati Favorites