-
Notifications
You must be signed in to change notification settings - Fork 6
Add an ability to replay and loop FIFO data #11
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
Conversation
|
I have tried to include these changes into the fx-branch. After doing so I found out a few things:
It is probably prudent to re-think how the logic should work and how the interface should work for this feature. Then implement that. Then LUT-optimization (and review) can be performed. JeffreyH |
|
I updated the loop method to be a combination of AUDIO_CTRL bits 6-7 now. Also, I made it reset only in IDLE state. |
This reverts commit 70a03e0.
|
I accidentally merged this one. If we need to revert, we can merge #19 |
* Add an ability to replay and loop FIFO data * Change FIFO loop method and only restart on sample word boundary
|
This merge has been reverted after discussions on Discord. JeffreyH has some concerns about potential timing problems in this implementation that might unfortunately be costly in LUTs to fix, and it blocks the potential merge of |
This update adds 2 write bits to VERA registers: AUDIO_CTRL bit 6 and AUDIO_RATE bit 7.
Writing 1 to AUDIO_CTRL bit 6 will only reset FIFO's read position to 0. This allows a sample data in the buffer to be replayed any time without refilling it again. AUDIO_RATE bit 7 set will enable looped playback where the read position is automatically reset to 0 if the buffer becomes empty in the next sample. Although an AUDIO_RATE value of 128 will still play at the maximum rate without looping.
Note that a position of 0 here means an internal buffer's address. Which means a FIFO reset (write 1 to AUDIO_CTRL bit 7) is required in order to reset the write position to 0 too before uploading a sample data and make these methods above play correctly.