Help - Search - Members - Calendar
Full Version: foo_pod - Foobar2000 meets the iPod
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42
Aero
*** October 3, 2006: The latest version is 0.9.9o - read about it in this post***

If you are new to foo_pod, skip to the end of the forum for the latest development and discussion, as foo_pod has advanced quite a bit from this initial post... smile.gif


http://www.tinkafoo.com/log/foo_pod.html is an excellent source of information about foo_pod, and might save you 8+ hours reading this forum trying to find the answer to a commonly asked foo_pod question.








foo_pod.zip

Here is my initial release of a Foobar 0.8 component to interface with an Apple iPod. The current version (0.1) only supports read access to an iPod - namely, reading the iPod database file and building a Foobar playlist containing all of the songs contained on the iPod.

Is this useful? Maybe... wink.gif

By building a playlist of all of the songs, you could take your iPod to a friend's computer and play the music and copy songs off of the iPod (by dragging the song from the playlist to a directory or the Desktop), without any additional software. This component might also be useful for people with home theater PCs - leave the iPod dock on the HTPC, sync up on your main computer, and playback directly from the iPod on the HTPC.

To use foo_pod, make sure your iPod is connected to your computer and is visible as a drive in My Computer (very important), and select Components/foo_pod/Load iPod to foo_pod Playlist. There are a few preference settings, but unless the automatic detection doesn't work, you probably won't need to change anything.

Anyway, let me know how this works out on different computers/iPods, and what features people would like to see. I would like to get Foobar->iPod writing working, but I'm pretty happy with EphPod, so we'll see what happens with that. Eventually, I would like to do something like Anapod. I actually have written a component that handles HTTP access/streaming and is more functional than Anapod, but I never updated it from Foobar 0.6...


Special thanks go to Otto42 and his excellent iPod classes. foo_pod relies heavily on Otto42's code, with some minor modifications (Otto42 - remind me to send some diffs). Also, on another thread, Scream mentioned that there is source code available for the Winamp5 plugin. I haven't tried that plugin yet, but I wouldn't mind taking a look at the source, especially for supporting write access (the posted link appears to be dead).
Otto42
Coolness! biggrin.gif

Aero, I tried to download the modified iPodDB classes you sent me via email, but the link didn't work. If I could get ahold of the modified classes you've made, I could work in some other changes. In particular, I've modified the iPodDB classes to include support for the BPM field, and better support for the mhod types. I've also got a small start going on write support.

And frankly, I'd love to get rid of the hard coded limits on song numbers and such, and if you'd done that, it'd be awesome. smile.gif
Mike Giacomelli
Any chance you could figure out how the Ipod's soundcheck feature works and allow foobar to write replaygain info in sound check form?

Edit: Wow this will be really handy for backing up my Ipod before i tinker with it smile.gif
Sid59
a great step forward in bridging the iPod and foobar2000.

I can really get excited when foo_tunes / foo_pod work seemlessly to provide a similar experience to iTunes.

right now, i alternate between iTunes and foobar to play the music i want to hear. i only use iTunes when i want to configure a playlist or bump up the ratings of some songs and such.

Good JOB!
Otto42
QUOTE (Mike Giacomelli @ Feb 29 2004, 12:26 PM)
Any chance you could figure out how the Ipod's soundcheck feature works and allow foobar to write replaygain info in sound check form?

Yeah, probably. I'm 95% sure that it's one of the fields in the iTunesDB. Probably one of the "unknowns" I have in there already. Then again, maybe not. In any case, I'll check it out after I get the writing capability working. With Aero's changes, it's going to be slightly easier for me to get the write stuff into the classes. I've already got his changes and mine integrated, now I'm just finishing off the write code that I started a couple weeks ago and never got back around to. I should have it working, at least partially, in a day or two.

The thing about adding write capability is that there's a *ton* of fields in the iPod that I just don't know what they mean. When I wrote all the read stuff, I simply left out a lot of those. But now trying to write them out, I don't know if I can set them to nulls or not. So I'm having to go back into the parsing code and add a lot of unknown entries just so that I can write them back out to the resulting file. It's a bit annoying, but it'll make for a lot of capability, even if you don't know what 50% of that capability actually does. smile.gif

Anyway, once I have all the fields actually being read, then it should be a simple matter of looking at what iTunes says is the "gain" on the track and finding which field in the iTunesDB corresponds to that. Then one could just write the correct entry into the newly found "gain" field and voila, sound check works. Neat, huh? biggrin.gif
ronyzyz1
Excellent excellent excellent! I am extremely happy to see this project take off.

