# UAVCAN/serial: issues with DMA friendliness and bandwidth overhead

**URL:** <https://forum.opencyphal.org/t/uavcan-serial-issues-with-dma-friendliness-and-bandwidth-overhead/846>\
**Category:** Development & Maintenance\
**Created:** [May 23, 2020, 7:19pm UTC](https://forum.opencyphal.org/t/uavcan-serial-issues-with-dma-friendliness-and-bandwidth-overhead/846 "2020-05-23T19:19:11Z")\
**Posts on this page:** 9\
**Page:** 3

<div class="post-metadata">

**Author:** ![VadimZ](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/vadimz/32/434_2.png) [@VadimZ](https://forum.opencyphal.org/u/VadimZ)\
**Post date:** [October 9, 2020, 4:01pm UTC](https://forum.opencyphal.org/t/uavcan-serial-issues-with-dma-friendliness-and-bandwidth-overhead/846/41 "2020-10-09T16:01:10Z")

</div>

Sure, however I don’t see this branch now. Was it merged already ?

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [October 9, 2020, 4:01pm UTC](https://forum.opencyphal.org/t/uavcan-serial-issues-with-dma-friendliness-and-bandwidth-overhead/846/42 "2020-10-09T16:01:57Z")

</div>

Yes.

---

<div class="post-metadata">

**Author:** ![VadimZ](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/vadimz/32/434_2.png) [@VadimZ](https://forum.opencyphal.org/u/VadimZ)\
**Post date:** [October 10, 2020, 12:01pm UTC](https://forum.opencyphal.org/t/uavcan-serial-issues-with-dma-friendliness-and-bandwidth-overhead/846/43 "2020-10-10T12:01:31Z")

</div>

First draft is here: [https://github.com/flytrex-vadim/pyuavcan/commit/532f4ee35e39052d96fb479761fdfa491a73e4b8](https://github.com/flytrex-vadim/pyuavcan/commit/532f4ee35e39052d96fb479761fdfa491a73e4b8)

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [October 10, 2020, 12:07pm UTC](https://forum.opencyphal.org/t/uavcan-serial-issues-with-dma-friendliness-and-bandwidth-overhead/846/44 "2020-10-10T12:07:50Z")

</div>

That looks good, thank you. I have a few notes:

- Please do not list runtime dependencines in `requirements.txt`, this file is for dev deps only, as indicated in the header. The COBS library should go into `setup.cfg` under `extras_require.transport_serial`:

> <https://github.com/UAVCAN/pyuavcan/blob/89fec1e658d5770b8e56a31a6a4e9259c7b4826e/setup.cfg#L44>

- Please try to minimize unnecessary whitespace change.

---

<div class="post-metadata">

**Author:** ![VadimZ](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/vadimz/32/434_2.png) [@VadimZ](https://forum.opencyphal.org/u/VadimZ)\
**Post date:** [October 10, 2020, 12:30pm UTC](https://forum.opencyphal.org/t/uavcan-serial-issues-with-dma-friendliness-and-bandwidth-overhead/846/45 "2020-10-10T12:30:19Z")

</div>

Fixed whitespace (bad pycharm setting) and dependencies

[https://github.com/flytrex-vadim/pyuavcan/commits/cobs](https://github.com/flytrex-vadim/pyuavcan/commits/cobs)

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [October 10, 2020, 12:40pm UTC](https://forum.opencyphal.org/t/uavcan-serial-issues-with-dma-friendliness-and-bandwidth-overhead/846/46 "2020-10-10T12:40:16Z")

</div>

Okay. There are some nits like a commented-out string and some remaining whitespace but I think if the tests pass, we should be good to open a PR for a thorough review. Do the tests pass? Let me know if you need help setting up the test environment (although I think (or hope) it should be fairly straightforward).

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [October 10, 2020, 12:53pm UTC](https://forum.opencyphal.org/t/uavcan-serial-issues-with-dma-friendliness-and-bandwidth-overhead/846/47 "2020-10-10T12:53:36Z")

</div>

Ah, also, would you be inclined to update the docs for the serial transport as well? Most of them are in ` __init__.py` of pyuavcan.transport.serial.

---

<div class="post-metadata">

**Author:** ![VadimZ](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/vadimz/32/434_2.png) [@VadimZ](https://forum.opencyphal.org/u/VadimZ)\
**Post date:** [October 10, 2020, 1:11pm UTC](https://forum.opencyphal.org/t/uavcan-serial-issues-with-dma-friendliness-and-bandwidth-overhead/846/48 "2020-10-10T13:11:22Z")

</div>

All the tests pass at the \transport level.  
At the whole pyuavcan level there are some dsdl test failures that are probably setup-related (PYTHONASYNCIODEBUG)

created PR after few more fixes incl your nits

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [October 10, 2020, 5:03pm UTC](https://forum.opencyphal.org/t/uavcan-serial-issues-with-dma-friendliness-and-bandwidth-overhead/846/49 "2020-10-10T17:03:57Z")

</div>

Thank you, @VadimZ. The UAVCAN/serial transport PoC is now officially based on COBS, and it is highly likely that this implementation will end up being formally specified in UAVCAN v1.1.

> <https://github.com/OpenCyphal/pycyphal/pull/126>
>
> Switched from brute-force escaping to COBS for serial protocol serialization

[Previous page](https://forum.opencyphal.org/t/uavcan-serial-issues-with-dma-friendliness-and-bandwidth-overhead/846.md?page=2)
