INTERACT FORUM

Devices => Apple iPad, iPhone, iPod, Airplay => Topic started by: cracksloth on November 06, 2008, 01:48:30 pm

Title: open source iPhone sync api [proposal]
Post by: cracksloth on November 06, 2008, 01:48:30 pm
There are a *lot* of programs that would benefit from the ability to sync with the iPhone.  What the community needs is a separate open source project purely dedicated as a sync api (with iPhones/iPods/whatever).  This way, many interested groups can contribute and maintain the code over time as Apple plays with their code.  I think this is the only sensible course of action because maintaining this code is far too time intensive for all interested parties to maintain individually.  Unfortunately, it will require the dedication of one of those parties to get it started and breathe some life and momentum into the project.  Such skills are beyond me so consider this a call to action to any coders out there.  Just get something started and see if it takes off.  This battle with Apple is ridiculous but it is certainly worth fighting.


Perhaps, the relevant code from MC could be released to help get this started?
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 07, 2008, 12:37:55 pm
As an iPhone developer, and an iPod/MediaCenter user I would be interesed in participating and or contributing to this endvor.

How about it J River?
Title: Re: open source iPhone sync api
Post by: zxsix on November 07, 2008, 02:21:07 pm
I'm not a programmer, I just manage a department full of them.  I volunteer for beta testing.
I already beta test for J River and also for Melloware (see plugins forum).

I have 4 ipods in the household and am missing the ability to sync to the newer ones immensely.
Title: Re: open source iPhone sync api
Post by: cracksloth on November 10, 2008, 01:04:27 am
That is absolutely wonderful, gvanbrunt!!!  I was hoping to hear something back from jriver by now either for or against the release of relevant code.  Is anyone aware of any other code sources (preferably open) that have had some rudimentary luck in syncing with the iphone in the past?

Don't get me wrong, jriver is completely entitled to hold onto their code but I just want to present the idea that it may be in their best interests in the long run.  It distributes development out of house and will help prevent alienating users of Apple devices (there are a lot of us).  Hopefully it would even garner new users - not everyone is in love with iTunes you know.  I am certainly not an Apple fan-boy but, like many others, I do like my iPhone and because it is central to my daily operations, I am forced to use software that can interface with it.  It is simply not practical for me to buy and carry around a separate mp3 player.

So, gvanbrunt...  since you are an iPhone developer, here is a question:  Would it be more practical from a development point of view to create a native iPhone app that can sync media files wirelessly over a network?  Not only does this have the wow factor but it might also bypass some security restrictions if the iPhone app were to deposit music/video/images directly into the iPhone's library.
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 10, 2008, 04:40:54 pm
Unfortunatnly the iPhone or iPod touch music files are off limits for any applications using their public API. That includes all apps available via the app store. So that won't work. It could be done with a "jailbroken" device, but that defeats the "easy" approch for most users.

I think until Apple decides to stop locking users into using iTunes to sync their phones, its not going to be seemless.

What has to be done is a separte app that pulls info from MediaCenter and recreates that in iTunes. Then you can sync your device from iTunes. Not ideal, but not that bad either...

Not exactly an iPhone developer task, but since I'm also very familar with .NET I might try to whip something up that hooks into both programs API's and does the trick.... that is unless JRiver has any plans to go this route.
Title: Re: open source iPhone sync api
Post by: cracksloth on November 11, 2008, 01:01:31 am
hmm, i personally wouldn't mind jailbreaking my iphone to use MC exclusively...  i believe that adding benefits to jailbreaking an iphone is likely the best way to put pressure on apple to stop their tyranny of control.  jailbreaking has become a relatively easy process and i'm certain those that have done so already would love the customization MC has to offer.  just food for thought.
Title: Re: open source iPhone sync api
Post by: raldo on November 11, 2008, 09:38:13 am
Unfortunatnly the iPhone or iPod touch music files are off limits for any applications using their public API. That includes all apps available via the app store....

Yup. I recently posted a suggestion, where a sync plugin hooks up via itunes instead: MC Sync Plugin - Suggestion on how to deal with ITunes... (http://yabb.jriver.com/interact/index.php?topic=48736.msg333947#msg333947). The interface towards ITunes has already been made (iTSfv) and making a connection between iTsfv and a jrmc plugin should be "easy".

(The main problem is that any "plugin" solution requires work from JRiver...)
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 11, 2008, 06:26:33 pm
ITsfv just uses the public iTunes COM API AFAIK. It may use some private calls, but I don't think so. It is not neccessary or even beneficial to create a plug in.

I took a quick look at the iTunes API and it can be done on that side. It's been quite a while since I looked at MC's API and plug in structure, so I'll have to look at that next.
Title: Re: open source iPhone sync api
Post by: zxsix on November 11, 2008, 08:02:57 pm
I'm using ITSFV now.  I'm forced to do it this way since my library is flac, and unreadable by itunes.
So, MC syncs to a virtual device and converts to mp3.
This costs me ~15GB of additional disk space (not a huge deal).
Then I have to use ITSFV to sync that folder with the itunes database.
Then I have to fire up itunes to sync the database changes to the ipod.
Not fun, but it gets the job done.
I'm fine with using itunes to sync, since I'm pretty sure any JRiver produced sync functionality, or any 3rd party plugin, would only handle music and maybe photos.  We'd still need itunes for the apps and firmware updates.  No way to completely cut it out.
I'd like to cut out the itsfv middleman though.
I'm willing to lay down a few dollars for it, whatever the source may be.
Title: Re: open source iPhone sync api
Post by: ThoBar on November 11, 2008, 08:56:24 pm
I posted (http://yabb.jriver.com/interact/index.php?topic=47343.msg334877#msg334877) about this this option .. http://www.getsharepod.com/fordevelopers/

I'd be happy to chip in if it gets the job done...
Title: Re: open source iPhone sync api
Post by: cracksloth on November 12, 2008, 01:21:24 am
interesting, confishy - nice find.  this sounds like it would work.  why wouldn't JR just license this?
Title: Re: open source iPhone sync api
Post by: cracksloth on November 12, 2008, 01:23:53 am
of somewhat relevance, check out:
http://lifehacker.com/5083668/vlc4iphone-ports-vlc-media-player-to-you-guessed-it
vlc would allow video playback without transcoding.  requires an iphone jailbreak but i thought it might add a little fuel to the MC iphone app idea.  would be nice just to move videos over without post-processing.
Title: Re: open source iPhone sync api
Post by: zxsix on November 12, 2008, 06:14:59 am
I posted (http://yabb.jriver.com/interact/index.php?topic=47343.msg334877#msg334877) about this this option .. http://www.getsharepod.com/fordevelopers/

I'd be happy to chip in if it gets the job done...

$299....wow, I'm sure there's enough of us wanting this done that we could cover that investment.
Title: Re: open source iPhone sync api
Post by: ThoBar on November 13, 2008, 12:39:06 am
$299....wow, I'm sure there's enough of us wanting this done that we could cover that investment.

The problem is getting the plugin developed - someone has to do it. If there is anyone out there willing to do so.. sing out!
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 14, 2008, 12:50:07 pm
I'll try throwing something together this weekend. Don't expect it to be pretty.  :)

I know I can pull playlists/song, tag info, and artwork over. I'm not sure if any kind of format conversions would be possible though, as I don't think the MC API supports it. I only took a quick look though. I think that just like syncing via MC you'll pick from a list of playlists to sync and It'll copy the info into iTunes. Then you can sync from there.

If anyone has any brilliant idea's about how to handle conversions, I'm all ears.
Title: Re: open source iPhone sync api
Post by: zxsix on November 14, 2008, 03:10:41 pm
My entire library is ripped to flac, so I'd definitely need it done.
MC already handles the conversion if you specify a misc. handheld.
That's what glynor and I do now.
Then I point itunes to that temp mp3 folder.

Maybe you could attach something to that portion of the program as it already handles the sync.
Let MC do that part, then when it finishes, you pick up and sync the temp folder of converted mp3's to the ipod.

Also, ratings coming back from the ipod to MC is important to me.

Title: Re: open source iPhone sync api
Post by: Doof on November 16, 2008, 12:23:43 am
I'll try throwing something together this weekend. Don't expect it to be pretty.  :)

I know I can pull playlists/song, tag info, and artwork over. I'm not sure if any kind of format conversions would be possible though, as I don't think the MC API supports it. I only took a quick look though. I think that just like syncing via MC you'll pick from a list of playlists to sync and It'll copy the info into iTunes. Then you can sync from there.

If anyone has any brilliant idea's about how to handle conversions, I'm all ears.

I was actually mulling this kind of project over myself, and had done some preliminary testing with the iTunes SDK. The only thing I could really come up with as far as file conversions was to use MC's API to run a search for stacked files for any file it ran into that wouldn't be supported by iTunes. Not ideal, but it was at least an option.

Personally, I really think this is something that should be integrated into MC itself. The file conversion and stacking logic is already there, and MC already handles transferring play stats and volume leveling information for supported iPods. Wouldn't it be simpler for MC to just offer to sync to iTunes for those unsupported iPods?
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 18, 2008, 07:08:50 pm
Sorry for the lateness in replies. I went to paint my wall on Sunday only to find that the gas fireplace was installed by the previous owner in a very unsafe manner. Picture bathroom silicone INSIDE the vent for starters. Not to mention a hole big enough to fit my hand through in the vapor berrier. No wonder it was drafty in there. I guess he realized this, so to compensate he packed as much insulation in the gap between the wall and the fireplace. After all, its a well known fact that the R value increases with the more you pack into a small space... :) Needless to say, this needed some attention before winter sets in. I live in Canada, so this can be somewhat of a problem...

