-
Notifications
You must be signed in to change notification settings - Fork 155
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
Reduce voice RAM and ROM needs #665
base: master
Are you sure you want to change the base?
Conversation
Making progress, but still pretty heavy on the ROM: devo7e without standard GUI: devo7e w/out standard GUI, HAS_EXTENDED_AUDIO devo7e w/out standard GUI, HAS_EXTENDED_AUDIO && HAS_MUSIC_CONFIG |
more than 0.6 kB of ROM still goes to config system - looking forward to #626 |
which function? |
Values below are the "bad" functions in devo7e with and without voice features. I guess MUSIC_PlayValue, TIMER_Update and TELEMETRY_Alarm are excused, since they add some new functionality. I was surprised at the cost for the two new muxes in MIXER_ApplyMixer.
|
4f4bef9
to
f512654
Compare
This is probably as good as it gets for now. There are stil some minor issues with the voice implementation, but they'll get fixed in a different PR, as this one was about reducing ROM and RAM usage. I know the struct CustomVoice pretty pointless right now, but for the future I'm thinking of adding a flag for vibration, so this will become useful. Anyways, waiting for reviews and if satisfied, please squash. |
@PhracturedBlue the other cases won't work, because compiler complains about struct or variables not being defined. But if we do define them by excluding them from the pp if, thecompiler complains because they are not used |
Works like a charm on T8SGV2+ |
b37ca74
to
b15c674
Compare
@howard0su screenshot test fails: |
OK.. Without any custom voice entries in voice.ini voice will currently be disabled, and thus voiceconfig page will show up different. I guess this behavior is not quite correct, as we could have global alarms defined in voice.ini, but no custom alarms. We then could still have voice working, but voice config menu is not available. Will have to think of a way to check that a valid voice.ini exists, but not quite sure how to do so yet... |
c5304b2
to
1c310b5
Compare
3a551ba
to
0416d69
Compare
e5ba480
to
942a33c
Compare
Assuming this is all tested and works well, the code looks fine to me.... bear in mind that I'm pretty inexperienced and don't know the project well yet though. I see that it only deals in external voice IDs now though... It's probably good, and half solves #999 in the process, but does introduce the small chance for issues loading old models with an abnormal voice.ini. (though it does make it essentially impossible to add support for gaps in numbering) It would be possible to adopt a system of referencing voice.ini by line number rather than key names, which would behave more like the old system and allow for an almost identical solution to what I already proposed for #999. (models would take longer to load due to repeated config parsing, but it'd require benchmarking to figure out how significant it is) |
I think the code is significantly better with these changes, but far from good. Yes, I tested them thoroughly and didn't find any issues. Using line numbers is an interesting idea, so before introducing this potentially backwards compatibility breaking change, would you have time to use this branch as a base for reworking #999? |
yeah, I'll try to have a look into it; or at least see how much work it would be to make behaviour identical to the old system for reimplementation of #1000 at another time. |
Here's a commit that seems to make voice loading match the old behaviour: somewhatlurker@d34f6f4 Tested using a voice.ini containing the following, exhibiting misordered and missing ids:
Under both current master code and my branch (tested in zip_win_emu_t8sg_v2), Another issue is that you can't reach the end of the list due to non-contiguous numbering. That could be fixed by either using the line number referencing in the voice config page or recording the maximum ID rather than number of IDs to |
An update on what I've been doing: https://github.com/somewhatlurker/deviation/tree/voice_diet2 has been updated to use essentially the same system as #1000 to load both old and new entries correctly, however it uses the "+" prefix to at least maintain some level of support for loading new models in older firmware. The meaning of the prefix should probably be explained in the manual if these changes are used. It also makes all IDs up to the maximum used one accessible in model voice config. IDs with no voice will have the label "[ID#] (missing)". (it might make sense to have this translatable, but I'm not sure how to do that) |
Your work looks fine. Translation should be triggered with I'd personally be fine with a breaking change if we could also add more config options for voice sounds, like setting additional flags for vibration and buzzer. Currently running both is crudely implemented through sound.ini for the global sounds, carried over from the original voice work not done by me. |
Yeah, I see what you mean about bloat after checking the full diff for my changes. I suppose cherry picking 5776c82 and ef11399 (and just the voiceconfig_page.c changes from d34f6f4) to only fix actual issues would be fine if code size is a concern. (though retaining guaranteed compatibility would be nice) I feel you on the features front, but the audio system still seems pretty daunting to me with all the stuff in there together. Obviously an entirely new design for everything would be best, but that's definitely not something I can help with when I don't even understand the full scope of current features well. Would you want to work on the design or is that just a hypothetical scenario right now? |
My time is limited, but the Music/Voice topic is actually not too big to tackle, so probably something we could easily optimize. For now, I think making a PR out of voice_diet2 with your patches sounds like good idea to me, after that we two (and maybe @eried if he has time) can discuss further development of voice/sound support in a separate issue. |
No description provided.