Rockbox Technical Forums

Rockbox Development => Feature Ideas => Topic started by: oayz on September 07, 2010, 07:21:15 PM

Title: config per directory?
Post by: oayz on September 07, 2010, 07:21:15 PM
On many occasions I wish if RB can automatically switch some configuration parameters based on the current directory. For example:
- some music directories are better to be shuffled
- full albums are not
- audio books should never be shuffled
- for audio books different EQ may be preferred
- resume, rewind on resume etc - good for audio books, bad for music
etc.

To take care of all these and possibly other differences let's allow "local" configuration files. Basically if current directory has CFG file it will be parsed and applied.

Though idea and implementation seems trivial there is a question how to treat nested directories (should we revert hierarchically revert back or go back to root default.cfg).
Title: Re: config per directory?
Post by: funman on September 07, 2010, 08:30:05 PM
It sounds like a job for playlist files (m3u)
Title: Re: config per directory?
Post by: [Saint] on September 08, 2010, 05:51:42 AM
On many occasions I wish if RB can automatically switch some configuration parameters based on the current directory. For example:
- some music directories are better to be shuffled
- full albums are not
- audio books should never be shuffled
- for audio books different EQ may be preferred
- resume, rewind on resume etc - good for audio books, bad for music
etc.

To take care of all these and possibly other differences let's allow "local" configuration files. Basically if current directory has CFG file it will be parsed and applied.

Though idea and implementation seems trivial there is a question how to treat nested directories (should we revert hierarchically revert back or go back to root default.cfg).



Well, .m3u playlists can certainly help in some respects here...but it isn't the "solution".
In saying that, neither is my suggestion likely to be viewed as the "solution" for the original poster, but, I personally see it as being a lot more versatile...read on:

While you cannot configure Rockbox to load a specific .cfg file on entering a directory, you can most certainly create individual .cfg files and keep them in the folders where you intend to use them, simply remebering to "run" the .cfg before you listen to the content inside the directory.

With this you can set every variable you mentioned in your request...every variable/setting that Rockbox offers, in fact.

You can also configure a "fixed.cfg" to return your DAP to a default state (or, a state of your choosing) each time that Rockbox is booted to avoid having to remember to reset the config files each time.

This is what I do for these cases, and it works very well for me.



[St.]
Title: Re: config per directory?
Post by: Confuseling on September 08, 2010, 12:26:19 PM
I suppose a transparent way to do this automatically would be to have a config in a directory with a specific name (perhaps the name of the directory + .cfg) loaded automatically when you start playback from that directory. You could even have directives in the config, stating whether it applies recursively to subdirectories or not (making it default to something, so it's transparent again for users who don't want to care about this stuff). [ETA - or even just use 'automatic.cfg' and 'automatic.recursive.cfg' for names...] [ETA2 - now someone's going to chirp up and tell me there's an obscure prog-rock album from 1983 called 'automatic recursive'  :P]

I guess then it's only a question of usefulness versus binary size.

Edit - It does open up a slightly grey question though - do you ever want your MP3 player to do something like automatically ramp up the volume massively? It would only take one mistyped number in one config file to deafen yourself. You can make the case that that's no different from the present situation, but it always adds a different dimension when things happen without user intervention. Maybe you'd need a 'maximum volume to allow from config files' setting as well, complicating things somewhat...
Title: Re: config per directory?
Post by: oayz on September 08, 2010, 12:53:37 PM
No this stuff should not go to playlist. Playlist is a playlist - I'm surprized we start to add things like pitch to it. It may be huge (1000's songs) so adding complexity to it doesn't make sense.

Having special predifined naming convention for local configs makes perfect sense (similar to naming conventions for album arts). This way we may keep configs in local directories or in centralized location.

I agree that saving volume is dangerous. OK, maybe we should not load volume at all. Maybe we should have incremental option (60 is absolute volume while +/-6 is relative to current setting). I don't think it's a showstopper - same danger happens when we change config manually.