Then to top it all off, I got sick for two days. I actually haven't been that sick in as long as I can remember. Nothing like getting kicked when you're down. Finally starting to feel somewhat better though.

Anyhow.... What I was thinking for syncing non-mp3 types, was being able to specify an alternat "root" directory for files that arn't in an iTunes compatible format. This would be the directory of the Misc device that some users currently use. That is the best I can come up with so far. It's a two step process, but still far quicker than what we currently have to do...
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 18, 2008, 10:23:24 pm
Well, here's what I got so far:

(http://www.pix01.com/gallery/CCB23D24-1D7A-4C3C-A56D-F48080FB6815/iTunesSync/10187462200.jpg)

Sort of like the MC iTunes sync interface. I have no way to pull the icons for the different types of lists as the API doesn't specify what "type" of playlist it is. It also doesn't currently have All Albums, All Photes etc. Does anyone need those?
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 18, 2008, 10:32:34 pm
Actually, I can get the type of playlist. It's via a semi-documented part of the API. Still, not going to worry about that till I get something working....
Title: Re: open source iPhone sync api
Post by: zxsix on November 19, 2008, 12:21:04 pm
gvanbrunt:

If I understand where you're going with this, there's still several steps involved.
Perhaps you can use an event, if one is fired, when a handheld sync in MC finishes that would prompt whether you'd like to launch your itunessync plugin.
Without that, I'd guess this would be the process.
1) Play songs on ipod and make rating changes.
2) Dock the ipod.
3) Sync with itunes, to get rating changes into the itunes database.
4) Run your itunessync plugin in MC, to get rating changes updated in MC and any new songs added to itunes.
5) Back to itunes to do another sync.
6) Ipod is now current and matching MC.

AmIRight?
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 19, 2008, 01:33:04 pm
Yes that is right. Your not going to have one step access as long as Apple keep playing games with opening the db on thier devices. Now that many iPhone "competetors" are starting to hit the market, they may relent, but I seriourly doubt it.
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 19, 2008, 02:18:34 pm
By the way, I forgot to mention that Sharepod doesn't work with version 2.0 and above iPhones and iPod touches. They face the same problems that J River does; you can't include direct support if Apple keeps trying to block you. If you don't like the situation, don't forget to complain heavily in the appropriate areas on Apple's site.

We can only hope that someone slaps Apple with the same type of lawsuits that the "evil M$" faced by bundling IE with the OS. Apple wants to control even the ring tones you can put on your phones, which is crazy. Despite their funny ads on TV, Apple doesn't give an iTurd about its customers, except for how much it can make off them. And before any Mac Fan-boys flame me with the how much better they are etc, I develop for Mac and own a power-book. I didn't say their products were worse than MS only that their business practices are. Until we stop eating the iTurds with our iSpoons, it isn’t going to get any better. :)

And please no flame wars, this was mostly in jest, but point is clear; Apple is to blame, and we need to fight back.

This project is a temporary band-aid until they stop their current practices. It isn't going to be perfect, but it's better than nothing...
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 19, 2008, 02:24:17 pm
Oh yeah, the iTunes sdk also include some "Convert" functions that I may be able to use to do format conversions. That is if J River doesn't include this in its API soon.... wink wink.  I don't know much about them at this point, but perhaps that would cut out the sync to a fake device stage... I may also be able to do the actual "iTunes device sync(s)" from the plug in... This would again speed things up.
Title: Re: open source iPhone sync api
Post by: bwaldron on November 19, 2008, 03:31:19 pm
We can only hope that someone slaps Apple with the same type of lawsuits that the "evil M$" faced by bundling IE with the OS.

I don't want to see the legal system involved (nor did I in MS's case). Apple is well within its rights to do what they're doing -- much as I hate it. What I'd like to see is their strategy backfire on them, and consumers turn to other options.
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 19, 2008, 04:13:35 pm
Monopolistic practices are illegal in most western countries. The only question is if they have a monopoly or not.

Like I said though, lets not turn this into a legal debate. It's not entirely Apples fault either, they have contracts with lables (songs, movies) in which they must protect the contents on their devices. This is partly to do with illegal downloading etc. That said, it might actually be to Apples benefit to be taken to court. If they rule that what they are doing is illegal, they will have to comply and open things up. That means the labels will have to re-think their current contacts. I'm sure they won't want a lucrative source such as the iTunes store to dry up for them.

My point is, to keep the pressure on Apple. That is all we as consumers can do. And to complain to your governments about the unfair practices so they can get involved. These are big players here, with billions of dollars at stake. It will take govenment pressure for things to change.

Actually I think one other option for change is a public sync API to be developed for ALL players. If someone were to put pressure on the device makers to come up with one api, that would pretty much force Apple to comply. They would be the only player on the block that didn't support it... Or perhaps J River could come up with one and nudge some of the other device makers to go along...
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 19, 2008, 04:23:30 pm
I have some more good news about the iTunes API. I actually may be able to do the entire sync via the plug in, without using the iTunes library at all! If the device is in "manual sync mode" you can push tunes on and off at will. I've run into some problems with artwork in my experiments, but this really looks promising.

I just need to find a way to correlate the tracks between MC and those already on the device.
Title: Re: open source iPhone sync api
Post by: zxsix on November 19, 2008, 06:27:12 pm
That sounds much better.
I'd be willing to do some testing for you as things materialize.
I'll be available other than the week of Dec 1-4.
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 19, 2008, 06:40:33 pm
I'm posting a snipit of a personal message I got from Matt:

Quote
Hi there,

Would it be possible to wrap the file and playlist transfer up into discrete calls?

If so, it might be possible to make a new handheld plugin that would just snap into our existing handheld framework.

A handheld plugin has two main jobs:

1) Return a list of files on the device
2) Accept transfers of files and playlists

The management of what to sync is done by Media Center.

Best,
-Matt

This would defiantly be possible and certainly make my life easier. The only thing is I primarily program in C# not C++, so this would be more difficult for me, but not impossible, if that were the only language available. Unless of course there are plans to expose it via COM etc...then it's wide open. Either way I could do it.
If you could let me know some more details, I’m sure many would be greatly appreciative.

Title: Re: open source iPhone sync api
Post by: Matt on November 19, 2008, 07:19:22 pm
Let us take a closer look at the handheld plugin system and get back with you.  It's not something we've released publicly before.

I can say that the plugin itself would have to be a C++ class.  We're moving away from COM as it's a problem on portable installs, in cross-platform setups, etc.