One feature that I've been looking for in other iPod interfaces is the simple ability to sync my iPod with a directory - I wanted all of this database stuff to happen behind the scenes, so I could just synchronize quickly with my Music folder (which is updated regularly with new CDs I purchase) and be on my way.

Perhaps this brings me a step closer to such a program. I can't wait to see what you come up with! I'm tired of iTunes slowness.
Xecter
Wow.

Great Job!!!


Itunes Sound Check:
iTunes creates an entry the comments field. It has some weird character header followed a set of numbers which i guess adjusts the volume on the ipod.

I personally couldn't have written a ipod plugin, so props to you on that. But with enough work we can easily surpass Ephpod and eventually Itunes.

Some new features such as:
  • Sync'ing/Loading/Unloading of Mp3s on the Ipod; Sync with either a Master Playlist or directory/folder (ya duh =/)
  • Update iPod information: Ie Update last played, play count, rating, etc, with more database options in Foobar
  • Reverse-Engineer the iTunes smartplaylist feature. (if you do,you might want to add it to foobar as well)
Personally, as i have said in many other threads, Foobar needs a full database like other database mp3 software (iTunes, Media Center 9/10) before a iPod plugin can be made that rivals iTunes. But if want an Ephpod killer, you're nearly there. I would rather see foo_pod go all the way and kill the need of iTunes on my PC. Thanks, and good luck with more of this plugin development. If you need someone to help test it out. I have a 20gb 3rd gen that i can work with.

~Xecter.
Otto42
Got writing fully implemented. It's still untested though, so it's probably broken somewhere. Still needs some work in other words. At the moment, I'm trying to get it such that reading and then immediately writing the iTunesDB (going through my code of course) will produce a 100% identical file. Then I know it's working properly and everything is being parsed and recreated correctly. smile.gif

And man, I looked and looked for where the gain for the soundcheck might be being stored, and I am at a total loss. It's just confusing as hell in there. Anybody know how Mac's tend to store floating point values? That might help. I know that the songs in iTunes show a value of "-4.3 dB" and similar for the "volume" when I do a Get Info, but I don't understand audio enough to understand what, exactly, that means. Somehow, iTunes has to tell the iPod how much to raise the volume for Sound Check mode. But I don't know what kind of data it would pass across to let it do that.

Furthermore, it may not be in the iTunesDB. I know for an absolute fact that when iTunes does its volume scan on an M4A/AAC file, it adds a tag to the file that seems to have something to do with the volume. Perhaps the sound check data is in the files themselves, and the iPod then uses that accordingly. If so, then it's a matter of changing the file tags appropriately. I don't know if it adds anything like that to MP3's though, I haven't checked.

Edit: Ahh.. okay, if it is in the file comment tag then it's something that will have to be added to whatever foobar plugin handles the tagging of the files themselves. Of course, that means figuring out the format of itunes weird tag.
Xecter
Otto42:

my music collection on my ipod is both mp3 and AAC.

Add a new un-soundchecked mp3 to iTunes, let it scan, then load it up in Foobar. Get Info in foobar.

For example, my new Korn CD has these things in the comment field.

CODE
iTunNORM:  000028A5 0000273A 0000730F 000069AD 000186CE 0001119E 00008000 00008000 00002710 00002710


I assume this is the soundcheck data. A way is needed to create these fields via replaygain values.

I think the reason it writes it in the comments field is because when you add new fields to ID3v2 tags it has to rewrite the file and i guess the programmers of itunes found a way around it by just writing it in the comments field.

Now, AAC files on the other hand have a fields called "ITUNNORM" followed by soundcheck stuff.

Looks something like this in foobar
CODE
%ITUNNORM% =  000002B9 0000027C 00002278 000019E0 000194BF 00018F16 00006E3D 00006E3E 00018870 00018F16



I have no idea what these numbers mean. But i know where to find them. =P
Otto42
QUOTE (Xecter @ Feb 29 2004, 04:34 PM)
Add a new un-soundchecked mp3 to iTunes, let it scan, then load it up in Foobar. Get Info in foobar.

For example, my new Korn CD has these things in the comment field.

CODE
iTunNORM:  000028A5 0000273A 0000730F 000069AD 000186CE 0001119E 00008000 00008000 00002710 00002710