The nice thing about original suggestion is it's simplicity and flexability. Just use original config parser and all options become available.

"St's" suggestion to use manual config read is fine but going trough several layers of menu to select appropriate config file evry time playlist takes you to new directory is a mess.
Title: Re: config per directory?
Post by: saratoga on September 08, 2010, 02:58:38 PM
I'm not a fan of having per folder config files.  Its a nice enough idea in principle, but it would complicate buffering/playback and only be useful for a small number of cases.
Title: Re: config per directory?
Post by: oayz on September 08, 2010, 04:14:05 PM
Why would it affect buffering/playback? It's similar to reading album art, isn't it?

Yes, it may have a little use for some of us but will enhance flexibility by a lot. Even 2 most useful options - equlizer and shuffle should make this feature worthwhile. People who listen to books and music whould definetly appreciate having 2 set of settings (which they probably already have) and not having manually switch them.

Unless this feature interferes with main functionality why not have it? It's transparent, seems to easy to implement, consistent with current behavior and doesn't require much code.
Title: Re: config per directory?
Post by: saratoga on September 08, 2010, 04:29:58 PM
Why would it affect buffering/playback? It's similar to reading album art, isn't it?

Reading album art required quite a lot of changes to buffering and playback that are still being worked on.

Unless this feature interferes with main functionality why not have it? It's transparent, seems to easy to implement, consistent with current behavior and doesn't require much code.

Well if its transparent, easy to implement and won't require changing much, I might be persuaded with an elegant enough implementation.  Feel free to post your code for review.
Title: Re: config per directory?
Post by: oayz on September 08, 2010, 04:58:29 PM
You've got me on this. I'll rest my case - enough is said already.

Here is pseudo code (sorry this is the best I can do):

  On boot:
      current_cfg = /.rockbox/default.cfg

  On user config load:
      current_cfg = user.cfg

  On each directory change:
    if "local.cfg" file is present
        local_cfg = "local.cfg" // apply local settings
        read/parse/apply "local_cfg"
    elseif local_cfg != current_cfg
        local_cfg = current_cfg // apply global settings
        read/parse/apply "local_cfg"
    end
   
Note: read/parse/apply operates the same way as user loading new config via configuration menu.
Title: Re: config per directory?
Post by: torne on September 08, 2010, 05:19:32 PM
The point is that we don't read one track at a time, we read as many as will fit into memory, so you can't just look for the config file and load it immediately; you would need to look for the config files that correspond to *future* tracks on the playlist and load their contents without applying the settings, and leave them somewhere so you can apply them at the appropriate time later. This is what we mean by changes to buffering and playback.
Title: Re: config per directory?
Post by: Confuseling on September 08, 2010, 06:36:51 PM
Unless, in fairness, you just allowed loading configs to end the buffer.

I doubt there are many people who have playlists with music and audiobooks / podcasts in, which is the main use case.

[although my head nearly asploded trying to rewrite some keybindings, so the 'feel free to write a patch' point is well taken...  :)]
Title: Re: config per directory?
Post by: soap on September 08, 2010, 07:10:04 PM
I doubt there are many people who have playlists with music and audiobooks / podcasts in, which is the main use case.
*cough*

I routinely do, as I tend to plan my "DAP day" in the morning and create one 10-12 hour long playlist and then (try to) never touch my iPod again until I get home.
Title: Re: config per directory?
Post by: Confuseling on September 08, 2010, 07:32:04 PM
Fair dues...

1) I suspect you're not 'many people' (in the nicest possible way  :))

2) I suspect it wouldn't detract from your listening pleasure if there were a little bump between the two...
Title: Re: config per directory?
Post by: soap on September 08, 2010, 07:51:34 PM
I'm finding your overall point confusing, Confuseling.  As well as specifically what you're attempting to suggest with line-item 2 in the post immediately above.

