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

memcpy_tointerleave allow AUDIO_BLOCK_SAMPLES == 4 #420

Closed
wants to merge 1 commit into from

Conversation

ericfont
Copy link
Contributor

@ericfont ericfont commented Dec 7, 2021

Previous code won't work for AUDIO_BLOCK_SAMPLES < 8. So I would like to add a case for AUDIO_BLOCK_SAMPLES == 4, using the same pattern of interleaving code as for AUDIO_BLOCK_SAMPLES == 8, but just half as much.

I've tested on my Teensy 4.1 with Audio Board Rev D with L/R audio. I haven't looked into the other two functions memcpy_tointerleaveL and memcpy_tointerleaveR but I assume a similar additional case could be done for that.

Previous code won't work for AUDIO_BLOCK_SAMPLES < 8.  So I would like to add a case for AUDIO_BLOCK_SAMPLES == 4, using the same pattern of interleaving code as for AUDIO_BLOCK_SAMPLES == 8, but just half as much.
@@ -85,7 +85,18 @@
pkhtb r6,r8,r7,ASR #16

stmia r0!, {r3,r4,r5,r6}
pop {r4-r8,r14}
pop {r4-r8,r14}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't believe need to push & pop r14 for AUDIO_BLOCK_SAMPLES == 8 or AUDIO_BLOCK_SAMPLES == 4.

@ericfont
Copy link
Contributor Author

ericfont commented Dec 7, 2021

I can look into modifying memcpy_tointerleaveL and memcpy_tointerleaveR to allow AUDIO_BLOCK_SAMPLES == 4 if that is ok.

@ericfont
Copy link
Contributor Author

ericfont commented Dec 7, 2021

actually now I can see how to avoid push & pop, will resubmit a PR

@ericfont
Copy link
Contributor Author

ericfont commented Dec 7, 2021

closed in favor of #423, which works for L & R only as well as LR, and which also avoids push/pops.

@ericfont ericfont closed this Dec 7, 2021
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

Successfully merging this pull request may close these issues.

1 participant