Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - jjtempey85

#1
Camera-specific Development / Re: Canon 6D
August 12, 2016, 01:08:32 PM
*EDIT* - I forgot the registers I had to port over from Tragic Lantern in audio.h.  All better now.

I got tired of not having headphone monitoring on my 6D, so I hacked it in over the course a few evenings.  Turns out people have already done some work in this space, so once I figured out how the code works I was able to complete the exercise.  It works on my 6D, but try at your own risk.  Any comments or feedback is welcome - I haven't coded in C in a long time, so I probably did something dumb in the process.  There is still some sketchiness in its operation - don't take a picture while you're in video mode, for instance - but it does work.  You may need to cycle the headphone monitoring configuration option once before you plug in the cable.

For those that are interested in doing this yourself on your version of the source code, the following changes had to be made:

* /platform/6D.116
** features.h
*** Enable headphone monitoring by adding

#define FEATURE_HEADPHONE_MONITORING
#define FEATURE_HEADPHONE_OUTPUT_VOLUME

*** I only enabled headphone monitoring because other parts of code are broken on the 6D, or in the case of analog gain, the registers or values to put in them are incorrect and would cause the input gain to be basically zero.

** internals.h
*** Uncomment #define CONFIG_AUDIO_CONTROLS
*** This is necessary because there are various checks in the code to ensure that the *entire* audio subsystem is enabled, like in audio_configure(), not just one part of audio subsystem.

* src
** all_features.h
*** Comment out the following lines, as they are not working yet, but the #define for the *entire audio subsystem mentioned above is required for the audio subsystem to function at all

//#define FEATURE_ANALOG_GAIN
//#define FEATURE_DIGITAL_GAIN
//#define FEATURE_AGC_TOGGLE
//#define FEATURE_WIND_FILTER
//#define FEATURE_INPUT_SOURCE
//#define FEATURE_MIC_POWER


** audio.h
*** Added the following method to be able to write to the audio-ic - turns out somebody already figured out the how to write to this interface.

inline void _audio_ic_write(unsigned cmd)
{
    extern void _audio_ic_write_bulk(uint32_t spell[]);
    uint32_t spell[] = { cmd << 16, 0xFFFFFFFF };
    _audio_ic_write_bulk(spell);
}

Add the following #elif block to the register definitions - ported from Tragic Lantern

  #elif defined(CONFIG_6D)
    #define AUDIO_IC_PM1    0x8000
    #define AUDIO_IC_PM2    0x8100

    #define AUDIO_IC_SIG1   0x8200
    #define AUDIO_IC_SIG2   0x8300

    #define AUDIO_IC_MODE3  0x8E00
    #define AUDIO_IC_PM3 0x9000
    #define AUDIO_IC_ALCVOL 0x8D00
    #define AUDIO_IC_ALC1   0x8700

    #define AUDIO_IC_IVL    0x8900
    #define AUDIO_IC_IVR    0x8C00
    #define AUDIO_IC_MODE4  0x8F00

    #define AUDIO_IC_FIL1   0x9100