Do you mind rephrasing the thrust of your "argument" and attempting to lay it out again?
Title: Re: config per directory?
Post by: Confuseling on September 08, 2010, 08:07:45 PM
I simply mean that a small 'bump' in between different config files, where things like crossfading and gapless playback fail, would probably for most users (who would use the feature anyway) be a worthwhile price. And I'm guessing (with no relevant knowledge at all, admittedly) that that's what stopping and restarting the buffer would entail.

And if the whole thing's transparent and optional, it's no price at all for everyone else.

Not trying to be argumentative - or confusing - I just think that on balance, it's a good suggestion. Caveats about featuritis, bloat, maintainability, writing the darn thing in the first place all included.
Title: Re: config per directory?
Post by: saratoga on September 08, 2010, 08:54:54 PM
I simply mean that a small 'bump' in between different config files, where things like crossfading and gapless playback fail, would probably for most users (who would use the feature anyway) be a worthwhile price. And I'm guessing (with no relevant knowledge at all, admittedly) that that's what stopping and restarting the buffer would entail.

Buffering doesn't really matter to gapless or crossfade.  Rather its about efficient use of the hard disk.  On a typical hard disk based player you can only read the disk about twice an hour, so you have to figure out what config you're going to need a while in the future, load all of them, and then switch to them later. 
Title: Re: config per directory?
Post by: oayz on September 08, 2010, 09:12:22 PM
Pardon my arrogance but again what's the difference between this feature and album art?
Title: Re: config per directory?
Post by: saratoga on September 08, 2010, 09:17:54 PM
Pardon my arrogance but again what's the difference between this feature and album art?

If you can figure out how to get this to work with a JPEG, be my guest!
Title: Re: config per directory?
Post by: Llorean on September 08, 2010, 09:21:53 PM
What about the ability to include .cfg files in playlists? Rather than loading folder .cfgs, just playlist them up like any other item, so if a user has a .cfg as the first item in their folder, and they insert the whole folder, it gets queued up as well? Probably best to ignore .cfgs in insert/queue shuffled scenarios, though.

This would also allow some flexibility for those who manually create playlists as well, by allowing them to set various .cfg files to trigger at certain times, such as loading preferred EQ presets for different albums, or whatnot.
Title: Re: config per directory?
Post by: torne on September 09, 2010, 04:28:13 AM
Pardon my arrogance but again what's the difference between this feature and album art?
Not a lot. Adding album art support required messing around with a bunch of playback and buffering stuff. So will this.

Llorean: What about cfg files which change settings which affect order of play, though? What do you do if the cfg file halfway through sets shuffled to on? (toggling shuffle was explicitly one of the things requested, which makes sense, you don't want to shuffle audiobooks). Or the reverse: what about if shuffle is on now, and you start a playlist that should include a cfg file which disables shuffle, but it doesn't play the cfg file until halfway through? :)
Title: Re: config per directory?
Post by: Confuseling on September 09, 2010, 05:56:40 AM
Buffering doesn't really matter to gapless or crossfade.  Rather its about efficient use of the hard disk.  On a typical hard disk based player you can only read the disk about twice an hour, so you have to figure out what config you're going to need a while in the future, load all of them, and then switch to them later. 

I had no idea it was so long - thanks for the clarification.

I still think the point stands, in that the vast majority of people probably don't mix audiobooks / podcasts and music in one playlist, which is undoubtedly the main use case for this. I don't know whether the people that do jump back and forth between them a lot, but I suspect not.

For people who are going to delve into the manual to find a feature like this, they can find a warning about battery life / hard disk wear there. If they use it for different styles of music, they're going to be doing it in full knowledge of the risks.

If it proved popular for such uses, worry about reading ahead then. I like Llorean's suggestion though - don't really know enough about shuffling to know whether Torne's point is fatal. Couldn't you just honour any apparently contradictory requests, and let the user sort it out?
Title: Re: config per directory?
Post by: gevaerts on September 09, 2010, 06:17:57 AM
Is per-directory config really that involved?