I think a C++ class could be a thin wrapper that loads and uses a .NET assembly, although it's not something I have experience with.
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 19, 2008, 10:00:18 pm
Ya, that's more or less what I planned to do. Wrapper in C++ and the guts in C#. It's not so much that c# is better, but you can't beat the .NET framework for fast application building. Com is pretty ugly to deal with, that is for sure. .NET interop is a much better route anyway as you get the best of both worlds. There is even support for scripting and dynamic langs, so COM isn't really even needed anymore, at least as an intermediary.

I haven't really done much native to .NET interop in a while, but if I remember correctly, it isn't much work to tranform a COM API into a .NET api... You just put the "stubs/proxies" in a C++ managed dll and your done. so to speak... Hell, you can even build the documentation from the comments etc. Not to mention that you still don't even alienate COM as you can get that for "free" as part of the framework. IOW the dll can be exposed to com, but doesn't have to... It's so easy to do, it could be done as part of the installer. Or if you don't want to deal with the headaches of the API at all, make it available only as part of the sdk. Or have the COM option only there for developers that require it, and make them do the REGASM.

If you want to do away with COM, perhaps this is route to go in 13? You have a lot of options this way. Hopefull you will also be able to offer more in the way of the API because of simplified development.

Anyways, just rambling, I'm sure you've considered this route before...
Title: Re: open source iPhone sync api
Post by: Matt on November 20, 2008, 11:12:55 am
I've attached the define of the portable drive interface.  You would need to create an IPortableDrive and expose it with a DLL function CreatePortableDrive(...).  This is much like several of the other plugin types.

The IDispatch pointers are MJFilesAutomation pointers.

I know an example plugin would be helpful, but I don't think we will have time to provide one any time soon.  Getting Media Center to load a custom plugin will also require some coding on our side, but for now, you could replace / hijack the existing handheld plugin.

Code: [Select]
#pragma once

// current interface version
#define HH_INTERFACE_VERSION 7

// device types
#define DEVICETYPE_UNKNOWN -1
#define DEVICETYPE_PORTABLEDRIVE 0
#define DEVICETYPE_SPECIFIC 1
#define DEVICETYPE_WMDM 2
#define DEVICETYPE_IPOD 3
#define DEVICETYPE_PROXY 4

// playlist formats
#define PLAYLIST_FORMAT_M3U_RELATIVE 0
#define PLAYLIST_FORMAT_M3U_FULL 1
#define PLAYLIST_FORMAT_M3U_FULL_NO_DRIVE 2
#define PLAYLIST_FORMAT_ASX_RELATIVE 3
#define PLAYLIST_FORMAT_ASX_FULL 4
#define PLAYLIST_FORMAT_ASX_FULL_NO_DRIVE 5
#define PLAYLIST_FORMAT_PLP_FULL_NO_DRIVE 6
#define PLAYLIST_FORMAT_M3U_FULL_NO_DRIVE_WITH_COMMENTS 7

// plugin names
#define PLUGINNAME_PORTABLEDRIVES _T("Portable Drives")

// no playlists
#define NO_PLAYLISTS _T("NO_PLAYLISTS")

// general defines
#define PDT_LIST_DELIMITER _T(";")
#define WMDM_E_PERMISSION -1003
#define WM_DRM_PROGRESS (WM_USER + 300)

// action defines
#define HH_MENU_ACTION_BUILD 0
#define HH_MENU_ACTION_PROCESS 1

// menu items
#define IDM_HH_MENU_ITEM 1
#define IDM_HH_MENU_ITEM_DELETE IDM_HH_MENU_ITEM

// commands
#define IDM_HH_UPLOAD (WM_USER + 1)
#define IDM_HH_SEND_PLAYLISTINFO (WM_USER + 2)
#define IDM_HH_PREPARE_TO_SYNC (WM_USER + 3)
#define IDM_HH_CLEANUP_SYNC (WM_USER + 4)
#define IDM_HH_RESET_PLAYCOUNTS (WM_USER + 5)
#define IDM_HH_UPDATE_DEVICE_INFO (WM_USER + 6)
#define IDM_HH_SET_MJ_AUTOMATION (WM_USER + 7)
#define IDM_HH_PREPARE_FOR_UPLOAD (WM_USER + 8)
#define IDM_HH_EJECT (WM_USER + 9)
#define IDM_HH_EDIT_DVD_INFO (WM_USER + 10)

// plugin callback
class IPortableDriveCallback
{
public:
virtual void PortableDrive_RefreshUI() = 0;
virtual void PortableDrive_GetRootFiles() = 0;
virtual void PortableDrive_Progress(int nCurrent, int nTotal, BOOL * pbCancel) = 0;
virtual void PortableDrive_CloseDevice() = 0;
virtual void PortableDrive_EnumerateDevices() = 0;
};

// plugin interface
class IPortableDrive
{
public:
virtual ~IPortableDrive() { }
virtual HRESULT Initialize(BSTR * bstrDeviceInfo) = 0;
virtual HRESULT GetMemoryInfo(BSTR bstrPath, LONGLONG * pTotalSize, LONGLONG * pAvailableSize, LONG * pError) = 0;
virtual HRESULT GetFiles(BSTR bstrPath, IDispatch * pdispFiles, LONG * pError) = 0;
virtual HRESULT GetTreeItem(BSTR bstrPath, BSTR * pItem, LONG * pHasChildren, LONG * pError) = 0;
virtual HRESULT GetDeviceIcon(LONGLONG * phIcon) = 0;
virtual HRESULT GetLastError(BSTR * pError) = 0;
virtual HRESULT Menu(BSTR bstrPath, LONG nAction, LONG nParam, LONG * pError) = 0;
virtual HRESULT ProcessCommand(BSTR bstrInfo, LONG lCommand, IDispatch * pDispatch, BSTR * pItem, LONG * pError) = 0;
virtual HRESULT Cancel() = 0;
};

typedef IPortableDrive * (* CreatePortableDriveFunc)(IPortableDriveCallback * pCallback);
Title: Re: open source iPhone sync api
Post by: Doof on November 20, 2008, 01:19:19 pm
So this may be a stupid question, but if this plugin becomes a handheld plugin, will we still be able to tell iTunes to sync our iPhone apps and Outlook Calendar, etc? If so, this will give us the best of all worlds. MC's awesome organization abilities and iTunes ability to fully back up and sync our iPods.

Can't wait! :)
Title: Re: open source iPhone sync api
Post by: zxsix on November 20, 2008, 02:42:36 pm
So this may be a stupid question, but if this plugin becomes a handheld plugin, will we still be able to tell iTunes to sync our iPhone apps and Outlook Calendar, etc? If so, this will give us the best of all worlds. MC's awesome organization abilities and iTunes ability to fully back up and sync our iPods.

Can't wait! :)

Yes, Doof, that is correct.  Within itunes, you have checkboxes in the tabs for each media type to specify what you do/don't want itunes to manage for syncing.  I would allow itunes to handle the apps and videos, and have MC handle the music and maybe podcasts if those were part of the plugin.
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 20, 2008, 02:55:30 pm
Just to add to what zxsix said, once you change a device to manual sync, in iTunes it no longer automatically syncs music, videos, etc. You drag and drop them from the main library to the device. As for calandars and apps, those still Automaticaly sync. So yes you would get the best of both worlds. And if you jailbreak your phone, then you the best of all three worlds... :)
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 20, 2008, 03:10:08 pm
Matt:  Thanks I'll mess around with this abit tonight. If you could provide some brief descriptions of a couple of things, I would appreciate it. If this is covered by looking at some of the existing examples, don't bother to answer, I'll find that out later... :)

1. First the initialize function is passed a string (or is passed out), what is it used for?
2. Many functions have a pError pointer, what is this used for? Errors obviously, but there is a GetLastError function. Why two? My guess is one and the same, just two different ways of dealing with it.
3. What are the specs on the icon in GetDeviceIcon...
4. Menu - totally in the dark on that one.
5. ProcessCommand - I need some info on that one as well.
6. How does MC detect when a device is connected or not?

Thanks
Title: Re: open source iPhone sync api
Post by: gvanbrunt on November 23, 2008, 03:58:52 pm
I've been doing some snooping and found that another player that has recently added iPhone support is actually using itunesmobiledevice.dll to sync to the device. While this offers the device to be synced without iTunes opening, it still requires iTunes to be installed or at least the "common files" directory to be copied from a working iTunes install.

