Author Topic: Anyone find any Sound Events / Recording Access?  (Read 3416 times)

Offline PhyrePhoX

  • Global Moderator
  • Guru Member
  • *****
  • Posts: 2254
  • make RAW not WAR
    • PhyreWorX
Re: Anyone find any Sound Events / Recording Access?
« Reply #15 on: 28 / July / 2008, 03:16:27 »
thanks! now i managed that it actually works. using this patch and the right adress.

Diff pastecode - collaborative debugging tool

thanks!

by the way, using BOTH adresses worked, though i can find the first one much faster.
note: the camera MUST NOT be set to MUTE (had it muted at first, thats why i didnt realize it is already working, i'm so stupid :D) - also: you HAVE TO Set sounds in the custom menu, so for example for the startsound, it will only be played if you can hear it when you start the cam. (maybe we can also find a way to UNMUTE the cam when you play the sound, so you dont have to start the cam unmuted)
using this patch on juciphox you can play the startsound when you press UP when you enable the fast ev switch in the photo overrides menu (this is just ALPHA).

fine, now i only have to search the adresses for temperature & playsound in IDA.
thanks ewavr (maybe you can have a look in my patch if i did the actual implementation right!?), many many thanks!

todo: find adresses, clean up, implement it to be used in script.

by the way ewavr, i think we dont need the clear function, i can play the sound continuially, meaning: i can hit the UP button (in my example code) multiple time, the sound is played everytime even though the old one wasnt finished (of course you dont hear the two simultaneously)
« Last Edit: 28 / July / 2008, 03:20:39 by PhyrePhoX »

Offline PhyrePhoX

  • Global Moderator
  • Guru Member
  • *****
  • Posts: 2254
  • make RAW not WAR
    • PhyreWorX
Re: Anyone find any Sound Events / Recording Access?
« Reply #16 on: 29 / July / 2008, 05:54:03 »
Quote
0x400D - continuous "beeee"
interesting, 400D :D one thing i noticed about this: it can be played with the others at the same time! Also, the beep will NOT stop, unless you play another sound, but it doesnt stop instantly, have to find out how and when it does stop to be able to reproduce it.
while coding the implementation i sometimes felt like a DiskJockey (used canons crappy default sounds with the bird and the dog and so on, like on a cheap keyboard with the effects buttons jammed up :D). this BEEP will come in handy in anti-theft protection ;)
anyhow, i implemented it this way:

Code: C
  1. void play_sound(short sound)
  2. {
  3.         short tmp;
  4.     switch (sound)
  5. {
  6.   case 0:
  7.     tmp = 0x2001; //startup sound
  8.     break;
  9.   case 1:
  10.     tmp = 0x2002; //shutter sound
  11.     break;
  12.   case 2:
  13.     tmp = 0x2003; //button press sound
  14.     break;
  15.   case 3:
  16.     tmp = 0x2004; //self-timer sound
  17.     break;
  18.   case 4:
  19.    tmp = 0xC211; //short beep
  20.     break;
  21.   case 5:
  22.    tmp = 50000; // AF confirmation
  23.     break;
  24.   case 6:
  25.    tmp = 0xC507; // error beep imo
  26.     break;
  27.   case 7:
  28.    tmp = 0x400D; // LONG ERROR BEEP CONTINIUOUS- warning, cannot be stopped (yet)
  29.     break;
  30.  }
  31.     _PT_PlaySound(tmp, 0);
  32. }
and i can also call this from ubasic via "playsound 1" for example.

notice that you have to enable the sounds in the customizing menu and also set each sound so that it isnt muted in the menu. we might find a way to unmute sound before or while playing sound via ubasic.

Offline PhyrePhoX

  • Global Moderator
  • Guru Member
  • *****
  • Posts: 2254
  • make RAW not WAR
    • PhyreWorX
Re: Anyone find any Sound Events / Recording Access?
« Reply #17 on: 03 / August / 2008, 23:02:29 »
hm, there is a string _MuteOn and a string _MuteOff, can we perhaps find a function to mute/unmute the camera?
so in script we can do something like

mute 1 //mutes the cam
press button //wont produce sound
mute 0 //unmutes cam
playsound 1 //plays sound, for example in a counter or for other things
mute 1
...

i call unto the gods of chdk & asm. please help ;)

Offline fudgey

  • Global Moderator
  • Guru Member
  • *****
  • Posts: 1690
  • a570is
Re: Anyone find any Sound Events / Recording Access?
« Reply #18 on: 05 / August / 2008, 02:59:24 »
hm, there is a string _MuteOn and a string _MuteOff, can we perhaps find a function to mute/unmute the camera?
so in script we can do something like

mute 1 //mutes the cam
press button //wont produce sound
mute 0 //unmutes cam
playsound 1 //plays sound, for example in a counter or for other things
mute 1
...

i call unto the gods of chdk & asm. please help ;)


Erm well you didn't say which firmware that screenshot came from, but for my camera I'd try

a570is 1.00e
ffc1854c _MuteOn
ffc18598 _MuteOff
and even before that I'd take a look at RAM address 0x2414, which looks like it's 1 when muted, 0 when not muted. It might be a good idea to monitor it before calling those functions in order to find exactly what "Mute" means in this context.

I didn't try any of this. Writing to that RAM address will not mute/unmute as far as I can guess, but changing it's value outside these functions may prevent the camera from muting an unmuted camera and vice versa by making it think it's been muted/unmuted).

For your screenshot, I'd try monitoring the memory address 0x7968 for the same exact behavior and use 0xff9c5048 for entry point to _MuteOff and 0xff9c4ffc for _MuteOn entry point.


Offline PhyrePhoX

  • Global Moderator
  • Guru Member
  • *****
  • Posts: 2254
  • make RAW not WAR
    • PhyreWorX
Re: Anyone find any Sound Events / Recording Access?
« Reply #19 on: 05 / August / 2008, 04:07:20 »
thanks, will look into it! did you have a look on the other thread about the evf compensation tutorial you wrote? got a question there. it all boils down to me being such a lame asm reader :D
btw, is there any reason you dont actively code besides scripts? you seem to have the knowledge to find out a lot of the inner workings of these cameras. so i assume.

Offline fudgey

  • Global Moderator
  • Guru Member
  • *****
  • Posts: 1690
  • a570is
Re: Anyone find any Sound Events / Recording Access?
« Reply #20 on: 05 / August / 2008, 15:08:23 »
thanks, will look into it! did you have a look on the other thread about the evf compensation tutorial you wrote? got a question there. it all boils down to me being such a lame asm reader :D
Yep, replied now.

btw, is there any reason you dont actively code besides scripts? you seem to have the knowledge to find out a lot of the inner workings of these cameras. so i assume.

So much to do, so little time... added to the fact that I'm not much of a coder (measured in skill and interest) when it comes to larger chunks of code far away from the hardware.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal