diff --git a/include/media/stagefright/AudioSource.h b/include/media/stagefright/AudioSource.h
index 2597e9e..1af4254 100644
--- a/include/media/stagefright/AudioSource.h
+++ b/include/media/stagefright/AudioSource.h
@@ -49,7 +49,17 @@
     virtual ~AudioSource();
 
 private:
-    enum { kMaxBufferSize = 2048 };
+    enum {
+        kMaxBufferSize = 2048,
+
+        // After the initial mute, we raise the volume linearly
+        // over kAutoRampDurationUs.
+        kAutoRampDurationUs = 300000,
+
+        // This is the initial mute duration to suppress
+        // the video recording signal tone
+        kAutoRampStartUs = 700000,
+      };
 
     AudioRecord *mRecord;
     status_t mInitCheck;
@@ -67,6 +77,12 @@
 
     void trackMaxAmplitude(int16_t *data, int nSamples);
 
+    // This is used to raise the volume from mute to the
+    // actual level linearly.
+    void rampVolume(
+        int32_t startFrame, int32_t rampDurationFrames,
+        uint8_t *data,   size_t bytes);
+
     AudioSource(const AudioSource &);
     AudioSource &operator=(const AudioSource &);
 };
diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp
index c8dfede..4c729e4 100644
--- a/media/libstagefright/AudioSource.cpp
+++ b/media/libstagefright/AudioSource.cpp
@@ -40,6 +40,7 @@
       mGroup(NULL) {
 
     LOGV("sampleRate: %d, channels: %d", sampleRate, channels);
+    CHECK(channels == 1 || channels == 2);
     uint32_t flags = AudioRecord::RECORD_AGC_ENABLE |
                      AudioRecord::RECORD_NS_ENABLE  |
                      AudioRecord::RECORD_IIR_ENABLE;
@@ -158,6 +159,38 @@
 
 }
 
+void AudioSource::rampVolume(
+        int32_t startFrame, int32_t rampDurationFrames,
+        uint8_t *data,   size_t bytes) {
+
+    const int32_t kShift = 14;
+    int32_t fixedMultiplier = (startFrame << kShift) / rampDurationFrames;
+    const int32_t nChannels = mRecord->channelCount();
+    int32_t stopFrame = startFrame + bytes / sizeof(int16_t);
+    int16_t *frame = (int16_t *) data;
+    if (stopFrame > rampDurationFrames) {
+        stopFrame = rampDurationFrames;
+    }
+
+    while (startFrame < stopFrame) {
+        if (nChannels == 1) {  // mono
+            frame[0] = (frame[0] * fixedMultiplier) >> kShift;
+            ++frame;
+            ++startFrame;
+        } else {               // stereo
+            frame[0] = (frame[0] * fixedMultiplier) >> kShift;
+            frame[1] = (frame[1] * fixedMultiplier) >> kShift;
+            frame += 2;
+            startFrame += 2;
+        }
+
+        // Update the multiplier every 4 frames
+        if ((startFrame & 3) == 0) {
+            fixedMultiplier = (startFrame << kShift) / rampDurationFrames;
+        }
+    }
+}
+
 status_t AudioSource::read(
         MediaBuffer **out, const ReadOptions *options) {
     *out = NULL;
@@ -242,6 +275,19 @@
             continue;
         }
 
+        if (mPrevSampleTimeUs - mStartTimeUs < kAutoRampStartUs) {
+            // Mute the initial video recording signal
+            memset((uint8_t *) buffer->data(), 0, n);
+        } else if (mPrevSampleTimeUs - mStartTimeUs < kAutoRampStartUs + kAutoRampDurationUs) {
+            int32_t autoRampDurationFrames =
+                    (kAutoRampDurationUs * sampleRate + 500000LL) / 1000000LL;
+
+            int32_t autoRampStartFrames =
+                    (kAutoRampStartUs * sampleRate + 500000LL) / 1000000LL;
+
+            int32_t nFrames = numFramesRecorded - autoRampStartFrames;
+            rampVolume(nFrames, autoRampDurationFrames, (uint8_t *) buffer->data(), n);
+        }
         if (mTrackMaxAmplitude) {
             trackMaxAmplitude((int16_t *) buffer->data(), n >> 1);
         }