Is there a reason why a simple callback for PLAYBACK_EVENT_TRACK_CHANGE events (using add_event()) that checks the path of the playing file (to see if it changed since last time), checks if there's a config file there (with a specific name), and loads that config file if it's there, can't work? (except for the callback possibly being calld in an unsuitable thread, but that can be fixed easily)

Of course this would only load config files, so the user has to make sure that each such config file contains all settings that might have been changed in a previous directory. It wouldn't be too hard to also have "directory leaving" config files to make handling that a bit easier, but I think that that might not always work well.
Title: Re: config per directory?
Post by: torne on September 09, 2010, 06:20:45 AM
gevaerts: that would mean spinning up the disk on every directory change... and either way, the fact that some of the desired per-directory config settings affect playback order (shuffle, repeat) is fairly significant..
Title: Re: config per directory?
Post by: gevaerts on September 09, 2010, 06:39:45 AM
that would mean spinning up the disk on every directory change...
Yes, unless dircache is enabled (in which case there's only a spin up for loading a file). That's no worse than some other settings we have (auto-change directory...)

I imagine this entire thing would be a setting though(one which is probably not very suitable for per-directory config files :)) .

If the system would support looking in parent directories (similar to the album art search), I imagine most use cases (the ones that want e.g. different settings for audiobooks and music) won't really suffer from these extra spin ups (again, assuming dircache). Only people who want per-album setiings or similar would notice.

Either way, the fact that some of the desired per-directory config settings affect playback order (shuffle, repeat) is fairly significant..

Yes, definitely. I think it's a case of Don't Do That Then. People *can* do stupid things if they want to, and I think this wouldn't be the first case.
Title: Re: config per directory?
Post by: torne on September 09, 2010, 06:52:38 AM
Controlling shuffle is one of the things the original poster in this thread (and people who've asked for similar things before) *specifically asked for*, and it's an obvious and logical thing to want if you normally listen to music on shuffle but also have audiobooks... so I don't think it's as simple as just saying don't do that :)
Title: Re: config per directory?
Post by: gevaerts on September 09, 2010, 07:13:37 AM
Again, I think it depends on how you're trying to use it.

Controlling shuffle will work in general, but some edge cases (maybe common cases, but still on the edge!) might be a bit annoying. I'm going to assume a two directory setup (there might be subdirectories, but I'm not going to care about those), one of which has e.g. audiobooks, the other one music. I assume the user wants shuffle for music, not for other things.

Suppose you enable shuffle in the music config, and disable it for audiobooks, several things can happen:

So in summary, I think that while shuffle can indeed mess up things if used without thinking, it would be possible to make a well-behaved system that can do shuffle.
Title: Re: config per directory?
Post by: soap on September 09, 2010, 09:53:56 AM
This feature has been discussed at least two times in the past.

I think a more common usage case would be album-specific audio settings (EQ, etc.)   
Title: Re: config per directory?
Post by: oayz on September 09, 2010, 12:22:13 PM
I think a more common usage case would be album-specific audio settings (EQ, etc.)   
Shuffle was the one to make me open this thread. It's distructive - on few occasions I have it ON for playing music and forget to turn off switching back to audiobooks. 10 chapters later I relalized it's not a crazy athor, it's my stupidity :-)

Please remember that it's not simple music/books case. Even for music you may want to have shuffle of for album and on for compilations.
Title: Re: config per directory?
Post by: Llorean on September 09, 2010, 12:33:05 PM
I find the easiest way to do this is to "insert shuffled" a folder I want to listen to shuffled, and never turn on the actual shuffle option. It works great.
Title: Re: config per directory?
Post by: oayz on September 09, 2010, 12:44:50 PM
Thanks for the tip! If this thread will die I'd definetly use it. The problem is that most of the time I decide to shuffle when I already playing (got bored with same order). Also "insert shuffle" will not work for auto-change directory, will it?