I don't see any other advantages to this method compared to using the actual API to get the job done. But there are some disadvantages. If apple changes the dll, it may stop working at a future date. In fact this has already happened in version 8.0 as one of the structures had changed. Since this is also part of the route that jailbreaking uses it seems very likely that this dll will change, and probably very significantly at some future date. So I'm going to continue down the API route at this point. That is unless anyone can point out why the other method may be preferred.

Comments?
Title: Re: open source iPhone sync api
Post by: glynor on December 02, 2008, 02:48:09 pm
I just thought I'd mention that I'm waiting with bated breath.
Title: Re: open source iPhone sync api
Post by: Cheburashka on December 02, 2008, 04:10:32 pm
I thought I would point out, while you are doing this, that there are (at least) two other iPod/iTunes incompatibilities in JRiver at the moment:

1.     With iPods JRiver is capable of synching with, songs referenced by .cue files are not synched correctly.  Instead of synching just the song, the entire file is synched, taking up much more space and causing the free space calculation to fail.

2.     JRiver cannot tag .m4* files, although there are publicly available api's for doing this.
Title: Re: open source iPhone sync api
Post by: gvanbrunt on December 02, 2008, 06:12:01 pm
And I thought no one cared... :) I didn't get any response to the questions I asked so I figured there was limited interest in plug in. I guess everyone is mostly like me in scratching their heads about what is needed by everyone. Still, there has been a lot of feedback earlier that gives me a lot to go on.

Sorry, for the delay though. I was out of town for a while. Duty calls and I have to make a living. :) I will be playing around with the interface provided by Matt over the next couple of days. After I see what I can do with it I can make plans on how to proceed. I can then probably give everyone some kind of idea how long things will take. Not very long for a first version I would think. Can't speculate on what features it will have until I find out what I can do with information Matt provided.

Just so you know. I too want this working ASAP as I would love to be able to sync my iPhone without the current gymnastics. :)
Title: Re: open source iPhone sync api
Post by: Doof on December 02, 2008, 07:57:46 pm
I didn't get any response to the questions I asked so I figured there was limited interest in plug in.

Well, I didn't want to be a pain in the ass about it, but if it will make you feel better I'll bug you about it every day.  ;D
Title: Re: open source iPhone sync api
Post by: gvanbrunt on December 02, 2008, 08:25:08 pm
LOL

K, I get the point. I'll try to stay on top of it and keep you all updated.
Title: Re: open source iPhone sync api
Post by: Cheburashka on December 02, 2008, 09:00:30 pm
And I thought no one cared... :) I didn't get any response to the questions I asked so I figured there was limited interest in plug in. I guess everyone is mostly like me in scratching their heads about what is needed by everyone. Still, there has been a lot of feedback earlier that gives me a lot to go on.

I care, I just -- and I mean no disrespect by this -- have some doubt as to whether it will turn out to be possible to make one that is useful.  I'm inclined, although I recognize that I could be mistaken, that for performance reasons this functionality has to be built into jriver.
Title: Re: open source iPhone sync api
Post by: gvanbrunt on December 03, 2008, 07:44:58 am
Well performance can't be an issue for me either as I have a 16GB model iPhone. I have a 80GB iPod that I intend to do testing on. It already takes 1 1/2 hours to completly load it. Also, I don't think iTunes is any faster or slower at syncing than JRiver. The bottleneck is the speed of USB not software. Unless you have a really slow computer...
Title: Re: open source iPhone sync api
Post by: Cheburashka on December 03, 2008, 05:56:29 pm
I would think that passing through iTunes would create, not a bottleneck, but rather add a substantial latency.  Consider that, especially with transcoding, jriver has to tell itunes about the file, itunes has to load the file, scanning it, then jriver has to tell itunes to put the file on the iPod/iPhone.  So, the file is being read twice.

For me maybe its worse than other people, because I access my music files from a server over a gigabit network.  So adding an additional time the file has to be read will actually have a significant impact.  (I suspect there are more people with jriver doing this than have spoken up.)

And jriver _is_ substantially slower to sync than iTunes, because jriver wants to re-randomize random playlists on each sync, whereas itunes just replaces the songs you listened to or skipped.  That, actually, is an important feature, while you're at it.
Title: Re: open source iPhone sync api
Post by: Doof on December 03, 2008, 07:45:22 pm
Well, the alternative is that we don't use the newer iPods with MC at all. The only avenue left to us, thanks to Apple, is to do it via plugin through iTunes.

So personally I think the latency will be acceptable.
Title: Re: open source iPhone sync api
Post by: zxsix on December 03, 2008, 08:39:40 pm
I agree....by any means necessary.
I have a touch now, but will consider adding two iphones next year when my current contract ends.
Even with an iphone, I wouldn't see a problem with clicking on it to initiate a sync that starts at bedtime and is finished before it's time to go to work.
For those already owning an iphone....does syncing prevent you from receiving calls?
Is that where the issue lies for you, or is it because you can't take the iphone into the bedroom with you since it's tethered to a pc in another room being syncd?

Title: Re: open source iPhone sync api
Post by: Cheburashka on December 04, 2008, 01:02:55 pm
Well, the alternative is that we don't use the newer iPods with MC at all. The only avenue left to us, thanks to Apple, is to do it via plugin through iTunes.

So personally I think the latency will be acceptable.

No, that isn't right.  The two other alternatives are: 1) Interfacing directly with the .dll, and 2) Implementing new synch code rather than talking to an Apple api (which is what jriver used to do).
Title: Re: open source iPhone sync api
Post by: Cheburashka on December 04, 2008, 01:05:27 pm

Is that where the issue lies for you, or is it because you can't take the iphone into the bedroom with you since it's tethered to a pc in another room being syncd?


The latter.   You can receive calls while synching, but it interrupts the synch.  With jriver (but not iTunes) the synch is then restarted from scratch, not resumed, when you put the phone back in the cradle.  Who knows what the plugin will do.
Title: Re: open source iPhone sync api
Post by: Doof on December 05, 2008, 07:25:29 am
No, that isn't right.  The two other alternatives are: 1) Interfacing directly with the .dll, and 2) Implementing new synch code rather than talking to an Apple api (which is what jriver used to do).

So when can we expect your plugin?
Title: Re: open source iPhone sync api
Post by: Cheburashka on December 05, 2008, 01:16:14 pm
So when can we expect your plugin?

I don't claim the ability to do this.  I'm merely pointing out issues that otherwise seemed to be overlooked.

Honestly, though, this seems to me like a problem jriver should be solving on its own rather than turning to the community for a solution.  Other vendors have been able to solve it.  And if they have to periodically re-solve it... So what -- that's why jriver isn't free.
Title: Re: open source iPhone sync api
Post by: gvanbrunt on December 05, 2008, 01:25:35 pm
Just want to clarify a couple of things. First interfacing directly with the dll will not be much faster than going through iTunes API if at all. Second, JRiver never used an Apple API, which is why their iPod support "broke" when Apple changed the details of how things worked. The whole point of an API is that it is robust and works across versions and upgrades (usually). The dll method faces the same problems as jRivers current implementation, it can (and will) break when Apple changes things. Look up Ordinals and dlls for the details. That is only part of the problem. The implementation also isn’t' a public API so Apple will change that whenever they feel like, which will be about as soon as they hear about an iTunes competitor using it directly.

Also, it isn't as simple as throwing a few programmers at the problem and being able to fix it. They have to reverse engineer how Apple does things. Apple is a huge corporation with billions of dollars and is in bed with communications companies that have billions more. They want to be able to lock users into their services and have invested a great deal of effort in blocking reverse engineering. It is not a simple task.
Title: Re: open source iPhone sync api
Post by: Cheburashka on December 08, 2008, 12:33:53 pm
Also, it isn't as simple as throwing a few programmers at the problem and being able to fix it. They have to reverse engineer how Apple does things. Apple is a huge corporation with billions of dollars and is in bed with communications companies that have billions more. They want to be able to lock users into their services and have invested a great deal of effort in blocking reverse engineering. It is not a simple task.

