Skip to content
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

problem about default alsa.xml in PluginRoutingAdapterAlsa #37

Open
chengyi opened this issue Aug 4, 2018 · 3 comments
Open

problem about default alsa.xml in PluginRoutingAdapterAlsa #37

chengyi opened this issue Aug 4, 2018 · 3 comments

Comments

@chengyi
Copy link

chengyi commented Aug 4, 2018

In default alsa.xml, the gateway's source (sink) is not visible, but in the code:

 if ((info.srcClsNam.length() != 0) && (source.visible == true))
 {
        peekSourceClassID(info.srcClsNam, source.sourceClassID);
 }

when the source is visible, then it has source class id which must be used in registering source.

how to fix this?

make the gateway source visible or modify source code?

@JensLorenz
Copy link
Contributor

JensLorenz commented Aug 6, 2018

Short answer - the controller need to register a source class with ID=1 at database.
This represent either the BASE source as configured in {{alsa.xml}} or you use this for all the hidden sources (and sinks) as kind of "DUMMY" class.
The function to register classes is IAmControlReceive::enterSourceClassDB and ::enterSinkClassDB.
The ID=1 is predefined in the parser https://github.com/GENIVI/AudioManagerPlugins/blob/master/PluginRoutingAdapterALSA/src/CAmRoutingAdapterALSAParser.cpp#L89.

REASON:
Gateways and its sources and sinks shall be not published to applications. Applications are only interested in connecting MainSources to MainSinks - see https://genivi.github.io/AudioManager/views.html.
The Gateway pattern is a mechanism to connect different domains together and they are only used inside the route suggestion IAmControlReceive::getRoute and can be important to know by controller too.

CLASS ID Ownership:
The classID needs to be known at least at the point were the controller receives the registration request from routing side via IAmControlSend::hookSystemRegisterSource or ::hookSystemRegisterSink and delegates it to the final registration on IAmControlReceive::enterSourceDB and ::enterSinkDB.
Hence the gateway elements are not need to be assigned to a classID we skip it simply to save a call e.g. via DBus and in case it is needed to be filled out the controller can do so (Generic Controller does it).

PSS:
Watch out, the Send or Receive interface are named from the Daemon point of view!

@chengyi
Copy link
Author

chengyi commented Aug 10, 2018

@JensLorenz I use GenericController, But it seems can't specify class id in config xml.
does it need to modify code?

@JensLorenz
Copy link
Contributor

I checked the code and at the end if feels like an inconsistency between ALSA Routing Adapter and Generic Controller. Currently the controller is not able to register a specific id at all.
Even if, there should be a mechanism for the ALSA Routing Adatper to register the classID directly.

Therefore, try to remove the visibility check you provided in the code snippet of ALSA Routing Adapter.
This should work. I would love the see a patch than.
Thx in advance for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants