FS#8226 - Enable audio menu for pacbox; enable audio for ipod 5g by putting emu on cop
This patch puts the pacbox emulator onto the cop, leaving the main cpu for audio codec. The COP behaviour is controller by a #define in pacbox.h
If PACBOX_ON_COP is defined, then all iram usage is also turned off, to prevent interference with audio thread.
Additionally, this patch adds an Audio menu (using the playback_control library), which is enabled for all PACBOX_ON_COP and GIGABEAT F-Series builds.
Patch from directly within the apps/plugins/pacbox directory.
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
Updated to fix nano builds
Only tested on ipod 5g (as that is all I have). Could someone with a Gigabeat confirm that pacbox still runs but now has a working Audio Playback menu? Also could someone with any other device confirm that pacbox still works for them?
This is cool though the ultimate plan is to do playback decoding on COP to leave the CPU available for foreground tasks. This would probably keep the SPC codec from operating with the COP trying to run two emulators at once.
When all codecs get moved to COP, pacbox can get moved back to CPU
Updated to get rid of build warning on gigabeat
At jhMikeS’s suggestion, adding cache flush and cachealign_attr code. Probably, it would have been better to use a separate (cachealigned) section for data that needs to be local to cop only rather than sprinkling CACHEALIGN_ATTR thru the codebase.
Fix sim builds (no icache)
The section idea for writeable data is one I’ve been thinking about for awhile and would be preferrable as the general one. I’m not sure how to pull it off in a scalable way (need to read up on the linker script syntax myself). Can we ensure that its size is 0 if nothing is allocated there?
Add to the list any I forgot for sections the COP should have to iself (in core, plugins, and
.data
Of course the same sections must be aligned for CPU so that adjacent and shared .rodata and such don’t play ping-pong.
I think 16 bytes is actually the correct value as well but I played cautious for the moment.
BTW, threads can also switch cores. An implementation that flip-flops the main thread from CPU⇔COP would be a nice test of that capability.
EDIT to clarify: you could switch the main thread to the COP when it’s running emulation and switch back to CPU when leaving the emulation to display menus or whatever. Just use switch_core(int core_num)
For the framebuffer CACHEALIGN_AT_LEAST(16) is preferrable since that automatically selects the greater of the
the cache functions, CACHE_FUNCTION_WRAPPERS(rb) allows use without the “rb→” and allows for the case where cache maintenence APIs are inlines instead of calls.
Fantastic ideas. So while I haven’t taken a look at the linker specs either, I have added the rest. Switching cores seems to work fine (and of course makes the code a touch simpler)
I think just .bss and .data covers it. Would it even be worthwhile having yet another section for data used by /both/ cop and cpu?
I think just .bss and .data covers it. Would it even be worthwhile having yet another section for data used by /both/ cop and cpu?
Syncd
Sync again
Sync again, for the changed interface of switch_core
I realise that this hasn’t been sync’d in a while, but a big part of that reason is that putting pacbox emulation on COP no longer interacts nicely with having mp3 parallelised decoder on cpu/cop , which was added to svn at some point after the last update above. I’ll try and figure out a clean solution at some point (maybe just as simple as improve the pacbox emulation so it doesn’t need so much juice)