<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - incorrect sample rate when recording a monitor"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=66424">66424</a>
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>lennart@poettering.net
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>pulseaudio-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>incorrect sample rate when recording a monitor
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>pulseaudio-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>maarten-baert@hotmail.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>core
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>PulseAudio
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I was trying to record 'Monitor of Built-in Audio Analog Stereo' at 44.1kHz,
but for some reason PulseAudio actually recorded it at 48kHz. The result is a
44.1kHz audio file that actually contains 48kHz audio, so when it is played
back there is a very noticeable pitch shift and the length is also wrong. I
could reproduce this with my own application (which uses ALSA), Audacity (also
ALSA), arecord and parecord. For the last two I used these commands (while
playing a 44.1kHz MP3 in VLC):

arecord -f S16_LE -c 2 -r 44100 /tmp/alsa-test-44100.wav
parecord --format=s16le --channels=2 --rate=44100 /tmp/pa-test-44100.wav

I also tried recording at 48kHz, and this doesn't fix the problem. The
following commands:

arecord -f S16_LE -c 2 -r 48000 /tmp/alsa-test-48000.wav
parecord --format=s16le --channels=2 --rate=48000 /tmp/pa-test-48000.wav

... would also result in pitch-shifted sound.

I also tried repeatedly switching between the 'monitor' and my microphone (with
pavucontrol), and there was only a pitch shift when I recorded the 'monitor'.

I tried to change some settings in daemon.conf so I restarted PulseAudio, but
it turns out that just restarting made the problem go away. After that I
haven't been able to reproduce it. But I'm sure it was there: I still have the
pitch-shifted audio files and a list of packet timestamps from my application.

I am using Arch Linux and PulseAudio 4.0. I am using the default configuration
except for 'flat-volumes=no'.

I can upload the audio files and packet timestamps if they are useful.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>