I never said it was simple, but it doesn't seem to be much more complicated than throwing some number of programmers at the problem. 

I could be wrong that interfacing with the .dll will offer substantial performance improvements over interfacing with iTunes via the public API.  If the issue is that this will have to be periodically modified when the .dll changes... again, JRiver isn't free.
Title: Re: open source iPhone sync api
Post by: Doof on December 17, 2008, 07:25:17 am
Any news?
Title: Re: open source iPhone sync api
Post by: glynor on December 17, 2008, 10:07:35 am
I never said it was simple, but it doesn't seem to be much more complicated than throwing some number of programmers at the problem. 

I could be wrong that interfacing with the .dll will offer substantial performance improvements over interfacing with iTunes via the public API.  If the issue is that this will have to be periodically modified when the .dll changes... again, JRiver isn't free.

Understood.  The confusion has come because you're preaching to the choir.  I think all of us would certainly prefer that JRiver do this all fancy and whatnot (though I'd personally actually prefer that all syncing happen through iTunes rather than through MC directly, because I want the other functions that iTunes does when it syncs -- App Store syncing and installs, Contacts and Bookmarks syncing, etc, etc).  Either way, we've moved beyond that because the CEO of JRiver unequivocally said "no".  So it is now this way or the highway.

You're fighting a fight that was already fought and lost.
Title: Re: open source iPhone sync api
Post by: gvanbrunt on December 17, 2008, 07:48:53 pm
OK, some quick updates for everyone. I've been busy at work for the last while and had to drop this for a bit. The good news is I have a lot of holidays owing that I'll be taking them starting next week. I'll then have some real time to spend on this. I've gotten as far as figuring out how to use the interface Matt provided. I'm going to make up a test plug in to figure out the fine details. I'll try to get that done in the next couple of days.

Glynor, this plug in would do exactly what you want. You set iTunes to manually manage music etc. Then MC is used to sync music etc, and iTunes can be used to sync the rest.
Title: Re: open source iPhone sync api
Post by: zxsix on December 17, 2008, 10:08:14 pm
I'll have some time off as well.  Feel free to call on me for any testing you may need.
brian at glockster dot net is where I can be contacted, or here in this thread.
Title: Re: open source iPhone sync api [proposal]
Post by: Doof on January 03, 2009, 11:23:45 am
Can somebody inquire as to the status of this so I don't sound like a nag? ;)
Title: Re: open source iPhone sync api [proposal]
Post by: Magic_Randy on January 03, 2009, 01:31:54 pm
What's the status of this? ;)
Title: Re: open source iPhone sync api [proposal]
Post by: JimH on January 03, 2009, 02:34:03 pm
The original poster hasn't visited the forum in a couple of months.
Title: Re: open source iPhone sync api [proposal]
Post by: Doof on January 03, 2009, 03:53:59 pm
Yeah, but it wasn't the original poster who said he was going to build this thing. ;)
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on January 04, 2009, 08:19:18 pm
Matt:

How is CreatePortableDrive called from MediaCenter? I've been playing around with this but can't get it to work. It looks like a COM component but I'm guessing it's not being used this way? Is it "calling" the exported function directly?
Title: Re: open source iPhone sync api [proposal]
Post by: cracksloth on January 06, 2009, 03:25:23 am
@JimH

I've been lurking (just not logged in).  As Doof pointed out, I have no real "skills" of my own but I felt the need to contribute my (humble) assessment of the situation.  I just wanted to express that Apple's latest hardware offerings represent a significant marketshare and to ignore it out of frustration is not wise in the longterm.  The community would benefit from having a few pioneering souls to brave the fight and inspire others to help.  A few leaders and community involvement is the best answer to this long term problem.  Unfortunately, it usually takes a working product to inspire others which is why I'm so impressed with gvanbrunt.  It takes a lot to get something like this started and build momentum.  So a big thanks to you, gvanbrunt!!
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on January 06, 2009, 09:28:43 am
This is a little off topic but I think we should be seeing a different attitude from Apple in the near future. They had a monoply on "iphone like products", but now everyone and their dog has a touchscreen device. Hell, there are even Android phones that have a keyboard as well. They are going to start seening their share shrink and are going to have to play ball to keep people in their court. Their is also the Android OS and MS has touch features slated for their next release of Moble.

As for this project, I think I figured out the problem I've been having and hope to have the "interface" provided by Matt working this evening. I can then figure out how it works.
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on January 06, 2009, 07:52:08 pm
In the imortal words of Borat: "Great Success!"

I've finally managed to whip up a plug in using the undocumented interface Matt provided that doesn't crash MC and dumps out stuff to the "debug stream". That said, I'm now working on figuring out how the interface works exactly.

Just wanted to keep everyone in the loop so I don't get roasted at the stake... :) Just kidding, sometime's I need a kick in the butt to get going. I also in true geek fashion wanted to tell someone about "the cool thing I dun". Only a nerd like myself would get excited about coding.
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on January 13, 2009, 08:33:02 pm
Well, it took a lot longer than I thought, but I've finished my analysis of the IPortable interface. I've uploaded it here:

http://www.megaupload.com/?d=ZOIGWHAV

It's only two pages, but there are some things that need to be sorted out by JRiver. I would love to use the interface as it will make writing the plugin much easier.

Matt:
Could you take a look at the doc and let me know if JRiver will do the work needed to make using the interface possible? If I get a yes I can continue to work on the plug-in in the mean time using an IPod as they are no different as far as the iTunes sdk is concerned. If someone could give the write-up a quick sanity check, that would be nice too... :)

Thanks
Title: Re: open source iPhone sync api [proposal]
Post by: JONCAT on January 19, 2009, 01:44:58 pm
Count me in for testing if/when needed (Nano & iPhone).

DC
Title: Re: open source iPhone sync api [proposal]
Post by: Messiahs on January 19, 2009, 04:59:01 pm
@gvanbrunt
can you please upload a pdf ?
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on January 19, 2009, 06:06:05 pm
PDF of file.

http://www.megaupload.com/?d=K7N43DRT

Title: Re: open source iPhone sync api [proposal]
Post by: Messiahs on January 20, 2009, 01:52:09 am
Thanks
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on January 21, 2009, 04:55:46 pm
Bump.

So how about it JRiver? I would like to get going on this, but I'm still waiting for a response to my request about adding support for loading the plugin, etc. I don't want to be a pest, but I know others will be after me if I don't get this going soon... :)
Title: Re: open source iPhone sync api [proposal]
Post by: neFAST on January 21, 2009, 05:25:03 pm
Sorry Dude, they're too busy glashing their G1s :)
Title: Re: open source iPhone sync api [proposal]
Post by: JimH on January 21, 2009, 05:40:17 pm
glashing?

Urban Dictionary definition of glash (http://www.urbandictionary.com/define.php?term=glash)

I think your girl friend is safe.
Title: Re: open source iPhone sync api [proposal]
Post by: Matt on January 21, 2009, 06:31:48 pm
The document looks great.

The device info object is cryptic, but pretty simple.  It's an array of strings like (#characters:value)  The values are in pairs, so each two makes an entry. (a string to string map works well for storage)  If you need C++ parsing code, let me know and we'll see what we can do.  Most of the values are just user settings.  A few are device ID gathered during device detection.

You're right that the old plugin was COM, but we're moving away from COM because it's not very cross-platform or portable install friendly.  Most plugins are plain C++ interfaces now.

As for the detection side, I'm not sure.  To start, just replace the existing hh_portable with your own.  If it looks like it will work, we'll figure out a nice way to hook it up.

Thanks for your work so far, and good luck :)
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on January 22, 2009, 08:51:21 am
ah, the first number is the number of characters. Now me feel dumb. :) That was what I was wondering about. With the details you provided, I can write the parsing code pretty quick. Thanks for the offer though.

As for hh_portable, I've already done the replacement part; it was how I figured the interface out. :) It will work. I've also looked at using the Apple API and it's doable as well. I’ve pretty much got everything figured out. The only thing I needed was a commitment from your end, and since I’ve got that, I can proceed. I have an IPod I can use in the meantime for testing. The only problem I can see right now (for you) is how you are going to pull the device ID during detection.

I’m going to start on this soon, but I may have a couple of questions along the way.

Thanks Again
Title: Re: open source iPhone sync api [proposal]
Post by: glynor on January 23, 2009, 11:25:23 am
I'm so excited (and I just can't hide it)...

 ;D

If you need user beta testing or support documentation writing, please just let me know.  I'm happy to help where I can.  You can PM me here and I'll get the message fairly quickly.
Title: Re: open source iPhone sync api [proposal]
Post by: Doof on January 24, 2009, 08:52:35 am
Yeah, same here. I've got an iTouch and a Shuffle if that helps with testing. Although theoretically, the model iPod really shouldn't matter I wouldn't think.
Title: Re: open source iPhone sync api [proposal]
Post by: JONCAT on January 24, 2009, 10:18:28 am
glashing?

Urban Dictionary definition of glash (http://www.urbandictionary.com/define.php?term=glash)

I think your girl friend is safe.

LOL. I'm really hoping this moves forward. I offer moral support as well as my iPhone for testing. I'm literally dying having to suffer through iTunes after syncing MC to a virtual handheld; works but VERY tedious.

DC
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on January 24, 2009, 06:50:38 pm
Hey, Doof and Glynor have the same number of posts.... Spooky... :)

5413 when I looked.
Title: Re: open source iPhone sync api [proposal]
Post by: Doof on January 24, 2009, 11:33:24 pm
Hey, Doof and Glynor have the same number of posts.... Spooky... :)

5413 when I looked.

Guess I better post again so I don't lose my lead. ;)
Title: Re: open source iPhone sync api [proposal]
Post by: glynor on January 25, 2009, 01:33:37 am
That is spooky (and we're tied again now).
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on January 25, 2009, 08:27:36 pm
Uh oh, hope I didn't start some kind of sudo flame war thread with one trying to outdo the other. Could be a real long thread... :)
Title: Re: open source iPhone sync api [proposal]
Post by: JimH on January 26, 2009, 07:06:02 am
I could fix that.  The admin has the power to reset a user's post count.  That's how I got so many posts.
Title: Re: open source iPhone sync api [proposal]
Post by: Doof on January 26, 2009, 08:30:11 am
Uh oh, hope I didn't start some kind of sudo flame war thread with one trying to outdo the other. Could be a real long thread... :)

No flame war, but you may have kicked off a post count cold war. Who will post first? MAPCI (Mutually Assured Post Count Increase)? Doesn't have the same ring to it, does it...

Uh, oh... looks like I fired the first shot. :P
Title: Re: open source iPhone sync api [proposal]
Post by: Doof on January 27, 2009, 02:50:38 pm
How come my post count is going down?!? :P
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on January 28, 2009, 09:29:41 pm
Matt:

I need a bit of help with the error handling in the plug in. It seems that no matter what HRESULT I return from a function, MC never calls GetLastError. When does this actually occur? Also, if I need to display an error message or such, is it possible from the plug in? What I figured was, one would be created when returning certain HRESULTs when MC called GetLastError. Any pointers on how I'm supposed to handle this?
Title: Re: open source iPhone sync api [proposal]
Post by: ThoBar on February 01, 2009, 08:45:08 pm
Just wanted to give a quick hello and thanks to gvanbrunt for all the work on this. As a current (although admittedly reluctant) iPhone user, I am waiting with bated breath for this plugin. I hope your work comes to fruitition.

Kudos for the time and effort put in. Many could, you did.
Title: Re: open source iPhone sync api [proposal]
Post by: glynor on February 02, 2009, 10:44:07 am
I'm even more interested in this now.  I just installed Windows 7 on my Macbook Pro, and am using it for my one-and-only copy of iTunes.  In setting that up, I switched over to AVG Internet Security (I use an old Corporate Symantec AV on my WinXP installs, from before they made it all bloated and terrible).  Unfortunately, I discovered today that AVG's resident protection blocks iTLU, which I'm currently using to sync my iTunes library to the "handheld" folder on my hard drive (which MC syncs to).

So now, to sync my phone, it is a huge multi-step process made one step harder by the need to manually go in and disable AVG (a process which takes like 6 clicks and a UAC prompt).  Either that, or I need to find a different A/V application (equally annoying).

So here's hoping that this'll end up working, and secondarily that it'll work with anti-virus protection turned on!
Title: Re: open source iPhone sync api [proposal]
Post by: glynor on February 02, 2009, 11:43:26 am
FWIW, I think I've decided to abandon AVG and use ClamWin (http://http://www.clamwin.com/), for now.  I have mixed feelings, because I did like the AVG Anti-Rootkit and Anti-Spyware protection, but I don't like their Real Time scanner (without which, a lot of the other stuff is useless).
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on February 02, 2009, 04:24:22 pm
Thanks for all the words of encouragment so far. I too want to get this working as I don't even really sync my iphone at this point as it is too much trouble. I just use my ipod.

Also, I'm still waiting for JRiver to answer my question on how the error handling works. I don't want to have to go back in and drop in a tone of code later. :) If someone there could take a quick look at the source and let me know, I would really appreciate it.
Title: Re: open source iPhone sync api [proposal]
Post by: Doof on February 20, 2009, 01:27:50 pm
Any reply from JRiver yet?
Title: Re: open source iPhone sync api [proposal]
Post by: JONCAT on February 20, 2009, 01:32:50 pm
Let us know if we can help in any way...

DC
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on February 22, 2009, 09:45:29 pm
So far no reply.
Title: Re: open source iPhone sync api [proposal]
Post by: leezer3 on February 25, 2009, 12:35:36 pm
Try PM'ing Matt if you haven't already :)
Possibly the best way to make sure it doesn't get missed.

-Leezer-
Title: Re: open source iPhone sync api [proposal]
Post by: Doof on March 02, 2009, 04:13:29 pm
Anything?
Title: Re: open source iPhone sync api [proposal]
Post by: Matt on March 02, 2009, 04:25:14 pm
There's not much to say about error handling.  GetLastError(...) is probably only called after an Initialize(...) failure or delete command failure.

You can also show your own custom error messages in Initialize(...) if there's some device problem.
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on March 04, 2009, 03:59:54 pm
I've tried returning a whole slew of different HRESULTS from Initialize including E_Abort. None seems to trigger GetLastError though, so maybe it isn't called at all? I do need to be able to abort loading the plugin if there is some error loading and display a message to the user though. Without access to the source that isn't somehting I can answer though...

I'm not sure what you are talking about the custom error message though. Is this something propriatary or are you simply suggesting to create a dialog box via my own code?
Title: Re: open source iPhone sync api [proposal]
Post by: Matt on March 04, 2009, 04:20:05 pm
I've tried returning a whole slew of different HRESULTS from Initialize including E_Abort. None seems to trigger GetLastError though, so maybe it isn't called at all? I do need to be able to abort loading the plugin if there is some error loading and display a message to the user though. Without access to the source that isn't somehting I can answer though...

Show the error yourself with a message box or custom dialog.  Then return anything other than S_OK.

Quote
I'm not sure what you are talking about the custom error message though. Is this something propriatary or are you simply suggesting to create a dialog box via my own code?

Even the Windows API MessageBox(...) function would be fine.
Title: Re: open source iPhone sync api [proposal]
Post by: Doof on March 13, 2009, 07:51:00 am
<nag>
   Any progress?
</nag>
Title: Re: open source iPhone sync api [proposal]
Post by: ThoBar on March 26, 2009, 08:11:26 pm
<nag>
   Any progress?
</nag>
Ditto
Title: Re: open source iPhone sync api [proposal]
Post by: benn600 on March 26, 2009, 08:35:18 pm
A lot of people like Apple because their products are a bit different, a bit simpler, arguably a bit more thought out than other products.  Who thinks that them remaining so locked up helps their business?  If only everyone could boycott them and say it's because they are so uptight about everything!  It's so great to see companies with products that have seemingly no restrictions beyond the technically impossible!  And even then, someone could make those things possible!

