Copperlan wide singleton device

Copperlan wide singleton device

Postby TabSel » 08 Sep 2012, 19:42

Is it possible to create a copperlan wide singleton root device?
TabSel
 
Posts: 38
Joined: 28 Aug 2012, 21:07

Re: Copperlan wide singleton device

Postby CopperPhil » 08 Sep 2012, 21:42

well... what an interesting question! :-)

The answer is yes and no...

A usual way to create a singleton is to store globally its reference and to check if this ref is null before creating the object. You can do the same in CopperLan. The singleton device has a unique deviceID, so it is very easy to know if it is presentor noton the network. If it is already there, the application instance can avoid to cate a new one. In the opposite the application can create the device if it is not yet on the network, my advise would be to use fixed duplicate mode in this case.

so yes, it is possible to create a singletion device, if you mean a device having a unique instance on the network.

But since a device object can be handled only by the owner application (in term of input/output creation, message handling...), you can't share this singleton device between apps...

in conclusion, yes you can create a single instance device on the network. this device can be a unique messaging source/listener, but you can't add inputs/outputs nor process incoming/outgoing messaging from another app than the device owner.

is it clear? :?

/Phil
CopperPhil
 
Posts: 480
Joined: 30 Mar 2011, 15:02
Location: Brussels

Re: Copperlan wide singleton device

Postby TabSel » 09 Sep 2012, 11:07

Guess so,

Say, on machine1, I create the root device. When is it available in the network. I mean, while machine1 creates the root, machine2 queries the network for the unique device I'd, which is not present, cause machine1 isn't finished, so machine2 creates the root device...

Also, if machine1 created the root device, can machine2 add a subdevice to the root?

Sorry if this sounds kind of dumb...
TabSel
 
Posts: 38
Joined: 28 Aug 2012, 21:07

Re: Copperlan wide singleton device

Postby CopperPhil » 09 Sep 2012, 11:45

yes, it is technically possible with CopperLan. The VNM is able to hook sub-devices located in application B to a root device located in application A (in CopperLan, an Application can be located anywhere). however this creates a perception of high complexity since you (as a developer) have to manage two levels of device tree (the first located in each application, the second at the network level) while only the second is visible to the end user... so we decided to remove the API allowing this from the SDK for the moment since the whole developer community does not need that enhanced feature (excepted you maybe :-p).

However if you really need it we could restore this undocumented API.
CopperPhil
 
Posts: 480
Joined: 30 Mar 2011, 15:02
Location: Brussels

Re: Copperlan wide singleton device

Postby TabSel » 09 Sep 2012, 12:01

To be honest, I don't know yet.

I'm trying to design something: aggregating multiple asio hardware devices on multiple machines as servers into the copperlan, with multiple asio driven applications on multiple machines, which can connect to each other and any asio hardware device... There can only be one single asio master device determining the clock, with all others others running unlocked, externally synced to the same clock as the master device and/or resampled...

I'm a software developer, but I'm mostly new to everything windows/c++/copperlan and I'm just trying to get the theory of everything done before even starting designing/coding. I know though that if I ever succeed, it would run based on copperlan ;)
TabSel
 
Posts: 38
Joined: 28 Aug 2012, 21:07

Re: Copperlan wide singleton device

Postby CopperPhil » 09 Sep 2012, 12:30

;) Thanks a lot for your enthousiasm!

well, you can run multiple instances of the same application, resulting in multiple root devices differentiated by their duplicate number. Then, one of these applications can be configured as the master. It can be done automatically (the one having the lowest duplicate number for instance), or manually (at this, some code should be writtento avoid having multiple masters on e same network, can be done using signals).

Finally, you can use CopperLan (network) clock or external (wired) hardware clock depending on the expected accuracy.

Think it simple! CopperLan is a huge framework, we have moved most of the complexity inside it to help developers to keep it simple!
CopperPhil
 
Posts: 480
Joined: 30 Mar 2011, 15:02
Location: Brussels


Return to Generalities