Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_pod - Foobar2000 meets the iPod (Read 1312369 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

foo_pod - Foobar2000 meets the iPod

Reply #125
Just got an idea for a feature!

You know how many people complain about how the iPod uses tags to organize music, as opposed to directory structure? Well, knowing the iPod's playlists-within-playlists format, it should be trivial to emulate such a feature, right?

For every directory, make a playlist. For every directory in each directory, make another playlist in the appropriate playlist. Then put files in them, and so on. Would be cool.

Also, I'm looking forward to improved progress dialogs (I don't care much for the current animations - I prefer foobar2000's other very minimalist progress dialogs  ) and to custom TagZ formatted titles - Need tracknumbers here baby.

Woot!

foo_pod - Foobar2000 meets the iPod

Reply #126
Quote
You know how many people complain about how the iPod uses tags to organize music, as opposed to directory structure? Well, knowing the iPod's playlists-within-playlists format, it should be trivial to emulate such a feature, right?

For every directory, make a playlist. For every directory in each directory, make another playlist in the appropriate playlist. Then put files in them, and so on. Would be cool.

That is a good idea and it would be nice, but I don't think it is technical possible.  For one, I don't believe that you can do playlists within playlists.  Someone correct me if I'm wrong, but from my understanding of the iTunesDB format, there is no way for a playlist to contain anything except for songs.

What I believe you could do is use one of the Main Menu Browse items (such as Composer), to fake a directory tree structure.

For example, if you had the following structure, you could get it to show up on the iPod by using the Composer field, shown in parenthesis:
Code: [Select]
c:
  \mp3  (c)
    song1.mp3     (mp3)
    song2.mp3     (mp3)
     \album1          (mp3)
       song3.mp3  (album1)
       song4.mp3  (album1)
     \album2          (mp3)
       song5.mp3  (album2)


Which should appear on the iPod as:
Code: [Select]
mp3
  ----->
            song1
            song2
            album1/   (slash added to make it clear that it is a dir)
            album2/

Hmm...I'm just making this up as I type, but it is crazy enough that it just might work!  I'll look into implementing it.


foo_pod - Foobar2000 meets the iPod

Reply #128
Quote
You mean write the "__ipod_resident" metadata out to the files as they are copied to the iPod?  Yeah, I can add that, but I can see how it would out of date if you copied the files from the iPod back to the computer.  This would be a good use of Lua scripting.

BTW, what is the iTunes sync-state feature?

No, I meant can it be written or somehow held by foobar itself (I don't understand the interaction between foobar, ui_columns, and the foobar db).  Its not useful inside the files.

iTunes has the nice little progress graphics when syncing.  Rather than throwing up a modal dialog, it just grays out items in the playlist until they are synced.

+Reardon

foo_pod - Foobar2000 meets the iPod

Reply #129
Quote
Quote

You mean write the "__ipod_resident" metadata out to the files as they are copied to the iPod?  Yeah, I can add that, but I can see how it would out of date if you copied the files from the iPod back to the computer.  This would be a good use of Lua scripting.

BTW, what is the iTunes sync-state feature?

No, I meant can it be written or somehow held by foobar itself (I don't understand the interaction between foobar, ui_columns, and the foobar db).  Its not useful inside the files.

iTunes has the nice little progress graphics when syncing.  Rather than throwing up a modal dialog, it just grays out items in the playlist until they are synced.

+Reardon

May be if foo_pod wrote a "synced to ipod" tag, people could then create UIs whiched shows this graphically, the same way people display whether or not a file has replay gain info.  The only problem would be how to make sure this info is accurate, for example if you didn't sync a song the next time how would you go back and change the tag?  The way this is done in iTunes is that when the iPod is connected a new playlist is created showing the current content of the iPod then any new files added to the library since the last sync are added to this playlist and greyed out as they are transferred over.  That is unless you tell it not to sync certain songs, so instead of a "synced to ipod" tag it would be a "don't sync" tag.

The method I've thought up to emulate a similar behavour in foobar would be to have foo_pod automatically create a playlist of current songs on the iPod, and then sync this with a pre-defined "library" playlist in foobar (or could you use the foobar database?).  The only question is how do you handle displaying what playlists are present on the iPod?

Do you have it automatically create all the playlists present on the iPod in foobar?  What if these playlists contain songs not present on the PC?

Do you have all the playlists in foobar transferred to the iPod?  If not, how do you choose which ones are and how do you display this in foobar?  (The best way I can think of doing this would be to give all those syncing with the iPod little iPod icons in their tabs)

Also how are smart playlists and on-the-go playlists going to be handled?  I get the feeling smart playlists could be a real problem, but it is one of the features I really like 

I'm guessing that this is going to be the hard part.

foo_pod - Foobar2000 meets the iPod

Reply #130
Quote
y=1002*e^(-.2303x)

Good fit. However, whenever you see a 2303 in an exponential function like that, you're probably using e when you should be using 10. ln 10 = 2.303, sort of thing. That's one of those bits in math class that stuck with me.

I'm betting this is the function they're actually using for the conversion:
y=1000 * 10 ^ (-.1x)


Edit: Hot damn! Thought about it a bit, and starting looking up power formulas. And BINGO! We have a winner!

milliWatts = 10 ^ ( dBm / 10 )
milliWatts * 1000 = Watts.

So, the answer I was looking for, at last: The value in the Sound Check field is expressed in Watts. The dB value that iTunes displays is expressed in dBm, which is decibels relative to 1 milliWatt of power. It's negated, but there it is.

On reflection, this makes sense. It's probably using the Watts value in the SoundCheck field to adjust the output power at the preamp stage, sort of thing.

foo_pod - Foobar2000 meets the iPod

Reply #131
Quote
Also how are smart playlists and on-the-go playlists going to be handled?  I get the feeling smart playlists could be a real problem, but it is one of the features I really like  

I'm guessing that this is going to be the hard part.

I don't think foobar has any way to define anything similar to a "smart playlist" as of yet, no? I've worked out a great deal of the smart playlist structure in the iTunesDB (although bits and pieces of it still elude me), and feel fairly confident in being able to make simple smart playlists for the iPod. None of the code is in iPodDB yet, but it's not too difficult.

But only 3rd gen iPods and up (any iPod running 2.0 or up code) actually use the smart playlist tags in the iTunesDB, from what I can tell.. They rebuild the smart playlist themselves from the data they are given. They do it in semi-real time too, meaning that if you have a list based on, say, last played time, then when you play a song on the iPod, it goes away from that playlist, after you exit that smart playlist and come back to it. Without syncing to iTunes. Essentially, the iPod rebuilds the smart playlist from its data at the time that you tell it to play that playlist.

1st and 2nd gens only change the smart playlist on a sync with iTunes, and then all that's really happening is that iTunes puts the proper songs in the playlist, according to the rules of the smart playlist. In other words, it's only smart on one end, not smart on both ends.

Making one end smart (foobar) requires changes to foobar only. Making both ends smart requires more significant changes, but not that much harder. The key for doing both ends is to make the smart playlist support in foobar compatible with the iPod's smart playlist fields from the beginning, which probably eliminates using some form of advanced scripting, which would be difficult to convert to a form that will fit in iTunesDB's smart playlist fields.

foo_pod - Foobar2000 meets the iPod

Reply #132
Quote
I'm betting this is the function they're actually using for the conversion:
y=1000 * 10 ^ (-.1x)

I think you're right - that is almost definitely the equation that describes the relationship between iTunes Sound Check dB value (x) and the Sound Check value (y), as written to the iTunesDB file.

Here is a question for anyone - is it better to emulate the Sound Check values that iTunes writes for a given song, or just use one of the functions to convert Replay Gain's value?

The problem is that while Replay Gain and iTunes generally calculate about the same gain for a song, sometimes they are slightly different and that difference is magnified by the exponent resulting in Sound Check values that are up to 20%-30% different.

I was originally trying to find an algorithm or algorithms that mapped what Replay Gain calculates to match that iTunes' value.  But now that there is some understanding of the basis behind how Sound Check is really calculated and used, I'm thinking that it is best just to use the straight RG values and trust that it does a better job than iTunes.

Not that any of this really matters...the difference is small enough for most gain values that I doubt anyone could tell the difference.  The current algorithm seems to work great, at least in my experience, all of the songs sound identically loud with SoundCheck enabled.

foo_pod - Foobar2000 meets the iPod

Reply #133
Quote
May be if foo_pod wrote a "synced to ipod" tag, people could then create UIs whiched shows this graphically, the same way people display whether or not a file has replay gain info.  The only problem would be how to make sure this info is accurate, for example if you didn't sync a song the next time how would you go back and change the tag?  The way this is done in iTunes is that when the iPod is connected a new playlist is created showing the current content of the iPod then any new files added to the library since the last sync are added to this playlist and greyed out as they are transferred over.  That is unless you tell it not to sync certain songs, so instead of a "synced to ipod" tag it would be a "don't sync" tag.

Yeah, keeping a synced metadata item up-to-date is rather problematic.  There would need to be a really good reason to implement it.

Quote
Do you have it automatically create all the playlists present on the iPod in foobar?  What if these playlists contain songs not present on the PC?

I don't currently create Foobar playlists from those on the iPod.  I could add the ability to display the iPod playlists, just like there is the ability to display all of the iPod songs in the foo_pod playlist.  Since the playlist items would point to the files on the iPod itself, there would be no problem if the files didn't exist on the PC.

Quote
Do you have all the playlists in foobar transferred to the iPod?  If not, how do you choose which ones are and how do you display this in foobar?  (The best way I can think of doing this would be to give all those syncing with the iPod little iPod icons in their tabs)

There are two ways to transfer Foobar playlists to the iPod - Send/Sync Current Playlist and Send/Sync All Playlists.  There is no current way to only sync some of the open playlists.  I could add the ability to exclude playlists (that was brought up before when foo_pod tried to sync playlists containing streaming audio URLs), but that would be a pretty low priority item for me to add at this point since it is possible to accomplish the goal by just send/sync'ing the desired playlists directly.

The default UI doesn't even have icons in the tabs, so I don't know how I could add status indicators to the tabs themselves.

Quote
Also how are smart playlists and on-the-go playlists going to be handled?  I get the feeling smart playlists could be a real problem, but it is one of the features I really like

Smart Playlists, at least the little I know of them, would seem to be pretty hard to add to the current Foobar based interface.  Also, as Otto mentioned, the backend code might not be completely ready to handle smart playlists.  So I'm afraid this is another lower priority at the moment.

foo_pod - Foobar2000 meets the iPod

Reply #134
I don't know if this is possible, but if you could somehow have option to copy either the AlbumGain or TrackGain (obviously not both) values to the DB, that'd be fantastic (not having AlbumGain is the only thing that really bugs me about SoundCheck, might as well be normalizing).

foo_pod - Foobar2000 meets the iPod

Reply #135
Quote
I don't know if this is possible, but if you could somehow have option to copy either the AlbumGain or TrackGain (obviously not both) values to the DB, that'd be fantastic (not having AlbumGain is the only thing that really bugs me about SoundCheck, might as well be normalizing).

I believe what you are asking for is already in Preview Redux^2, and will be in the next version, 0.5.  There is a preference item that controls how Replay Gain -> Sound Check is calculated - disable, prefer album gain, or prefer track gain. 

Disable is self-explanitory.  Prefer album gain means that if album gain is available, it is used.  Otherwise the Sound Check value is determined from the track gain, or disabled if not available.  Prefer track gain is just the opposite.

Is that what you were looking for?

Edit: There might be some confusion about the terminology as well.  When I refer to Sound Check, I'm referring to the mechanism on the iPod which adjusts the volume based on a per-song value stored in the iTunesDB file. 

There is also Sound Check in iTunes, which calculates the gain - the equivalent of Foobar's Replay Gain support.  foo_pod uses the Replay Gain information, if available, and translates it into a Sound Check values used on the iPod, which as I mention above, is user configurable to prefer album or track gains.

foo_pod - Foobar2000 meets the iPod

Reply #136
Doh, just installed the Redux 2 version (had 0.4 installed with 0.8.1 Beta 3) and just came back here to delete my post, sorry.  It has exactly the functionality I wanted (nice work on the quick reply to).

foo_pod - Foobar2000 meets the iPod

Reply #137
(hopefully) simple feature request:  to better emulate a real media library, i keep one playlist filled with everything i've got in the database (hopefully with future extensions of playlistgen this will be automatically updated).. but i do have a substantial amount of other playlists that i'd like to keep synced. if there was a way to exclude playlists from the sync, this could be done in one click, and that would be well excellent

this could be done either in the config screen, or if that's hairy to implement, you could just have some manner of user-editable tagz test condition on the playlist name to allow/disallow syncing of a playlist.

man that'd be awesome.

oh, and unrelated: it seems to be par for the course for many foobar actions, but how plausible is it to make foo_pod not block when syncing? i've got a 30gb pod, and syncs can take a while

foo_pod - Foobar2000 meets the iPod

Reply #138
Quote
I think you're right - that is almost definitely the equation that describes the relationship between iTunes Sound Check dB value (x) and the Sound Check value (y), as written to the iTunesDB file.

Here is a question for anyone - is it better to emulate the Sound Check values that iTunes writes for a given song, or just use one of the functions to convert Replay Gain's value?

The problem is that while Replay Gain and iTunes generally calculate about the same gain for a song, sometimes they are slightly different and that difference is magnified by the exponent resulting in Sound Check values that are up to 20%-30% different.

I was originally trying to find an algorithm or algorithms that mapped what Replay Gain calculates to match that iTunes' value.  But now that there is some understanding of the basis behind how Sound Check is really calculated and used, I'm thinking that it is best just to use the straight RG values and trust that it does a better job than iTunes.

Not that any of this really matters...the difference is small enough for most gain values that I doubt anyone could tell the difference.  The current algorithm seems to work great, at least in my experience, all of the songs sound identically loud with SoundCheck enabled.

Well, the dB value that iTunes or RG figures is bound to be different because they're essentially different algorithims.. Rather than try to convert from one to the other, just calculate the Sound Check based directly on the RG dB value (whichever one you prefer) and go with that.

In theory, the conversion to the Sound Check value isn't actually changing anything, it's just expressing the amount of volume change in another format (microWatts). So since RG probably does a better job at calculating the actual volume change needed, I'd say to simply convert it using that function and stick it in there. It'll likely work better than iTunes Sound Check does. RG is a bit more robust, methinks.

foo_pod - Foobar2000 meets the iPod

Reply #139
Quote
(hopefully) simple feature request:  to better emulate a real media library, i keep one playlist filled with everything i've got in the database (hopefully with future extensions of playlistgen this will be automatically updated).. but i do have a substantial amount of other playlists that i'd like to keep synced. if there was a way to exclude playlists from the sync, this could be done in one click, and that would be well excellent

I could add a context menu item to enable/disable a playlist.  I'm not sure if  you can interface directly with a playlist/playlist tab, but I could set up a handler to add/remove a playlist name to a list of excluded playlist and save that list so it persists when you restart Foobar. 

Quote
oh, and unrelated: it seems to be par for the course for many foobar actions, but how plausible is it to make foo_pod not block when syncing? i've got a 30gb pod, and syncs can take a while

Unfortunately, Foobar is pretty unfriendly to multithreaded components.

From playlist.h:
Code: [Select]
//important: playlist engine is SINGLE-THREADED. call any APIs not from main thread and things will either blow up or refuse to work. all callbacks can be assumed to come from main thread.

There are ways around this restriction, but they are messy and time consuming to implement.  You could always run 2 instances of Foobar - one for regular playback and one for foo_pod.

foo_pod - Foobar2000 meets the iPod

Reply #140
Would it be possible to add a way to convert files and then place the output onto the Ipod?

I'd like to be able to highlight a flac file, hit one command and have that file converted to AAC and then placed on the Ipod without needing any further attention.  Can a plugin do this or would peter need to be involved?

foo_pod - Foobar2000 meets the iPod

Reply #141
Quote
Would it be possible to add a way to convert files and then place the output onto the Ipod?

I'd like to be able to highlight a flac file, hit one command and have that file converted to AAC and then placed on the Ipod without needing any further attention.  Can a plugin do this or would peter need to be involved?

Hmm...it will take some thought to figure out the best way to do what you are asking.

It would be nice to have a general facility in foo_pod to be able to automatically transcode any iPod unsupported audio format into MP3 or AAC, and transparently send/sync those along with the regular supported files.  Currently, foo_pod just displays a console warning and ignores the unsupported files.  It could also theoretically extended to transcode any file, so you could have your big 320kbps MP3s on your hard drive, but transcode them to tiny 128kbps AAC when copying them to the iPod.  Obviously, transcoding will greatly slow down the transfer process, but it would be a good feature to have in foo_pod.

It seems like DiskWriter would be perfect for this task.  I'm not sure how controllable it is from another component, but assuming it can be programmatically controlled, it shouldn't be too hard to add transparent transcoding to foo_pod.



On  a side note, I'm wrapping up work on  0.5.  I finally was able to reproduce and fix the "blank playlist" data loss problem that reardon posted about.  I also fixed a problem that cropped up recently where Send Selected To iPod copied files but didn't add them to the database, so they didn't appear on the iPod.  I also just fixed the Preamp feature, so it actually works now.

foo_pod - Foobar2000 meets the iPod

Reply #142
Quote
Would it be possible to add a way to convert files and then place the output onto the Ipod?

I won't even pretend to be a programmer, but it sounds like you're looking for an auto-syncing smart playlist feature.  The conversion process (as you know) is already fairly automated, so the missing piece would be a way for foo_pod to know that new files needed to be added from some specific playlist, and to actually do that. 

I'm hopeful Aero, Otto, and anyone else working on foo_pod will eventually be able to do this, but getting the intermediary steps working would have to come first.

Keep up the great work guys - I just started testing using ReplayGain/SoundCheck on my (1st gen) iPod...and it absolutely rocks.

foo_pod - Foobar2000 meets the iPod

Reply #143
Version 0.5 is now available.


Well, here it is.  I readded the progress dialogs and fixed all of the major known bugs since 0.4.1 and Previews.  If you're upgrading from 0.4.x, playlists, Replay Gain/Sound Check, and the preamp are going to be the big new features.  For those of you that have been using the Preview versions, fixing reardon's dataloss, making the preamp work, and of course, the progress dialogs are worth checking out.


From the Readme:

Version 0.5 - April 11, 2004
* Added the ability to create iPod playlists.  When one of the Send/Sync Playlist
  features are used, foo_pod will optionally (see Preferences) create an identical
  playlist on the iPod, as well as optionally create a randomized playlist and/or
  a playlist sorted according to a user defined TAGZ string.

*  iPod database creation should be faster and safer than previous versions.

*  Fixed a data loss problem where files on the iPod would appear to be deleted.
  The problems also caused a playlist with no name to appear in the Playlist
  display.

*  Improved the progress dialog dialogs.

*  Fixed the megabytes per second statistics displayed on the Foobar console after
  copying files to the iPod.

*  Improved the sync algorithm, so that it is better able to detect multiple files.
  This means that you can send any files to the iPod, and it should be able to
  determine which ones actually need to be transferred.

*  Implemented a translation between Replay Gain values and the values used by the
  Sound Check feature on the iPod.  There are 3 new preferences dealing with Replay
  Gain - disable, Prefer Album Gain, and Prefer Track Gain.  Prefer Album Gain will
  cause foo_pod to search for album gain on any transferred files and use that value,
  otherwise it will attempt to use track gain, and finally display Sound Check for
  that file.

*  Added better detection of invalid iPod format songs, such as FLAC and streaming
  audio URLs. 

*  foo_pod will now retry several times to mount the iPod, hopefully reducing the
  problem of it not finding a recently connected iPod.

*  Added a Preamp preference item.  This will raise the volume of all songs by the
  percentage shown by the slider.  This is apparently what EUpod does, and is
  equivalent to the volume feature in iTunes.  iPods apparently do not support
  negative values, so even though iTunes allows the user to reduce the volume,
  this does not have an effect on the iPod, so foo_pod only allows volume increases.

foo_pod - Foobar2000 meets the iPod

Reply #144
Great!
Have done some simple tests and no problems detected. 

Solaris

foo_pod - Foobar2000 meets the iPod

Reply #145
I'm looking forward to testing the new version when I get home. Meanwhile, I think I've supplied you with enough ideas for 0.6?

foo_pod - Foobar2000 meets the iPod

Reply #146
Quote
I'm looking forward to testing the new version when I get home. Meanwhile, I think I've supplied you with enough ideas for 0.6?

Oh yeah,I forgot to mention, but I tested the idea of implementing a directory browse mode, and the results weren't encouraging.  I was able to build the directory structure and have it appear under the Composer browse option, but the next level down from Composer is album view. 

So you would see:
Code: [Select]
dir1/
   ------> All
              Album 1
              Album 2
dir2/
   ------> All
              Album 3


That's not to say that it is impossible to do a directory structure, but I can't think of a way to make it work on the iPod at the moment.  However, it seems likely that the iPod is just too hardcoded to make it doable.

foo_pod - Foobar2000 meets the iPod

Reply #147
Great work!

I have only one problem. I have some songs with Asian characters in the file names.  I can upload them to my iPod using foo_pod, and all the tags display correctly. But my iPod won’t play them. If I upload those files using iTunes, they all work fine. It looks like that iTune automatically renames those files with foreign characters on the iPod. Could you add this feature to foo_pod? Thank you. 

foo_pod - Foobar2000 meets the iPod

Reply #148
Quote
I have only one problem. I have some songs with Asian characters in the file names.  I can upload them to my iPod using foo_pod, and all the tags display correctly. But my iPod won’t play them. If I upload those files using iTunes, they all work fine. It looks like that iTune automatically renames those files with foreign characters on the iPod. Could you add this feature to foo_pod?

So the songs are showing as expected up on the iPod, but when you attempt to play them, the iPod just moves on to the next song?

I have noticed that iTunes renames some files that contain only ASCII characters, but I haven't tested either iTunes or foo_pod with filenames containing other characters.  I'll test it tonight and see if I can reproduce the problem and find a simple mapping that the iPod will tolerate.
.

foo_pod - Foobar2000 meets the iPod

Reply #149
Quote
So the songs are showing as expected up on the iPod, but when you attempt to play them, the iPod just moves on to the next song?


Yes, the iPod just skips those song. If I load the iPod songs to the iPod Playlist in foobar, they all play fine in foobar.

Thanks!