-
Notifications
You must be signed in to change notification settings - Fork 151
Uniquify object instances in included conf files #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…asses
Make in mandatory for all class definitions to include the instance
attribute. This will ensure that the objects instantiation is uniform
irrespective of the type of object. For example, a widget can be
instantiated as
Object.Widget.gain.1 {}
And a pipeline can be instantiated as
Object.Pipeline.volume-capture.1 {}
Additionally, when including conf files with its own object
instantiations, this will allow for the alsatplg compiler pre-processor
to uniquify the instance IDs for that there are no clashes. This is done
in the next patch.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
52347ff to
986163f
Compare
|
@perexg conflicts fixed now. |
204007a to
b87c3d7
Compare
Included conf files could contain additional object instantiations with
the same instance ID as the top-level conf file. For example, the
top-level conf file could contain a PCM object as below:
Object.PCM {
pcm.10 {
name "ssp-capture"
}
}
If the included conf file could contain a PCM object with the same
instance ID of 1 like:
Object.PCM {
pcm.10 {
name "DMIC"
}
}
In this case when merging the above conf file with the top-level file,
the first PCM object with name "ssp-capture" will get overridden with the
new one "DMIC". To prevent this and add 2 separate PCM instance, this
function makes sure that the instance ID for the PCM object in the
included file does not clash with the top-level object instances. So the
new conf node will modified to automatically increment the instance ID
to be larger than the largest ID in the top-level conf as below before
getting merged.
Object.PCM {
pcm.11 {
name "DMIC"
}
}
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
b87c3d7 to
e688c46
Compare
|
@perexg Could I please bother you to have a look at this PR? This will help us simplify included conf files. |
|
For me, this solution is really complicated, error-prone and very specific. The alsa-lib's conf code can merge arrays, thus if you need a sequence where the identifiers do not play a role, you should use arrays: Main file: Included file: The internal tree (after merge) will look like: The |
@perexg Thanks for the suggestion. Let me try the arrays and get this working with snd_config_merge(). |
No description provided.