It really comes down to a choice: the best desktop interface OR the best portable interface.  MC/random device or iTunes/iPod.  I'm not really a big portable music guy...I listen on trips or such but it's rare.  My iPhone right now has no music or video on it.  It's because I haven't taken a few hours to output my music to mp3 and sync [sine my last wipe and restore]...it's nice to have it but I just don't really come across a need.  The two times I wanted some music recently in the past few months I just used Pandora.  I think I'm just tired of all the fighting with the iInterfaces....lost the little interest I had in portable music.  I won't deny that the spark returns from time to time--but each time I end up at least partially disappointed and driven further away from portable music.
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on March 27, 2009, 04:29:10 pm
Sorry everyone, I've been tied up for the last month and haven't been able to do anything. I should have some more time again in about 2 weeks. It shouldn't take to long to knock of a pretty big chuck of functionality then. I'll let everyone know as so as I can start again.
Title: Re: open source iPhone sync api [proposal]
Post by: ThoBar on March 27, 2009, 08:56:46 pm
Cool, thanks for the update... I think there's a few people here waiting with bated breath.
Title: Re: open source iPhone sync api [proposal]
Post by: Doof on March 28, 2009, 10:58:54 am
Cool, thanks for the update... I think there's a few people here waiting with bated breath.

To say the least. ;)
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on March 28, 2009, 06:29:41 pm
Ya I know.  ;D I haven't forgoten about you or the plug in. I will get back to it shortly. Hang tight....
Title: Re: open source iPhone sync api [proposal]
Post by: hit_ny on April 11, 2009, 02:13:33 pm
Who thinks that them remaining so locked up helps their business?  If only everyone could boycott them and say it's because they are so uptight about everything!  It's so great to see companies with products that have seemingly no restrictions beyond the technically impossible!  And even then, someone could make those things possible!

Did you read gvanbrunt's post here (http://yabb.jriver.com/interact/index.php?topic=49076.msg337536#msg337536) ?

Of course the part that is less clear is why all of a sudden. The iTunes shop has been running for a very long time now and previous generations are not so encumbered.
Title: Re: open source iPhone sync api [proposal]
Post by: Doof on April 21, 2009, 09:48:17 am
(http://www.monadnockdivers.org/images/cricket.gif)
Title: Re: open source iPhone sync api [proposal]
Post by: JONCAT on April 21, 2009, 09:51:14 am
Haven't had new music on my iPhone i months, too lazy to deal with iTunes and hybrid workaround (and too busy)  ;D

Hope all is well; we'll get there!

DC
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on April 23, 2009, 04:31:14 pm
Good news is, I'll probably be finished all the stuff that was occupying my time by the end of this weekend. So I hope to get back to the plug in next week.
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on May 10, 2009, 10:00:18 pm
Good news. I got to work on the plug in again. I now having it reading the files and properties off the ipod. Still a long way to go but one chunk is now working. I'll keep at it this week.
Title: Re: open source iPhone sync api [proposal]
Post by: JONCAT on May 11, 2009, 01:52:19 pm
Awesome! Keep up the great work.

DC
Title: Re: open source iPhone sync api [proposal]
Post by: krdavies on June 01, 2009, 10:45:25 am
Would I be being cheeky to ask how you're doing the the development? I use Media Center solely as an iPod interface and there is an element now and again of asking myself why I'm avoiding iTunes so relentlessly. Smartlists would be trickier to set up but I wouldn't have to think about whether the next iPod/iPhone I buy will work with my preferred software.
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on June 02, 2009, 07:58:00 pm
You're not being cheeky at all... sometimes I need a kick to notice I've been lax in letting everyone know what is going on. :) If you haven't heard from me in a while, by all means give me a nudge.

So here is where we are at. I've got the plug in reading all the properties (that I know of) that the regular iPod plug in does. However it is a little slow, so I decided to look into all the other possibilities out there. They are using the iTunes dll that communicates with an iPhone directly, a native app on a jailbroken iPhone to do the dirty work, and using  SSH via wireless to directly read the db, among the real possibilities. All have various shortcomings, and none is 100% reliable. So I've decided to proceed using the iTunes API which should always work. Then after that is working we can look at other possibilities.

So how slow is it? To read in 12000 tracks from my 80GB iPod takes about 30 seconds. I don't think this is computer dependant, but rather iPod dependant so I don't think this will change much on slower computers. Not that that is unreasonable, just that I was hoping for better. It shouldn't matter much during file transfers though as most of the overhead is actually moving the file, and I think that will be about as fast as it is in iTunes.

Next up is to actually move and delete files (if needed) to see how well that works. This should not take me long, hopefully I will be done on the weekend.  Next I need J River to do their end and do the programming to detect the iPhone (which I think is already in there) and to load my plug in if installed.
Title: Re: open source iPhone sync api [proposal]
Post by: JONCAT on June 02, 2009, 08:00:47 pm
Sounds like real progress, I'm impressed. 30 seconds for 12K......hell that ain't shabby at all! When this plug-in becomes a reality, I will be very very pleased.

hats off,
DC
Title: Re: open source iPhone sync api [proposal]
Post by: zxsix on June 02, 2009, 09:10:16 pm
Now that version 14 are out, are you going to direct your efforts to that version?
I was planning on upgrading within the next couple of builds when I get back home from a work trip out of town.
Title: Re: open source iPhone sync api [proposal]
Post by: glynor on June 09, 2009, 12:49:16 pm
Wow.  I'm SUPER excited about this.
Title: Re: open source iPhone sync api [proposal]
Post by: JONCAT on June 09, 2009, 12:54:40 pm
Me too.

 Everyone now, join hands....and pray.



Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on June 18, 2009, 08:11:14 pm
Here is an update for everyone.

First to reply to a couple of threads...

30 seconds for 12k isn't too great when you compare that speed to JR's ipod implementation... that takes seconds... :) Still not too bad.

As for MediaCenter 14, I'm going to concentrate on 13, but it should work in either unless JR is planning on changing the interface, but I doubt they will. I was actually working with it on 12 that I had as a side by side installation. More on the 12 thing below.

So what have I been up to? Well last I posted I said I would probably get a basic working implementation going by the weekend. I was just getting around to it when I noticed my soundcard was crackling like it used to during the early days of Vista (Creative Labs anyone?) Anyhow, I thought I had better quickly update my driver. Quick was not exactly how it worked out. :) During the install it BlueScreened and after that my OS was pooched. Weirdest thing I ever saw and I do this for a living. As soon as I tried to use DirectSound the driver would crash. Along with it would take down other soundcard related services like... Parental Controls? Are you kidding me? That takes out the entire network when it's down. Needless to say, after 3 hours, I decided to rebuild from scratch.

So I have been working with Windows 7 to some degree at work and from that experience and the other info on the net I decided to slap the RC on due to its stability. It has been rock solid and fast so far... Anyway I spent a couple of days of re-installing a pile of development software and transferring files over to a new drive the Win 7 is on. Then I deleted a pile of software on the old drive to make room and I was ready to go. I complied my first build and tried to run a debug session in MC12. I had that installed side by side with 13 so I could develop on one and use the other. Anyway, it didn't load the plug in. Nothing in DebugView, etc. I thought my Visual Studio settings were messed up during the transfer so I played around with them. No luck. I copied the last build I had from Vista to the new MC12 directory. No luck there. Was this in Win 7 issue?

Luckily I still had my screwed up install of Vista so I booted into that and MC12 loaded the plug in no problem. So I moved a copy of the new build over. It worked as well. So maybe this is a Windows 7 issue? I tried the plug-in in 13 on Win 7, and low and behold it works. Weird. MC12 will work with JR’s iPod plug in but not mine, and everything else works normally. Yet mine works in Vista MC12, Vista MC13 and Win 7 MC13. Considering that MC12 is a fresh install, I really can’t explain why it didn’t work.
During all this I had two major Phone System outages at work (I’m responsible for the VoIP systems there) so that took what was left of my free time.
Now the good news. I finally got to working on it again and have been doing some experimenting with correlating files between MC and ITunes. This weekend I will probably have a basic version working. I promise not to try to re install my sound card...
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on June 24, 2009, 08:53:05 pm
IT'S ALIVE!

