Assigning a task to a particular core of esp32 #166
Unanswered
sergio-caracas
asked this question in
Q&A
Replies: 6 comments 2 replies
|
The only way what you are trying to do is possible is if you run separate schedulers per channel in a dedicated freertos tasks pinned to cores.
As a cooperative scheduler, TaskScheduler does not supper true "parallel" execution as all tasks are running in the same thread.
Conceptually this setup is described here:
https://github.com/arkhipenko/dnd
Sent from my mobile implant.
Apologies for autocorrect.
…________________________________
From: sergio-caracas ***@***.***>
Sent: Saturday, May 13, 2023 4:07:14 AM
To: arkhipenko/TaskScheduler ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [arkhipenko/TaskScheduler] Assigning a task to a particular core of esp32 (Discussion #166)
Hello everyone,
I am trying to get two taskscheduler tasks to run in parallel, one in each of the two cores of the esp32, is it possible?
I have two audio filters (left and right channel) but the algorithm is still very heavy and the sample rate I am achieving is quite low.
Thanks in advance if you could share any suggestions!
Cheers,
Sergio
—
Reply to this email directly, view it on GitHub<#166>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AACMMTLOUTV7VPKA7EPSWNLXF46LFANCNFSM6AAAAAAYALBUPU>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
1 reply
|
But you can execute any function on a given CPU with esp_ipc_call().
https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/ipc.html#_CPPv412esp_ipc_call8uint32_t14esp_ipc_func_tPv
…On Sat, May 13, 2023 at 1:03 PM Anatoli Arkhipenko ***@***.***> wrote:
The only way what you are trying to do is possible is if you run separate
schedulers per channel in a dedicated freertos tasks pinned to cores.
As a cooperative scheduler, TaskScheduler does not supper true "parallel"
execution as all tasks are running in the same thread.
Conceptually this setup is described here:
https://github.com/arkhipenko/dnd
Sent from my mobile implant.
Apologies for autocorrect.
________________________________
From: sergio-caracas ***@***.***>
Sent: Saturday, May 13, 2023 4:07:14 AM
To: arkhipenko/TaskScheduler ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [arkhipenko/TaskScheduler] Assigning a task to a particular core
of esp32 (Discussion #166)
Hello everyone,
I am trying to get two taskscheduler tasks to run in parallel, one in each
of the two cores of the esp32, is it possible?
I have two audio filters (left and right channel) but the algorithm is
still very heavy and the sample rate I am achieving is quite low.
Thanks in advance if you could share any suggestions!
Cheers,
Sergio
—
Reply to this email directly, view it on GitHub<
#166>, or
unsubscribe<
https://github.com/notifications/unsubscribe-auth/AACMMTLOUTV7VPKA7EPSWNLXF46LFANCNFSM6AAAAAAYALBUPU
>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
—
Reply to this email directly, view it on GitHub
<#166 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGFFRQLQ43ZL5HGKAYIYL4LXF5S6LANCNFSM6AAAAAAYALBUPU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
.com>
|
0 replies
|
There is no inter-process by design.
Everything runs in the same thread.
You are thinking about this in a multi-threading, multi-process way, and it is not that.
|
0 replies
|
You are completely wrong. Please read the documentation I linked to. Thank
you for your co-operation.
On Sat, May 13, 2023 at 1:23 PM Anatoli Arkhipenko ***@***.***>
wrote:
… There is no inter-process by design.
Everything runs in the same thread.
You are thinking about this in a multi-threading, multi-process way, and
it is not that.
Sent from my mobile implant.
Apologies for autocorrect.
________________________________
From: Mariusz ***@***.***>
Sent: Saturday, May 13, 2023 7:13:08 AM
To: arkhipenko/TaskScheduler ***@***.***>
Cc: Anatoli Arkhipenko ***@***.***>; Comment ***@***.***>
Subject: Re: [arkhipenko/TaskScheduler] Assigning a task to a particular
core of esp32 (Discussion #166)
But you can execute any function on a given CPU with esp_ipc_call().
https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/ipc.html#_CPPv412esp_ipc_call8uint32_t14esp_ipc_func_tPv
On Sat, May 13, 2023 at 1:03 PM Anatoli Arkhipenko ***@***.***>
wrote:
> The only way what you are trying to do is possible is if you run
separate
> schedulers per channel in a dedicated freertos tasks pinned to cores.
>
> As a cooperative scheduler, TaskScheduler does not supper true
"parallel"
> execution as all tasks are running in the same thread.
>
> Conceptually this setup is described here:
> https://github.com/arkhipenko/dnd
>
>
>
> Sent from my mobile implant.
> Apologies for autocorrect.
> ________________________________
> From: sergio-caracas ***@***.***>
> Sent: Saturday, May 13, 2023 4:07:14 AM
> To: arkhipenko/TaskScheduler ***@***.***>
> Cc: Subscribed ***@***.***>
> Subject: [arkhipenko/TaskScheduler] Assigning a task to a particular
core
> of esp32 (Discussion #166)
>
>
> Hello everyone,
>
> I am trying to get two taskscheduler tasks to run in parallel, one in
each
> of the two cores of the esp32, is it possible?
>
> I have two audio filters (left and right channel) but the algorithm is
> still very heavy and the sample rate I am achieving is quite low.
>
> Thanks in advance if you could share any suggestions!
>
> Cheers,
> Sergio
>
> —
> Reply to this email directly, view it on GitHub<
> #166>, or
> unsubscribe<
>
https://github.com/notifications/unsubscribe-auth/AACMMTLOUTV7VPKA7EPSWNLXF46LFANCNFSM6AAAAAAYALBUPU
> >.
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
> —
> Reply to this email directly, view it on GitHub
> <
#166 (comment)>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AGFFRQLQ43ZL5HGKAYIYL4LXF5S6LANCNFSM6AAAAAAYALBUPU>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***
> .com>
>
—
Reply to this email directly, view it on GitHub<
#166 (comment)>,
or unsubscribe<
https://github.com/notifications/unsubscribe-auth/AACMMTP2G4IHSKJLZA3LS3LXF5UEJANCNFSM6AAAAAAYALBUPU>.
You are receiving this because you commented.Message ID: ***@***.***>
—
Reply to this email directly, view it on GitHub
<#166 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGFFRQN7ECUC3DW72RKLAGLXF5VLNANCNFSM6AAAAAAYALBUPU>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
1 reply
|
@arkhipenko I've used esp_ipc_call() many times in TaskCallback functions to evenly distribute the load across the two cpus. This does not require any modifications to the TaskScheduler. I don't really understand why you consider this to be such a big challenge. Knowledge of ESP-IDF is enough. |
0 replies
|
You can try and enable microsecond precision for TaskScheduler. But you might just hit the hardware limit actually.
Sent from my mobile implant.
Apologies for autocorrect.
…________________________________
From: sergio-caracas ***@***.***>
Sent: Sunday, May 14, 2023 11:04:27 AM
To: arkhipenko/TaskScheduler ***@***.***>
Cc: Anatoli Arkhipenko ***@***.***>; Mention ***@***.***>
Subject: Re: [arkhipenko/TaskScheduler] Assigning a task to a particular core of esp32 (Discussion #166)
Thank you very much Mr Arkhipenko!
Very interesting and many things became clearer for me after reading your message and through all the code in your dnd project!
I need to get about 50kHz filter cycle execution on both channels, but my filters are crashing at what I guess is about 200 microseconds (5 kHz).
I shall check if RTOS task granularity can have ticks shorter than 1 millisecond.
Will keep looking for more information.
Cheers and many thanks,
Sergio
—
Reply to this email directly, view it on GitHub<#166 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AACMMTPDJGOPJ4UG2O4CPYLXGDX7XANCNFSM6AAAAAAYALBUPU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello everyone,
I am trying to get two taskscheduler tasks to run in parallel, one in each of the two cores of the esp32, is it possible?
I have two audio filters (left and right channel) but the algorithm is still very heavy and the sample rate I am achieving is quite low.
Thanks in advance if you could share any suggestions!
Cheers,
Sergio
All reactions