Okay.. That's really weird. I checked loads of my files and couldn't find that in there. So I removed one of them from the library then added it back to the library. Voila, it added that field. But the problem with that is that the file already had a COMM field in the ID3v2. Now it has 2 of them, the previous one and a new one immediately following that one. Freakin' odd, that is.
Mike Giacomelli
I don't think the Ipod knows what a file tag is. From what i gather its all handled by iTunes. WHich makes sense since the Ipod needs to load as quickly as possible while using as little of its meager processor and battery as possible. I'd guess that those tags are just for compatability with other iTunes clients and as a backup incase the user formats or otherwise loses itunes's db.

About the numbers themselves, perhaps the gain values are stored as integers? That would make sense since I think the ipod's processor is int only.
Otto42
QUOTE (Mike Giacomelli @ Feb 29 2004, 05:58 PM)
I don't think the Ipod knows what a file tag is.  From what i gather its all handled by iTunes.  WHich makes sense since the Ipod needs to load as quickly as possible while using as little of its meager processor and battery as possible.  I'd guess that those tags are just for compatability with other iTunes clients and as a backup incase the user formats or otherwise loses itunes's db.

About the numbers themselves, perhaps the gain values are stored as integers?  That would make sense since I think the ipod's processor is int only.

Got me man. It's quite possible it's in the iTunesDB file. There's still a heck of a lot of unknown's in the MHIT records. Could easily be one of them.



In any case, I'm done with the writing portion of the classes. They work. I've gotten them to the point where I can feed an iTunes created iTunesDB file from my own iPod, parse it, regenerate it from the structures in memory, and write it back out to a file, and have absolutely no differences in the resulting file from the original. Which tells me that it's correctly generating the file, more or less. Obviously, if you change the structures incorrectly, you get incorrect results, but that's not the classes fault. smile.gif

Here's the new classes: http://otto.homedns.org:8888/iTunes/iPodDB.zip

I also included the test program. It's pretty self explanatory. Feed it an iTunesDB, get back an iTunesDB.new. If iTunes originally made the thing, then the resulting iTunesDB.new should be identical, minus your changes to the objects in memory.

Also added is a whole lot of new fields, including everything in the file that didn't look like it was just null padding. Have fun. biggrin.gif
Xecter
Im pretty sure Mike is right here. Everything on the ipod is handled via the Database. And im sure it writes to the file because sometimes things crash and burn. So its there. It doesn't really matter.


So we found the SoundCheck thing on the actual files. Thats a start, gives Otto here something to tinker with. =P

Also the iPod is int only (thats why we'll never see APE support on it, or any of those fancy codecs), but that doesn't mean the SoundCheck has to be. iTunes does all the scanning and voluming changing before hand, and simply writes a volume delta to the database.....which leads me to the next point....

Otto did u find where the database has the soundcheck stuff?
Otto42
QUOTE (Xecter @ Feb 29 2004, 08:17 PM)
Otto did u find where the database has the soundcheck stuff?

There's 16 unknown fields in the MHIT right now (The MHIT is what describes a "song" to the iPod). And it could only be part of those fields. And I don't know the exact format of what I'm looking for. And I don't know what value it would be even if I knew the format it was in.

So, gimme some time. smile.gif

Edit: The field in the MHIT designated "unk3" in my iPodDB classes seems to correspond to the first 4 bytes in that iTunNORM comment that is added to the song's tags.

Example:
The file I tested got this comment added to it:
iTunNORM 000016A2 000015EB 00006656 0000719A 0001D4D7 0001D4D7 00008000 00008000 00004E20 00004E20

The unk3 field in the iTunesDB for that particular song's MHIT entry has "00 00 16 A2" in it, after the bytes are reversed (everything in the file gets byte reversed like this, it's not unusual).

So if you can tell me how 000016A2 corresponds to that file's Get Info volume of -7.6dB, then we're getting somewhere.

Edit2: Confirmed! Did the same thing with another file.
iTunNORM 00000BF7 00000BD8 00002080 000024DA 00015FBE 00015FBE 000078E9 00007A33 000222E0 000222E0

Synched with the iPod. unk3 now contains "00 00 0B F7" after byte reversal. Get Info shows a -4.9dB Volume on this one.

None of the other stuff in that iTunNORM can seemingly be found anywhere in the file where it would make any sense. So if that iTunNORM is related to the Sound Check, it seems as if only the first four bytes are necessary. Maybe that's the amount that it pumps up the volume in some way? I could try setting unk3 really high for a song and seeing if the iPod plays it back super loud... Still, that only tells us what to change, not how much to change it.
Mike Giacomelli
Great work. I'll also start looking through the db, but I think you're about a million times more likely to understand this then me smile.gif
Otto42
That is definitely it. When I changed that particular unk3 field from 0x0BF7 to 0x7BF7, the song got a *lot* quieter when the sound check was on. I'm going to play around with it and see what I can find, but that's definitely where the trick is.

