- Status Closed
- Percent Complete
- Task Type Patches
- Category Music playback
- Assigned To No-one
- Operating System SW-codec
- Severity Low
- Priority Very Low
- Reported Version Release 3.4
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#11232 - Mix pcm and voice in software
This is a work in progress. It compiles in the sim but isn’t nearly ready for committing yet.
I’m attempting to mix pcm and voice just-in-time for playback. This patch creates two small buffers and shrinks an existing buffer to almost nothing (most is currently wasted anyway). The two new buffers are 1024 sample mixing buffers that are mixed by calls from the voice thread. One is the active playing buffer while the other is on standby being mixed. The correct buffers are fed to the DMA automatically when the mixer is enabled.
I’ve tried to keep the mixer ISR callback that actually feeds the DMA small and light, but it remains to be seen whether it runs fast enough on target without draining the DMA FIFO buffer first. It’s possible that some of the callback will have to implemented in ASM or otherwise rewritten.
Not yet implemented:
Playback pause behavior. After hitting pause while mixing, playback will continue until the currently playing mix buffer finished, to avoid cutting off voice playback, then swap to aux only playback seamlessly.
Pause/resume fade. This currently happens in hardware. Making this happen in the callback hasn’t been addressed. Making it work in the callback along with the “rewind” feature hasn’t been looked at yet either.
Others???
2011-06-08 21:22
Reason for closing: Rejected
Additional comments about closing: Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407
Better solution available at
FS#12150
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
Also not yet implemented:
pcmbuf_beep, aka the keyclick function. It currently mixes-in-place in the pcm buffer, but it ought to write to, or maybe be mixed with, the aux buffer instead.
I haven’t been able to work on this for several months. I did considerable work since uploading the first patch, but it’s still very much a work in progress. I’ve synced the patch with r28762, but it probably won’t compile cleanly. It’s been so long I don’t remember. I’m uploading this patch in the hope that someone will find it useful as a starting point for further development. Maybe I’ll be able to develop it further but I don’t know when that will be.
The purpose of this patch was to intercept the normal DMA playback and redirect it to a very small mixing buffer that would mix playback and voice in real time with very low latency. It would get away from mixing voice into the playback buffer as that would prevent resuming playback after a pause cleanly. Instead, it meant to establish two very small mixing buffers, one active and the other standby. The DMA would point to the active one and the other would be mixing in the background. When the DMA was starved for data, the roles would automatically switch. This causes a lot of DMA interrupts but it would only occur if data and voice were playing at the same time. If no voice was playing, then playback operates normally.
I also renamed voice playback to aux playback, in the hopes that it would open up audio insertion to other types of audio than merely voice assistance, such as custom sound files or game sounds.
Synced to r29850.