Uniquify object instances in included conf files - #188
Closed
ranj063 wants to merge 2 commits into
Closed
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>
ranj063
force-pushed
the
fix/conf_includes
branch
2 times, most recently
from
January 24, 2023 16:43
52347ff to
986163f
Compare
Contributor
Author
|
@perexg conflicts fixed now. |
ranj063
force-pushed
the
fix/conf_includes
branch
2 times, most recently
from
January 26, 2023 23:13
204007a to
b87c3d7
Compare
lyakh
approved these changes
Jan 27, 2023
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>
ranj063
force-pushed
the
fix/conf_includes
branch
from
February 2, 2023 19:47
b87c3d7 to
e688c46
Compare
Contributor
Author
|
@perexg Could I please bother you to have a look at this PR? This will help us simplify included conf files. |
Member
|
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 |
Contributor
Author
@perexg Thanks for the suggestion. Let me try the arrays and get this working with snd_config_merge(). |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.