I'll probably rename unk3 to something else once it's worked out what the field represents. I can't think of why it would get quieter as the value gets larger. And I tried to avoid going above 0x8000 thinking it might be a signed value. I'll mess around with it some more.

Still, if anybody knows ReplayGain really well, it would help if you could drop in your input on how much volume equates to what sort of change.. We're going to need some way of calibrating this to determine how much to change it for what gain value needs to be applied. I don't grasp audio and gain well enough to really know what the hell I'm doing here. biggrin.gif
rufu
Good work so far!

I know you've already found the soundcheck info in iTunesDB, but I'll post this anyway.

http://www.ringom.no/espen/ipod/

This guy has come up with a untility for adjusting these fields.

Hope this is of some help.
Otto42
QUOTE (rufu @ Mar 1 2004, 01:24 AM)
Good work so far!

I know you've already found the soundcheck info in iTunesDB, but I'll post this anyway. 

http://www.ringom.no/espen/ipod/

This guy has come up with a untility for adjusting these fields.

Hope this is of some help.

Actually, I've seen that utility before. He's not adjusting the Sound Check field. He's adjusting the Volume Adjustment field. Kinda hard to explain the difference, but here goes.

The Sound Check field, or "unk3" as it's labeled in my code at the moment, is set by iTunes as part of the volume scan. The purpose of this field is to sorta normalize the volume across multiple songs somehow. You can't adjust this field yourself within iTunes. If you turn Sound Check on and off, you'll hear the effect that this field has turn on and off.

The Volume Adjustment field you *can* adjust from within iTunes. If you do a Get Info on any song, there's a slider where you can manually adjust the volume of a song, on a per song basis. Basically you can add 10%, 20%, that sort of thing. Anyway, this volume change is applied whether Sound Check is turned on or not. The purpose is to boost the volume above normal volume manually. This field is labeled "volume" in my code at the moment.

Two separate fields. One is activated by sound check and has some weird scale that I haven't worked out yet. The other is global and always on and has a scale from -100 to 100 or something like that.

Obviously, we'd like to use the right field for the right purpose. smile.gif
ronyzyz1
Here's another feature request:

My music collection has APEv2 and ID3v1 tags, but the iPod only understands ID3v1. However, it seems that when foo_pod reads from the iPod, the APEv2 tags are no longer either there or recognized.

Does iTunes really remove APE tags when copying files to the iPod? If so, it is possible to support keeping these tags when using foo_pod to write files to the iPod (in the near future, hopefully).

Thanks for a great component!
kode54
iPod/iTunes supports ID3v2, and apparently also supports UTF-16 encoded text.
Xecter
iTunes reads my ID3v2 tags perfectly fine.

Personally, the main reason i want a Database/iPod plugin for Foobar so i can finally use my player with APEv2 tags rather than crappy id3v2.

Otto:
Nice to hear that you have made some progress.

I will be watching this development very closely, and try to help as much as possible.

Keep up the good work Otto!
ronyzyz1
I meant out of ID3v1 and APEv2 (the two formats I use), iPod only reads ID3v1
kode54
Yes, I know.

I thought the iPod handled all metadata through its internal database, so which tags are on the files should not matter, unless you're going to erase your local copies and import everything back from the player at a later time.
danZ
QUOTE (DocUK @ Mar 1 2004, 11:32 AM)
I meant out of ID3v1 and APEv2 (the two formats I use), iPod only reads ID3v1

I don't think the iPod using any tags and relies on its database for this information. When I first got my iPod I noticed that I got different results with different applications (XPlay, ephPod, iTunes) so I think it is up to the PC (mac) side application to do whatever it wants as long as it builds a valid iPod database to put on the device.

I would think the foo_pod will fill in the database by asking foobar for particular meta_data and won't care where the data originated (id3v1,v2,etc.)

Correct me if I'm wrong, Aero.

My questions about foo_pod are how you plan to handle syncing the iPod once write is added to the code base.

Will it be realtime as you add/remove songs to the foo_pod playlist, on demand by a context menu or main menu choice, or something else. Is on the fly possible or does the database have to be entirely rebuilt for every change and then entirely copied to the iPod?

Anyway, if I can get songs on/off my iPod without all the other applications I'll be more then happy.

