Use pointers for internal mappings

12 views
Skip to first unread message

Mathias Bredholt

unread,
Apr 1, 2020, 3:49:50 PM4/1/20
to dot_mapper
Hi, would it be possible to adapt libmapper such that when doing mappings between signals on the same device, the signals are simply sent by referencing pointers instead of using loopback?

Cheers,
Mathias

Joseph Malloch

unread,
Apr 1, 2020, 4:19:20 PM4/1/20
to dot_m...@googlegroups.com
Hi Mathias,

Yes this is definitely possible though we have to ensure we don’t create any update loops – right now running local maps through liblo messaging also serves as a throttle. I think the simplest solution would be to mark local maps as updated but only process the updates during mapper_device_poll() when incoming OSC messages are processed. Otherwise we need to detect and throttle update loops which would likely be much more complicated.

Any thoughts?

Cheers,
Joe

--
You received this message because you are subscribed to the Google Groups "dot_mapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dot_mapper+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dot_mapper/9eb165d3-2c01-4094-9581-14c23d0870a1%40googlegroups.com.

Stephen Sinclair

unread,
Apr 2, 2020, 5:01:24 AM4/2/20
to dot_m...@googlegroups.com
In DIMPLE, I handled the local situation using a shared memory message
passing buffer!

Don't know if that's better/worse, it puts the abstraction at a higher
level but still has the overhead of OSC serializing/parsing for no
real benefit.. something more custom and lean for libmapper would
definitely make sense.

Steve
> To view this discussion on the web visit https://groups.google.com/d/msgid/dot_mapper/FFCCB087-6B88-4236-A2FC-BBE41B7E86AB%40gmail.com.

Mathias Bredholt

unread,
Apr 3, 2020, 3:32:23 PM4/3/20
to dot_mapper
Yes this is definitely possible though we have to ensure we don’t create any update loops

I see, I think it's reasonable to do the update in mapper_device_poll. I will give it a try! 

On Thursday, 2 April 2020 05:01:24 UTC-4, Stephen Sinclair wrote:
In DIMPLE, I handled the local situation using a shared memory message
passing buffer!

Don't know if that's better/worse, it puts the abstraction at a higher
level but still has the overhead of OSC serializing/parsing for no
real benefit.. something more custom and lean for libmapper would
definitely make sense.

Steve

On Wed, Apr 1, 2020 at 10:19 PM Joseph Malloch <joseph...@gmail.com> wrote:
>
> Hi Mathias,
>
> Yes this is definitely possible though we have to ensure we don’t create any update loops – right now running local maps through liblo messaging also serves as a throttle. I think the simplest solution would be to mark local maps as updated but only process the updates during mapper_device_poll() when incoming OSC messages are processed. Otherwise we need to detect and throttle update loops which would likely be much more complicated.
>
> Any thoughts?
>
> Cheers,
> Joe
>
> On 1 Apr 2020, at 16:49, Mathias Bredholt <mathias...@gmail.com> wrote:
>
> Hi, would it be possible to adapt libmapper such that when doing mappings between signals on the same device, the signals are simply sent by referencing pointers instead of using loopback?
>
> Cheers,
> Mathias
>
> --
> You received this message because you are subscribed to the Google Groups "dot_mapper" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dot_m...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dot_mapper/9eb165d3-2c01-4094-9581-14c23d0870a1%40googlegroups.com.
>
>
> --
> You received this message because you are subscribed to the Google Groups "dot_mapper" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dot_m...@googlegroups.com.

Joseph Malloch

unread,
May 8, 2020, 10:11:58 AM5/8/20
to dot_m...@googlegroups.com
Hi Mathias,

I had a go at implementing local mappings while preventing local update loops – this feature is now added to the v2-devel branch.

Cheers,
Joe

To unsubscribe from this group and stop receiving emails from it, send an email to dot_mapper+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dot_mapper/288dc33a-1f6b-4429-9a5b-f19c58bc3563%40googlegroups.com.

Mathias Bredholt

unread,
May 8, 2020, 3:50:36 PM5/8/20
to dot_m...@googlegroups.com
Hi Joe,

Amazing! I had also been working on an implementation, but it isn’t done, so this is great! My implementation was useful to test local mappings on ESP32, as I needed to test the performance impact - it seemed to be quite a lot more efficient with pointers instead of loopback packets!

I will test your implementation in the coming days.

Thanks!

Cheers,
Mathias

Joseph Malloch

unread,
May 8, 2020, 7:42:11 PM5/8/20
to dot_m...@googlegroups.com
Hi Mathias,

Thanks - I hope it helps! For now it’s still building buffered OSC messages but now it passes them directly to the message handler rather than through loopback. Later we can optimize to avoid building the OSC messages at all but this would involve a lot of hacking since the handler deals with coordinating signal instances.

Cheers,
Joe

Reply all
Reply to author
Forward
0 new messages