Local config covers it all ...
Title: Re: config per directory?
Post by: Llorean on September 09, 2010, 12:48:16 PM
What happens if you put a new audiobook on, but forget to include a local .cfg to turn shuffle off? Or want to hear an album in order for once, but it has a local .cfg that turns shuffle on?

Really, the best way to handle it is to be responsible yourself, and maybe use the quickscreen to quickly toggle shuffle on/off as needed.
Title: Re: config per directory?
Post by: oayz on September 09, 2010, 12:59:17 PM
If current directory doesn't have local cfg than default should be used (see my pseudo code).

I completly agree with you - this a feature most people including me can live without. Yet it does provide tremendous flexability. BTW, as I just learned from you from another thread CFG files currently can only be stored in the root ...
Title: Re: config per directory?
Post by: Llorean on September 09, 2010, 01:01:38 PM
.rockbox is not "the root", and .cfg files can be stored anywhere, it's just that one option that only shows them within a certain folder.

It sounds like your folder-specific config files needs to have two values for every option then, one for "this folder's choice" and one for "the overall choice." Basically, it needs to treat them not like normal cfg files - it can't actually change the value of the option, just cause a temporary override when that folder's played that will be reverted at the stop of playback or when anything in any other folder is played.
Title: Re: config per directory?
Post by: oayz on September 09, 2010, 01:34:47 PM
Well no, that wasn't my intent. I suggested to keep a pointer to global CFG - either default or the one user manually loaded. This CFG will be reloaded every time we exit a directory with local CFG thus restoring "original" settings.

Of cause logic may be different but the intent is simple:
- keep CFG load/parse/apply as it is now
- in directories with no local CFG keep current RB behavior

It's not fully thought thru proposal - some may suggest different (more complex) bahavior in directory tree. For example if directory BOOKS have local CFG it may propogate to sub-directories.

Thanks for correcting "root" and yes I now remember that we can browse files and click on CFG anywhere.
Title: Re: config per directory?
Post by: Confuseling on September 09, 2010, 02:57:00 PM
@ soap and oayz

Just to clarify, I'm not arguing that in the long run, if the feature were fully developed, it would be of most use to audiobook / podcast users. I'm just saying that an initial form of it, hard disk spinning up warts and all, would be of clear use in this case. Given that it would be transparent, and have to be consciously turned on, I see no harm in making a useful but limited feature, and incrementally perfecting it to the point where it would be usable on an album by album basis.

The best is the enemy of the good, and all that.

@ Llorean

The case where you've got a config file in a directory and want to override it is an interesting one. You could maybe have three potential levels of settings; global settings, loaded as per now from a cfg file, local settings loaded because they're specified in a particular directory, and current settings if you adjust anything on top of that - discarded once you've left the directory again. Perhaps, ultimately, it would make sense to give the local / current ones an icon, or colour code them, in the settings menu.

It might also be nice to have a way to update local cfg files with new values. So if I went into a directory, then adjusted any parameters that were already specified in that directory's config, I could browse to the settings file and write them back with an 'update from current settings' or something from the context menu.
Title: Re: config per directory?
Post by: Yotto on September 09, 2010, 05:11:32 PM
I think a more common usage case would be album-specific audio settings (EQ, etc.)   
Shuffle was the one to make me open this thread. It's distructive - on few occasions I have it ON for playing music and forget to turn off switching back to audiobooks. 10 chapters later I relalized it's not a crazy athor, it's my stupidity :-)

Please remember that it's not simple music/books case. Even for music you may want to have shuffle of for album and on for compilations.

Maybe you can do what you are looking for with bookmarks?

I have two bookmarks (actually I have many, but two that matter for this discussion). The first is for all of my music. It's a shuffled playlist (m3u file that's in alphabetical order, but Rockbox has shuffle turned on). The second is of all my podcasts. It's a directory, with no m3u file, and Rockbox handles it as a dynamic playlist. It is NOT shuffled.

