Audacity plays ca 0ne full not deeper when recorded at 48kHz

This bug report pertains to Audacity 2.2.1 giving this additional version information:
Dateiformat-Unterstützung
libmad (MP3 Import) Aktiviert
libvorbis (Ogg-Vorbis Import und Export) Aktiviert
libid3tag (ID3-Tag-Unterstützung) Aktiviert
libflac (FLAC Import und Export) Aktiviert
libtwolame (MP2 Export) Aktiviert
QuickTime (Import per QuickTime) Deaktiviert
ffmpeg (FFmpeg Import und Export) Aktiviert
gstreamer (Import per GStreamer) Deaktiviert

Kern-Bibliotheken
libsoxr (Abtastratenumwandlung) Aktiviert
PortAudio (Audiowiedergabe und -aufnahme) v19
wxWidgets (Plattformübergreifende GUI Bibliothek) 3.0.3

Funktionen
Theme (Dunkles Theme Extras) Deaktiviert
Nyquist (Erweiterungsunterstützung) Aktiviert
LADSPA (Erweiterungsunterstützung) Aktiviert
Vamp (Erweiterungsunterstützung) Aktiviert
Audio Units (Erweiterungsunterstützung) Deaktiviert
VST (Erweiterungsunterstützung) Aktiviert
LV2 (Erweiterungsunterstützung) Aktiviert
PortMixer (Unterstützung für Soundkarten-Mixer) Aktiviert
SoundTouch (Unterstützung für Änderung von Tonhöhe und Tempo) Aktiviert
SBSMS (Unterstützung für extreme Änderung von Tonhöhe und Tempo) Aktiviert

Erstellungs-Informationen
Erstellung des Programmes: Dec 11 2017
Commit Id: No revision identifier was provided
Erstelltyp: Release-Version
Compiler: GCC 7.2.1
Installation Präfix: /usr
Einstellungen-Ordner: /home/adalbert/.audacity-data

(N.b.: it would be nice if I could extract all this by copy/paste such that it would look here as a table after pasting here)

Audacity is running under XUbuntu 18.04.5 LTS, currently running with Linux kernel 5.4.0-70-generic x86_64.

Conext of finding the Bug

I was testing a Heasdset PC8 USB from Sennheiser in order to check, if this headset is capable of 48kHz sample rate as required for Jamulus.

First I recorded a ca 440Hz tuning fork from a command line:

arecord -f dat -r 60000 -D hw:2,0 -d 5 --channels=1 test.wav

which yielded a message that 60kHz is not supported by the device, but 48kHz would be.

My second test was

arecord -f dat -r 48000 -D hw:2,0 -d 5 --channels=1 test.wav

which yielded the message

Aufnahme: WAVE 'test.wav' : Signed 16 bit Little Endian, Rate: 48000 Hz, mono

I played back test.wav and its pitch was right in Parole and in Audacity.

Further I tested

pactl list short sinks
0	alsa_output.pci-0000_01_00.1.hdmi-stereo-extra2	module-alsa-card.c	s16le 2ch 44100Hz	SUSPENDED
1	alsa_output.pci-0000_00_1b.0.analog-stereo	module-alsa-card.c	s16le 2ch 44100Hz	SUSPENDED
2	alsa_output.usb-Sennheiser_Communications_Sennheiser_USB_headset-00.analog-stereo	module-alsa-card.c	s16le 2ch 48000Hz	SUSPENDED

My conclusion is: The Sennheiser headset PC8 USB is able to be sampled at 48kHz.

The Bug in Audacity

I recorded the ca 440Hz tuning fork using 48000 Hz sampling rate in Audacity. The playback sounds more than a semitone lower! If it were a whole tone, this would correspond to a playback with sampling rate 42736 Hz!

If I export the recording as 48kHz.mp3 and play it back with Parole, the playback comes in the correct pitch. If I import it into Audacity and then play it back, it also plays at the correct pitch.

So there is a reasonable suspicion that something is wrong with the playback of recordings made at 48kHz in Audacity itself (i.e. without going the detours of a format conversion, just staying with the internal representation of the just-made recording inside Audacity).

What settings are you using in the Device Toolbar?
If the recording device is set to “Default” or “Pulse”, try changing it to the “hw” option that corresponds with your recording device (probably “hw:2,0” from looking at your other examples).