Thanks for the efforts so far.
Otto42
The iPod doesn't understand any tags whatsoever. Not ID3, not APE, nothing. All of the data the iPod knows is contained within the iTunesDB file.

iTunes and other programs build that iTunesDB file by using ID3 or what have you tags. So, if foobar understands APE tags, and if foobar is building the iTunesDB... QED. You can build the iTunesDB using any info you want from any source you want. That's what the iPodDB classes I wrote do. They let you read an iTunesDB into memory, modify it, write it back out. Or, in theory, you could build the class/object structure in memory from scratch and then write that out as a valid iTunesDB file. I'm working on a way to make that *much* simpler to do, as right now building a DB from scratch is a PITA.

Addition: iTunes doesn't modify the songs before copying them to the iPod. It may modify them when you add them to the iTunes library itself or when you change the tags using iTunes, but the process of synching the iPod just copies the files over in their current state. It's the iTunesDB that controls the rest.
ronyzyz1
QUOTE (Otto42 @ Mar 1 2004, 09:13 PM)
Addition: iTunes doesn't modify the songs before copying them to the iPod. It may modify them when you add them to the iTunes library itself or when you change the tags using iTunes, but the process of synching the iPod just copies the files over in their current state. It's the iTunesDB that controls the rest.

This does not make sense. I have an MP3 file tagged with APEv2 and ID3v1. I then transfer it to the iPod using iTunes - I did not enter any tag editing facility in iTunes or anything. When I double click on the file on the iPod disk drive (Not using foo_pod), it now only has the ID3v1 tag intact.
Aero
QUOTE (DocUK @ Mar 1 2004, 04:07 PM)
QUOTE (Otto42 @ Mar 1 2004, 09:13 PM)
Addition: iTunes doesn't modify the songs before copying them to the iPod. It may modify them when you add them to the iTunes library itself or when you change the tags using iTunes, but the process of synching the iPod just copies the files over in their current state. It's the iTunesDB that controls the rest.

This does not make sense. I have an MP3 file tagged with APEv2 and ID3v1. I then transfer it to the iPod using iTunes - I did not enter any tag editing facility in iTunes or anything. When I double click on the file on the iPod disk drive (Not using foo_pod), it now only has the ID3v1 tag intact.

iTunes might strip off the APEv2 tags that it can't handle, but that doesn't really affect foo_pod or anything else (other than a good reason not to use iTunes...).

I think the point that Otto42 and others are trying to make is that the iPod itself does not read tags (of any format) - the only metadata that the iPod knows about is what is in iTunesDB. It is the responsibility of the transfer program to build this database file, so it reads in whatever metadata that it understands from the audio files. Since foo_pod is built on top of Foobar, it will be able to handle any metadata format that Foobar can read. And it definitely will not modify the songs!
Xecter
This just occured to me just as i was reading about the tag handling...


I listen to alot of electronica and i have many albums that are compliations mixed by a single DJ. This makes it kinda hard to browse my ipod. If we could make custom iTunesDB, could we also make it so that the ipod browses via custom metafields?


Example:
Artist: Chicane
Title : Don't Give Up
Track: 1 of 20
Disc: 1 of 2
Album: Ministry of Sound: Trance Nation 3
Mixed by Ferry Corsten

etc.

If i load this on the Ipod, the track lists under Artist Chicane, and the album, Ministry of Sound... then Track 1, Don't give up.

I think it would be much easier for me if i could browse like this:
CD_Artist: Ferry Corsten -> Album: Ministry of Trance 3 -> Disc 1 -> Track 1, then on the now playing screen you would be a nice filled data:

Don't Give Up
Chicane
Ministry of Sound Trance Nation 3
<<bar>>

instead of the bloated set i have now....

Chicane - Don't Give Up
Ferry Corsten
Ministry of Sound ....
<< BAR >>


Just an idea. Im not sure how creative you can get in the database.
Aero
QUOTE (Xecter @ Mar 1 2004, 05:10 PM)
I listen to alot of electronica and i have many albums that are compliations mixed by a single DJ. This makes it kinda hard to browse my ipod. If we could make custom iTunesDB, could we also make it so that the ipod browses via custom metafields?

One thing that I plan on adding to foo_pod is support for scripting (probably Lua).

So you could likely script what you are looking to do. For example, in your script, if the song is in Playlist "Electronica", then build the artist metadata from these fields.

Something like:

if pod_GetPlaylist() == "Electronica" then
pod_SetTitleFormat("%artist% - %title%")
pod_SetArtistFormat("%comment%")
pod_SetAlbumFormat("%album%")
end