I never ever have to modify the "shuffle" setting. Playing the music bookmark loads it shuffled and I'm happy. Playing the podcast bookmark loads it not shuffled and I'm happy.
Title: Re: config per directory?
Post by: oayz on September 09, 2010, 06:27:21 PM
Yes, sounds like another way to handle shuffle. I could also have shuffled and non-shuffled m3u's.

The point is local CFG provides complete solution. Shuffle, EQ, timeouts ... everything. Shuffle is the biggest issue, EQ is the next one. Someone may have directory for parties - with crossfade etc.

To Confuseling:

I think we already have the infrastructure: we can save theme settings or audio settings or both. Maybe control settings should also be separate. If we could only browse cfg files and overwrite existing ones w/o having to type filenames ... (this was already mentioned in another thread)
Title: Re: config per directory?
Post by: Chronon on September 09, 2010, 07:22:44 PM
I would probably use it mostly to set crossfeed on/off by directory (album).
Title: Re: config per directory?
Post by: pabouk on September 14, 2010, 05:40:33 AM
I personally would like to have just about 3 - 5 different configurations for distinct directories (inherited in all their subdirectories). So for me there is no need to store the local configs to the involved directories. If it makes implementation easier / more efficient the local configs could be at a central location (for example in .rockbox/config directory or in a single .cfg file).

Which setting I would like to vary between directories:
- auto bookmarking
- default speed of playback (not possible in the configuration file at the moment)
- crossfeed
- maybe EQ
- maybe shuffle
- maybe skip length

In addition (sorry for little off-topic in this thread) it would be great if Rockbox traces completely listened files (listened from beginning to end) or files manually marked as listened so they could be later automatically moved / deleted (either files or references in a playlist) by a plug-in. I think many podcast listeners would welcome this functionality.
Title: Re: config per directory?
Post by: soap on September 14, 2010, 06:19:45 AM
I've seen crossfeed mentioned several times in this thread in connection with audiobooks / podcasts.

What is the audio disadvantage of having crossfeed on with these types of audio?
Title: Re: config per directory?
Post by: Didgeridoohan on September 14, 2010, 07:58:19 AM
Thanks for the tip! If this thread will die I'd definetly use it. The problem is that most of the time I decide to shuffle when I already playing (got bored with same order). Also "insert shuffle" will not work for auto-change directory, will it?

Local config covers it all ...

For the times you want to shuffle after creating a playlist, use "Reshuffle" in Context Menu -> Playlist
Title: Re: config per directory?
Post by: Chronon on September 14, 2010, 08:30:29 AM
I've seen crossfeed mentioned several times in this thread in connection with audiobooks / podcasts.

What is the audio disadvantage of having crossfeed on with these types of audio?

To clarify, I tend to listen to albums in random order (random folder advance).  Some (especially) older albums tend to be mixed with certain instruments panned hard left or right.  Crossfeed improves the experience of listening to such albums considerably.  On the other hand, I prefer not to apply crossfeed to some types of electronic music, for instance.  Some method of automating setting changes should enable crossfeed to be applied only to the albums I want.
Title: Re: config per directory?
Post by: Confuseling on September 14, 2010, 10:46:18 AM
One other thing that hasn't been explicitly mentioned is that the number of hard-disk based players is declining relative to flash based ones. Presumably, on a flash target, the buffer problem is irrelevant?

Maybe it would be interesting to run a poll, to find out the distribution among RB users. I'm assuming that there are more using hard-disks, because most targets are a few years old - but I wonder by how much?
Title: Re: config per directory?
Post by: saratoga on September 14, 2010, 11:38:49 AM
One other thing that hasn't been explicitly mentioned is that the number of hard-disk based players is declining relative to flash based ones. Presumably, on a flash target, the buffer problem is irrelevant?