I was able to dump @12000 tracks to my 80GB ipod. There are still a ton of things to do, so don't get too excited. Most importantly JRiver has to do their part to get iphone detection part done. In the mean time I'm going to make it read in a file that will contain the "PersistantID" of my iphone. I can then attach both the iPod and the iphone. MC will detect the iPod and load my custom dll and then it will in turn actually update the iPhone. There is still a lot to do. A short list is:

- handle more library fields.
- handle cover art
- handle conversions
- handle more of the options from the handheld dialog

At any rate I'm sure some of you will be happy to see some progress... :)
Title: Re: open source iPhone sync api [proposal]
Post by: bwaldron on June 25, 2009, 01:24:33 pm
At any rate I'm sure some of you will be happy to see some progress... :)

Definitely!  :)
Title: Re: open source iPhone sync api [proposal]
Post by: neFAST on June 25, 2009, 03:28:51 pm
Great news!
Title: Re: open source iPhone sync api [proposal]
Post by: lOth on June 26, 2009, 09:50:04 pm
Quote
don't get too excited

too late...
Title: Re: open source iPhone sync api [proposal]
Post by: neovibe on June 27, 2009, 02:28:06 pm
Just want to show my support for this project as MC is the only way I can manage a library of flac+cue and I should be getting an iphone 3GS.

Is there any intended features list for this?
And just a couple of questions, probably too soon for these but I can't resist:
 - how will it handle flac+cue (converts to track by track mp3 album? where to? keeps it in a separate library?)
 - how will it handle mp3+cue (cuts losslessly in mp3 tracks or re-compresses as it cuts?)

just my curiosity and excitement with this project, keep it up.
And thank you!
Title: Re: open source iPhone sync api [proposal]
Post by: dcpoppy on June 27, 2009, 04:30:41 pm
I also would like to express my interest and excitement - thanks and keep up the good work!
Title: Re: open source iPhone sync api [proposal]
Post by: ThoBar on July 15, 2009, 01:58:15 am
Any more good news?
Title: Re: open source iPhone sync api [proposal]
Post by: Doof on August 06, 2009, 05:21:01 pm
Any update on this? Is this still an active project?
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on August 10, 2009, 06:01:15 pm
Hi All,

I'm sure many of you are have been wondering what happend to me. I've been busy with other projects, but I haven't stopped with this one either. I've run into a bit of a roadblock that slowed me down for sure. The problem is MC doesn't seem to be able to "match" file and tries to resync all of them. I've played around with all kinds of combinations so I'm not really sure what I'm doing wrong. I think I'm going to need someone at JRiver (You there Matt??) to give me the code (or sudo-code) that MC uses to match files.

Thanks for everyone patience.
Title: Re: open source iPhone sync api [proposal]
Post by: Matt on August 10, 2009, 08:16:11 pm
Hi All,

I'm sure many of you are have been wondering what happend to me. I've been busy with other projects, but I haven't stopped with this one either. I've run into a bit of a roadblock that slowed me down for sure. The problem is MC doesn't seem to be able to "match" file and tries to resync all of them. I've played around with all kinds of combinations so I'm not really sure what I'm doing wrong. I think I'm going to need someone at JRiver (You there Matt??) to give me the code (or sudo-code) that MC uses to match files.

Thanks for everyone patience.

I think you just need to be sure to fill in the artist, album, name, track #, genre, and composer when you give the files back to Media Center from the device.  That way, it will be able to match them with the files in the sync.
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on August 11, 2009, 07:56:08 am
That may be it. Composer isn't a property of MJFileAutomation so I guess I just set it Via the Set function? I did the same thing for Date Modified as it is needed for one of the options settings.
Title: Re: open source iPhone sync api [proposal]
Post by: echamp1 on August 12, 2009, 02:53:52 am
gvanbrunt, do you think there is a chance that we might see a preview build of this tool of yours?  I'm eagerly anticipating your release... I have a feeling it will finally allow me to sync all of my music over to my iPod Touch by transcoding them into reasonably sized files.  All the current tools available only do half the job, yours might be the end all solution we've been waiting for!  Good luck getting it done, you have my support!
Title: Re: open source iPhone sync api [proposal]
Post by: lOth on August 12, 2009, 10:53:34 am
gvanbrunt, I have this feeling a number of people would be willing to pay you to prioritize this project ;) Getting rid of iTunes is actually priceless...
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on August 12, 2009, 09:12:04 pm
Geez, getting paid would make me feel too much like Steve Jobs... :) Seriously though; my day job has been eating up a lot of time lately. Summer also cuts into things. I wish I had more time to devote to this.

Tell you what though; I will release something as soon as I get the sync problem worked out. Keep in mind, it will only work for those that have both an iPod and & iPhone. The detection part happens in MC not the plug in, so I have to let it call the plug in when it detects an iPod, but actually load to the iPhone. JRiver will have to do their part and call the plug in when an iPhone is detected before only an iPhone is needed.

I’ll try to get it out in the next two weeks.
Title: Re: open source iPhone sync api [proposal]
Post by: lOth on August 15, 2009, 08:37:26 am
Quote
I will release something as soon as I get the sync problem worked out

Yay!

Quote
it will only work for those that have both an iPod and & iPhone

Uho.  :'(

Just for the first sync or every single time?

And I assume an iPod Touch won't do.
Title: Re: open source iPhone sync api [proposal]
Post by: Doof on August 15, 2009, 09:33:54 pm
Just for the first sync or every single time?

And I assume an iPod Touch won't do.

I'm assuming the problem is that MC won't detect the iPhone or the iTouch as a portable device and so his plugin never gets invoked. Plugging in a MC supported iPod model does trigger the plugin, though and that's why it's needed.
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on August 15, 2009, 10:00:16 pm
Yes exactly. Matt has stated that JR will eventually provide the detection, but currently it does not.
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on August 27, 2009, 10:21:43 pm
Just a quick update for everyone. I've gotten the code much more smoothed out and only have one major issue left due to a bug in the iTunes sdk. At this point I can sync files to an iPod as long as they don't require conversion. It's real basic and doesn't even do playlists yet but that isn't a big deal.

I'm going on vacation and I may have time to finish things ups to get something out. That may prompt JRiver to get their end done. A lot has gone into this up to this point so adding playlists, and other support should hopefully come out faster. Up till now a lot has been figuring out the best way to do things.

Hopefully I'll get this out soon.
Title: Re: open source iPhone sync api [proposal]
Post by: echamp1 on October 09, 2009, 02:07:22 pm
We haven't heard on this front in quite some time.  How is the project coming along?  Any chance of a beta test version to be released?
Title: Re: open source iPhone sync api [proposal]
Post by: ThoBar on November 08, 2009, 07:08:00 pm
I'm guessing this is now dead-in-the-water?  :'(
Title: Re: open source iPhone sync api [proposal]
Post by: gvanbrunt on November 08, 2009, 08:16:10 pm
Sorry for not getting back to everyone in some time. Not dead in the water, but derailed a bit. I've had a lot of personal and work things pile up and had to be attended to. I will get back to this as soon as I get a chance.
Title: Re: open source iPhone sync api [proposal]
Post by: neovibe on November 19, 2009, 06:22:41 am
Hi everyone.

I know the people pushing this forward are not paid for developing this and time is precious these days, but still need to ask if there has been any progress or if we can expect the most basic functionality anytime soon.

I reckon this is the "most-wished-ever" plugin for MC...

thanks all for your effort.

PS: getting my iphone soon, installed itunes and discovered why MC is the only way to go: found out you need to manually re-add you music folder to the library to update for any changes... (ok, so everyone already knew but didn't...). Pathetic....
Title: Re: open source iPhone sync api [proposal]
Post by: zxsix on November 19, 2009, 09:23:59 am
neovibe: in the meantime, check out prod's MC to itunes sync utility.
not as seamless as this plugin may one day be, but it works today and it's really not much of a hassle once it's set up.
Title: Re: open source iPhone sync api [proposal]
Post by: neovibe on November 19, 2009, 10:07:29 am
neovibe: in the meantime, check out prod's MC to itunes sync utility.
not as seamless as this plugin may one day be, but it works today and it's really not much of a hassle once it's set up.

That can very well be all I need from a quick look I took. Only thing I need to get around that doesn't seem to be supported is the situation of cue files... thank you