I'm not sure if I'm understanding exactly how you want your data formatted, and this is just an example, but hopefully you see what I'm getting at.
Xecter
Ya something like that.

I was just wondering, since everything is controlled via database, we could just relabel everything that the ipod displays.


So, instead of browsing the normal ipod way

Artist -> Album -> Track

we could do something like

CD Aritst / Artist - > Album -> Tracks


ALSO! We can finally organize the bloody lists alphabetically, not by tracknumber!
Aero
QUOTE (Xecter @ Mar 1 2004, 05:48 PM)
I was just wondering, since everything is controlled via database, we could just relabel everything that the ipod displays.


So, instead of browsing the normal ipod way

Artist -> Album -> Track

we could do something like

CD Aritst / Artist - > Album -> Tracks

Well, you can't change the basic labels that the iPod displays, but if you mean Browse->Artists, then display the "artists" as CD Artist / Artists, then yes, that should be easy to do. All the iPod is doing is going through its list of songs and building an unique list of "artists". Since we can send whatever string we want for the "artist" (or "album", "title", "genre", "composer", etc.), it will be possible to format the data as you want - not just as how it is in the file.


QUOTE
ALSO! We can finally organize the bloody lists alphabetically, not by tracknumber!

I'm not sure how the iPod internally sorts the songs, but if it does order them based on tracknumber and since the tracknumber is just another bit of data that we can control, it will be possible to make fake tracknumbers so that the songs end up sorted alphabetically.

foo_pod with scripting is definitely going to be a power user/control freak's interface, while most of the other programs I have seen (iTunes, Anapod, XPlay, and to a lesser extent, Ephpod) try to make the transfer process as simple and non-customizable as possible.
ronyzyz1
Man this will be so sweet.

I'm going to change the title formatting to %tracknumber%. %title%. It will be schweet.

Aero, stop wasting your time posting here and spooning danZ, and get to work on this component stat! laugh.gif
Otto42
QUOTE (DocUK @ Mar 1 2004, 02:07 PM)
QUOTE (Otto42 @ Mar 1 2004, 09:13 PM)
Addition: iTunes doesn't modify the songs before copying them to the iPod. It may modify them when you add them to the iTunes library itself or when you change the tags using iTunes, but the process of synching the iPod just copies the files over in their current state. It's the iTunesDB that controls the rest.

This does not make sense. I have an MP3 file tagged with APEv2 and ID3v1. I then transfer it to the iPod using iTunes - I did not enter any tag editing facility in iTunes or anything. When I double click on the file on the iPod disk drive (Not using foo_pod), it now only has the ID3v1 tag intact.

Then you've discovered something I can't reproduce.. When I was using MP3Gain, the gain got saved in an APEv2 tag, if I'm not mistaken. When I checked the files on the iPod, they never were any different from files on the main hard drive.

To the best of my knowledge, you've got to be mistaken. smile.gif

Edit: iTunes may very well remove the APEv2 tag when you add it to the iTunes library though. I've not tested that.
Otto42
QUOTE (Aero @ Mar 1 2004, 04:11 PM)
I'm not sure how the iPod internally sorts the songs, but if it does order them based on tracknumber and since the tracknumber is just another bit of data that we can control, it will be possible to make fake tracknumbers so that the songs end up sorted alphabetically.

Actually, if you simply leave the track numbers blank in the iTunesDB (set both tracknum and totaltracks to zero), I believe that it will sort alphabetically by track title. I may be mistaken though.

Also, it does indeed use the CD number as well when ordering. So if you have proper tracknumber and a multi CD set with the CD num as 1, 2, etc, then you get all the tracks from CD1, in order, followed by all the tracks from CD2. Very nice for multi disc sets where you care about order.
Xecter
Ya, it defaults to alphabetical when theres are no track numbers present.


You know, I wish those fat cats at Apple released a SDK for the damn ipod. That would be sick.
Otto42
Okay, I added a whole lot of stuff to the iPodDB classes. Hopefully this stuff will make it easier for one to build an iTunesDB from scratch or at least easier to modify an existing one. Bunch of functions relating to tracklists, playlists, tracks, strings in tracks, etc, etc. I've emailed them to Aero for comment and revision and such, but if anyone else wants to take a gander and offer some input, the classes are here. Same place as before: http://otto.homedns.org:8888/iTunes/iPodDB.zip .

These classes are rapidly becoming very complicated. I think that's a good sign. smile.gif