No, they all use the same buffering system.  Theres just one rockbox for all devices.
Title: Re: config per directory?
Post by: Confuseling on September 14, 2010, 11:46:26 AM
I don't quite follow you. Isn't "spinning up" flash essentially costless? Doesn't that mean that for an increasing proportion of targets, the buffer problem is irrelevant - that you can load a config file between each track, and not suffer from a noticeable battery impact?

I'm not saying that that discounts it, just that it bears consideration (unless I've misunderstood...)
Title: Re: config per directory?
Post by: saratoga on September 14, 2010, 12:02:21 PM
I don't quite follow you.

Flash targets use the same buffering system as hard disk targets.  Whatever changes you suggest must work flawlessly on both flash and hard disk targets. 
Title: Re: config per directory?
Post by: Llorean on September 14, 2010, 12:15:55 PM
Basically, "we aren't going to screw over the hard disk users by adding such a feature, just because there are more flash users." It needs to work for both.
Title: Re: config per directory?
Post by: Confuseling on September 14, 2010, 12:30:27 PM
Flawlessly on all targets? Like Doom?  :)

Fair enough, if it interfered with current functionality. This is possibly a fairly wide definition of 'screwing over'.

Anyway, I think I've made my point...
Title: Re: config per directory?
Post by: saratoga on September 14, 2010, 12:37:45 PM
Flawlessly on all targets? Like Doom?  :)

Disabling doom on targets without color screens or enough RAM is fine.  Disabling playback on non-flash targets is not likely to be accepted. 

Title: Re: config per directory?
Post by: soap on September 14, 2010, 02:01:20 PM
Anyway, I think I've made my point...

If your point was to equate non-core plugins with music playback...

If Doom WASN'T included on targets which barely run it, people would bitch all the same.
Damned if you do, damned if you don't.
Title: Re: config per directory?
Post by: torne on September 14, 2010, 02:17:35 PM
On some of the flash targets, accessing the flash brings the flash chip out of an automatic sleep mode which consumes less power, so it *can* shorten battery life: the difference is much smaller than a hard drive, of course, but it may still be measurable.
Title: Re: config per directory?
Post by: JdGordon on September 14, 2010, 07:46:30 PM
why has noone mentioned that loading a cfg every (few) track change(s) is a very bad idea because just loading the .cfg is expensive?
There is no way to know which settings a cfg change and most cant be applied inidivudally so you not only need to check for the cfg, you also need to parse it (~200 settings in a massive table which needs to be scanned to figure out what a .cfg line means and how to store it), then we need to apply all settings which includes reloading fonts and themes (which can also actually mean stopping playback and restarting(!))

putting it mildly, this is a very stupid idea from an implementation point of view.

Now, a better solution to almost all the reasons for this has been posted already and I'll post another. Someone rework the quickscreen like has been menionted in one of the other threads to give you almost the same amount of control without wasting time with .cfg files.
Title: Re: config per directory?
Post by: pabouk on September 15, 2010, 10:14:13 AM
I think no one supposed that per-directory cfg will contain all the possible options. As I can summarize from this thread users need to change just few parameters. I do not understand why most of the settings cannot be applied individually. Do you think that this is the case of the parameters mentioned in this thread? Of course reloading fonts and themes would be really bad if we want to change just EQ, crossfeed or automatic bookmarking.

Stopping and restarting playback does not matter. I think no-one will complain if there will be exception to gapless playback.

We probably do not need unlimited number of configurations so they can possibly be stored in a parsed form at a single location or maybe loaded into RAM from single cfg during Rockbox startup.

I can imagine that the implementation could be complicated but finally should the software follow easy implementation or usability?

I do not know about a better solution (in the sense of usability). All other solutions require manual intervention of a user.
Title: Re: config per directory?
Post by: saratoga on September 15, 2010, 10:46:54 AM
I can imagine that the implementation could be complicated but finally should the software follow easy implementation or usability?


To be perfectly clear, the only way this will be accepted is if you have a good implementation.  Usability is not even a consideration until you have that.  So if you frame this as a choice between one or the other, consider the idea rejected. 

