That's a good cleanup project; figured out I should apply this patch:
diff -r e90a5d0164ee -r bb2030306d4a platform/100D.101/stubs.S
--- a/platform/100D.101/stubs.S
+++ b/platform/100D.101/stubs.S
@@ -78,1 +78,1 @@
-NSTUB(0xFF112680, SoundDevShutDownIn)
+NSTUB(0xFF115108, SoundDevShutDownIn)
diff -r e90a5d0164ee -r bb2030306d4a platform/6D.116/stubs.S
--- a/platform/6D.116/stubs.S
+++ b/platform/6D.116/stubs.S
@@ -85,1 +85,1 @@
-NSTUB(0xFF11C874, SoundDevShutDownIn)
+NSTUB(0xFF11E8A4, SoundDevShutDownIn)
diff -r e90a5d0164ee -r bb2030306d4a platform/70D.112/stubs.S
--- a/platform/70D.112/stubs.S
+++ b/platform/70D.112/stubs.S
@@ -80,1 +80,1 @@
-NSTUB(0xFF11758C, SoundDevShutDownIn)
+NSTUB(0xFF1195C4, SoundDevShutDownIn)
diff -r e90a5d0164ee -r bb2030306d4a platform/EOSM.202/stubs.S
--- a/platform/EOSM.202/stubs.S
+++ b/platform/EOSM.202/stubs.S
@@ -77,1 +77,1 @@
-NSTUB(0xFF10A920, SoundDevShutDownIn) // Temporarily using address for StopASIFDMAADC to resolve MLV_SND issue
+NSTUB(0xFF10D3A0, SoundDevShutDownIn)
but not sure yet what to do from here.
In beep.c, in WAV recording code (commented out for reasons other than these stubs), we have:
SoundDevActiveIn(0); /* optional for some models */
/* wav recording */
SoundDevShutDownIn(); /* optional for some models */
So far, so good - something that probably activates the sound device, and something that probably turns it off.
Same in mlv_snd:
SoundDevActiveIn(0); /* in mlv_snd_prepare_audio, for all models that have it defined */
/* sound recording between these */
SoundDevShutDownIn(); /* in mlv_snd_stop, for all models that have it defined */
Turning something on with SoundDevActiveIn and off with StopASIFDMAADC looks a bit weird to me.
In shoot.c:
//Enable Audio IC In Photo Mode if off
if (!is_movie_mode())
{
SoundDevActiveIn(0);
}
but nobody turns it off.
The best hint is in beep.c for 6D:
SoundDevActiveIn(0); /* optional for some models */
StartASIFDMAADC(..., asif_rec_continue_cbr, ...) /* all models */
/* wav recording - waits until asif_rec_continue_cbr decides to finish */
/* asif_rec_continue_cbr calls StopASIFDMAADC on its last call (6D only) */
SoundDevShutDownIn(); /* optional for some models */
That makes some sense to me, so I assume all models require StopASIFDMAADC, and some require SoundDevShutDownIn as well.
Nope - older models don't even have the StopASIFDMAADC string in the firmware. It's probably required for all models that have it, and SoundDevShutDownIn is probably nice to have*) for all models that have it.
*) needed, but with minor side effects it it's not there; if it does what I think it does, you will probably see the difference between just StopASIFDMAADC and StopASIFDMAADC+SoundDevShutDownIn with a... multimeter.
SoundDevActiveIn: 5D2, 5D3, 5DSM, 6D, 7D, 7D2M, 7DM, 50D, 60D, 70D, 80D, 100D, 500D, 550D, 600D, 650D, 700D, 750D, 760D, 1100D, 1200D, 1300D, EOSM, EOSM2
SoundDevShutDownIn: 5D3, 5DSM, 6D, 7D, 7D2M, 7DM, 70D, 80D, 100D, 650D, 700D, 750D, 760D, 1200D, 1300D, EOSM, EOSM2.
StartASIFDMAADC: 5D2, 5D3, 6D, 7D, 7DM, 50D, 60D, 70D, 100D, 500D, 550D, 600D, 650D, 700D, 1100D, 1200D, 1300D, EOSM, EOSM2.
StopASIFDMAADC: 6D, 70D, 100D, 500D, 1200D, 1300D, EOSM, EOSM2.
Would be great if you can get a dm-spy log with these functions, to see when/how Canon code calls them (as it's not obvious for me from the disassembly).
Please note I don't know what I'm doing - this part of the code is not mine.