I'm going to start working on adding classes for the Play Counts file, in order to allow some kind of support for that functionality in foo_pod, and also a class to support the new On The Go playlist download feature of the latest iPod firmware (2.1).

Edit: Hmm. Well, that was surprisingly easy to add. Took about an hour, after I had some breakfast. Okay, now it supports reading the Play Counts file, and reading/writing the OTGPlaylist file. Not that you'd ever need to write an OTGPlaylist file though. Dunno if it would use it even if you did. Oh well.

I'm kinda out of stuff to add to iPodDB now. sad.gif Maybe I'll go experiment with that soundcheck field some more.
Xecter
Otto42 thats some great news. I think now that we have a SDK sorta thing going, a database GUI needs to be build just like on the ipod, which would make it extremely easy to load stuff on the ipod.

So we built a foundation, lets build a house. biggrin.gif
Otto42
QUOTE (Xecter @ Mar 2 2004, 10:55 AM)
Otto42 thats some great news. I think now that we have a SDK sorta thing going, a database GUI needs to be build just like on the ipod, which would make it extremely easy to load stuff on the ipod.

So we built a foundation, lets build a house.  biggrin.gif

Well, possibly the easiest metaphor is the one of playlists. It's a big list of tracks. The iPod makes this into kind of an extreme case, as every song on the iPod *must* be in a playlist, and to accomplish this, it makes one default "hidden" playlist which contains every single track in the track list. Any playlists you add yourself come after this one.

So it'd be possible to make a playlist called "iPod", for example, and when you synced, everything in that playlist would be sent to the iPod. If there was some way to have playlists contain other playlists, this could be used to put other playlists on the iPod. Or something. I don't fully know the extent of foobar's metaphors and structures in this regard, so I'm not really qualified to talk about it. I tried to read the foobar SDK, but it gave me a headache. smile.gif

In any case, I'm going to try to decipher smart playlists on the iTunes/iPod now. With that, maybe some method of scripting that foobar has for building automatic playlists (does it have such a thing?) can be adapted to produce smart playlists that actually work on the iPod as well. And it'll give me something that'll take a few days to figure out. biggrin.gif
Xecter
Ya i understand the ipod playlist action. But it still works from a database, and works best with iTunes. iTunes is entirely a databased driven program. I am interested in this kind of implementation for both the ipod plugin and Foobar. Plus, it would also be nice too see who what would browsing would be like on the ipod before loading up like 18 gigs worth of songs; you know, making sure all the tags are consistent. Cuz it seperates very distinctly, like DJ Tiesto, and DJ Tiësto are different artists.

=/
Aero
QUOTE (Xecter @ Mar 2 2004, 06:38 PM)
Ya i understand the ipod playlist action. But it still works from a database, and works best with iTunes. iTunes is entirely a databased driven program. I am interested in this kind of implementation for both the ipod plugin and Foobar. Plus, it would also be nice too see who what would browsing would be like on the ipod before loading up like 18 gigs worth of songs; you know, making sure all the tags are consistent. Cuz it seperates very distinctly, like DJ Tiesto, and DJ Tiësto are different artists.

I doubt that foo_pod is ever going to be a full featured as iTunes. Ultimately, it will probably just be an easy way to sync a playlist, and maybe allow for some scripting control of the process.

If you need to review your music tags before syncing, you might want to consider the quite excellent ID3-TagIt. Otherwise, Foobar's playlist display and MassTagger are pretty good as well.
gandalf44
So far the best part about foo_pod is simply the fact that it allows me to convert all my iTunes Music Store purchases to flac, mp3, etc. Before, I had to burn a CD-RW of my purchases within iTunes, then rip to flac or whatever. Now I can just use the diskwriter......extremely cool......
Otto42
Got the barest beginnings of smart playlist support in there. It can read smart playlists into memory and parse them, but I still don't know what half of the values in there mean. But that's just a matter of trial and error with iTunes. It can't write changes to the thing yet though, because I haven't done enough testing to start that portion of it. smile.gif

But at least it'll be able to read the rules for creating smart playlists. Whether or not that can be translated into something foobar can use is another matter.

Got more smartlist stuff added. What a major PITA smart playlists are. Very powerful, that much I can see, but still, yikes.
Aero
QUOTE (gandalf44 @ Mar 2 2004, 08:26 PM)
So far the best part about foo_pod is simply the fact that it allows me to convert all my iTunes Music Store purchases to flac, mp3, etc.  Before, I had to burn a CD-RW of my purchases within iTunes, then rip to flac or whatever.  Now I can just use the diskwriter......extremely cool......