Anyway, since the only people actually discussing how this could be implemented seem to agree its both a bad idea and not worth implementing,  is there any reason to leave this thread open?  IMO we seem to agree that we're not going to have the buffering system handle config files, and the only remaining thing to discuss is improving stuff like the quickscreen or hotkeys.  IMO that should probably go in its own thread.
Title: Re: config per directory?
Post by: Confuseling on September 15, 2010, 12:25:44 PM
Personally, I see no need to lock the thread - it got somewhat heated at points, but has remained civil. Your prerogative.

Final suggestion then, and I'm not going to argue the point; you could limit it to top level directories (or even just literally audiobooks, music, and podcasts), presumably allowing you to load all configurations at boot with minimal interference with the present system.

This would meet some of the use cases, and provide a stepping stone to work from, while heavily limiting the problems. If the problems became tractable at a later date, you could loosen the limit.
Title: Re: config per directory?
Post by: torne on September 15, 2010, 01:02:59 PM
You're confusing what seems simpler in concept to you, with what's actually simpler to implement. We have no mechainsm for having multiple configurations in memory. We have no mechanism for loading configurations with only a subset of the settings. Adding these things would be complicated.

The ideas being discussed by most of the developers in this thread reuse the existing config file parsing system and the existing single set of global settings in memory to accomplish the task, this is what makes them simple, even though this means they have *more* functionality than you are asking for. Unfortunately the consensus seems to be that the 'obvious' way of doing it is going to have some problems... so unless a way around them is proposed this isn't going to happen. Suggesting something more limited doesn't automatically make it easier, simpler, or more elegant to actually implement, in fact more general solutions to problems are often more simple...
Title: Re: config per directory?
Post by: oayz on September 27, 2010, 01:55:29 PM
It's great to have developers to step in and provide insight. Even if "config" idea is rejected the problem is still there - there is a need to automatically adjust some settings on per directory basis.

I don't think quickscreen is a solution - it still requires user intervention, isn’t it?

Regarding crossfeed – I believe it’s a typo. Should be crossFADE
Title: Re: config per directory?
Post by: evilnick on September 27, 2010, 03:44:08 PM
Quote
Regarding crossfeed – I believe it’s a typo. Should be crossFADE

Nope. Crossfeed and crossfade are totally separate things.
Although I did think that at first too!
Title: Re: config per directory?
Post by: oayz on September 27, 2010, 03:58:31 PM
Yes, but it does make sense to control crossFADE on per directory basis. I don't think anyone wants to do it with crossFEED. Still possible though - "I listen this directory on headphones and that - when my RB is docked".
Title: Re: config per directory?
Post by: Chronon on September 28, 2010, 12:01:07 AM
For me it depends on how the album is mastered.  I usually enable crossfeed while listening with phones to albums where certain instruments are hard-panned.   
Title: Re: config per directory?
Post by: gevaerts on September 28, 2010, 03:17:56 AM
Actually, this gives me a related idea: How about having config files loaded on headphone plug and unplug? On players with both separate line out and headphone detection, I think this could be very useful.
Title: Re: config per directory?
Post by: soap on September 28, 2010, 05:45:13 AM
I would also use that, gevaerts, though since it is an infrequent switch two .cfg files are currently serving me well.  Mainly because my daily-use player is an iPod 5G and it has bass roll-off issues with sub 32 ohm phones.

Line-in:
No EQ
No crossfeed
Volume +6 (for convenience I set the pre-amp to -6 so that the new max for the iPod = 0)

Headphone
A bit of bass boost
Crossfeed
Volume -40
 
Title: Re: config per directory?
Post by: oayz on September 28, 2010, 11:55:41 AM
Actually, this gives me a related idea: How about having config files loaded on headphone plug and unplug?
Here is the alternative especially useful on targets with no headphones plug detection: have a separate configs for AC/DC operations. May not work well for people who use headphones on AC power but for others who switch between headphones and docking should, work quite well.