Hey, that's a really good idea! I hadn't thought of using Diskwriter - in fact, I recently transcoded some .m4p files myself, but I played them in iTunes and captured the audio live from the mixer. You made my day knowing that I played a tiny little part in sticking it to The Man! smile.gif


Quick status update on foo_pod: Otto42 and I (mostly Otto42) have been working hard at getting the iPodDB library complete and ready to use. Last night, I was able to add a song to the database, write it out, and read it back in again. So basically, I have everything I need to be able to transfer a playlist from Foobar2000 to the iPod. Hopefully I can have it ready for widespread testing within a day or two.,
gandalf44
I was curious about something......how is foo_pod actually able to play the iTunes Music store m4p files? I thought that's why you need the iTunes applications, because you were allowed up to 3 computers (or 3 different instances of iTunes app on different machines) to play the files?

Not that I am complaining, for I am thrilled that I can use my purchased music in something else besides iTunes, especially for transcoding thru diskwriter (and eventually writing back to to Ipod).

I was just curious how it works....
kode54
DRM support was added to MP4FF some time before the 0.8 release. foo_input_std will decode M4P files on the system they were licensed for.
gandalf44
Ahhh....I see. Without telling me to look at the source code :-D, can you explain in layman's terms how that was accomplished? Does foo_input_std look at the actual M4P file?

If you know of a pointer where this has alreadt been explained let me know....just curious.
Otto42
QUOTE (gandalf44 @ Mar 3 2004, 06:47 PM)
Ahhh....I see.  Without telling me to look at the source code :-D, can you explain in layman's terms how that was accomplished?  Does foo_input_std look at the actual M4P file? 

If you know of a pointer where this has alreadt been explained let me know....just curious.

I explained how it could be done somewhere around here, but I can't find the post.

Short version:
- The M4P files are encrypted. To decrypt them, you need the key.
- iTunes gets the key when it "authorizes" and stores it in a file on the hard drive.
- But iTunes encrypts that file using info already on your machine, like the Windows Product Key and such.
- But DVD-Jon (the norweigan hacker who cracked CSS and got sued for it) also worked out how to decrypt that file and get the key and released how to do it as open source.
- And now several programs, including foobar, realplayer 10, etc... can get that key directly from iTunes storage location and decrypt the file and play it, and some can even create an unencrypted MP4/M4A from it (look on Google for a program called M4P2MP4.EXE... I'd post a direct link or link to more info, but doing so would violate rule 9 of these forums).
Mike Giacomelli
Any progress on the Soundcheck/RG implimentation?

Also, what are you looking at the database with? My hexeditor doesn't seem to make much sense of it.
Otto42
QUOTE (Mike Giacomelli @ Mar 5 2004, 09:05 PM)
Any progress on the Soundcheck/RG implimentation?

Haven't had the time to look seriously at it. Understand that I'm currently in the process of getting a new job, getting a new apartment, planning the move, and I'm also taking a 10 day vacation at the beach this next week. Been busy. wink.gif

QUOTE (Mike Giacomelli @ Mar 5 2004, 09:05 PM)
Also, what are you looking at the database with?  My hexeditor doesn't seem to make much sense of it.

Generally, I look at it with a hex editor. Of course, it's a lot like looking at the Matrix... I've gotten to where I don't even see the hex anymore... biggrin.gif

Start here if you want to understand the format of the file: http://otto.homedns.org:8888/itunes/iTunesDB.html . However, my entire site will go down for at least 3 weeks beginning on the 11th, so I'd check it out soon and possibly make a copy of anything you want to keep. smile.gif
Aero
Another quick status update: tonight, I was able to transfer a complete Foobar playlist of songs to my iPod. Currently, the sync is really just a replace - so there is still work to be done, but the hardest part is already implemented.

On the first major test, I was able to transfer 501 songs (2.45GB) in 224 seconds. That is approximately 11.2MB/sec, which is phenomenal since the same machine only transfers at 9-9.5MB/sec with EphPod. cool.gif The final product will be slower, since it will need to detect duplicate songs and everything else that sync'ing implies, but I was really impressed with this first trial.

Next up will be to add code to detect duplicate songs, as well as the ability to delete files from the iPod when they aren't in the current playlist in Foobar. I am also considering a better way to transfer files from the iPod, and organizing them into a directory tree. Then I'll add Lua scripting support, along with some more unusual ideas I have been coming up with. Like an iPod to iPod sync - this would be a quick way to duplicate one iPod to another, or copy missing files so that both iPods would have the same set of songs.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.