Why gst-launch-1.0 is playing at a lower sample rate?

Why gst-launch-1.0 is playing at a lower sample rate? how should I fix it?
https://helpguide.sony.net/high-res/sample1/v1/data/Sample_BeeMoved_96kHz24bit.flac.zip

# same result for: gst-launch-1.0 filesrc location=$HOME/Music/Sample_BeeMoved_96kHz24bit.flac ! flacparse ! flacdec ! pulsesink
gst-launch-1.0 -vvvvv playbin uri=file://$HOME/Music/Sample_BeeMoved_96kHz24bit.flac

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: ring-buffer-max-size = 0
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-size = -1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-duration = -1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: force-sw-decoders = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: use-buffering = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: download = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: uri = file:///home/adr/Music/Sample_BeeMoved_96kHz24bit.flac
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: connection-speed = 0
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: source = "\(GstFileSrc\)\ source"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = audio/x-flac
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = NULL
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstFlacDec:flacdec0.GstPad:src: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
Redistribute latency...
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstFlacDec:flacdec0.GstPad:sink: caps = audio/x-flac, channels=(int)2, framed=(boolean)true, rate=(int)96000, streamheader=(buffer)< 7f464c414301000005664c614300000022048004800006720017f217700370003a6980e5d100c63f5188900c66b6a6a08ce2eb, ... , >
/GstPlayBin:playbin0/GstInputSelector:inputselector0.GstSelectorPad:sink_0: always-ok = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstFlacParse:flacparse0.GstPad:src: caps = audio/x-flac, channels=(int)2, framed=(boolean)true, rate=(int)96000, streamheader=(buffer)< 7f464c414301000005664c614300000022048004800006720017f217700370003a6980e5d100c63f5188900c66b6a6a08ce2eb, ... , >
/GstPlayBin:playbin0/GstInputSelector:inputselector0.GstSelectorPad:sink_0: active = true
/GstPlayBin:playbin0/GstInputSelector:inputselector0: active-pad = "\(GstSelectorPad\)\ sink_0"
/GstPlayBin:playbin0/GstInputSelector:inputselector0.GstPad:src: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink.GstGhostPad:audio_sink.GstProxyPad:proxypad3: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstTee:audiotee.GstTeePad:src_0: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstStreamSynchronizer:streamsynchronizer0.GstStreamSyncPad:src_0: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:abin.GstGhostPad:sink.GstProxyPad:proxypad6: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:abin/GstQueue:aqueue.GstPad:sink: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:abin.GstGhostPad:sink: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstStreamSynchronizer:streamsynchronizer0.GstStreamSyncPad:sink_0: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstTee:audiotee.GstPad:sink: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink.GstGhostPad:audio_sink: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:abin/GstQueue:aqueue.GstPad:src: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:abin/GstQueue:aqueue.GstPad:src: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:abin/GstPlaySinkAudioConvert:aconv.GstGhostPad:sink.GstProxyPad:proxypad4: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:abin/GstPlaySinkAudioConvert:aconv/GstAudioConvert:conv.GstPad:src: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:abin/GstPlaySinkAudioConvert:aconv/GstAudioResample:resample.GstPad:src: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:abin/GstPlaySinkAudioConvert:aconv.GstGhostPad:src: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
Redistribute latency...
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:abin/GstPulseSink:pulsesink0.GstPad:sink: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:abin/GstPlaySinkAudioConvert:aconv.GstGhostPad:src.GstProxyPad:proxypad5: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:abin/GstPlaySinkAudioConvert:aconv/GstAudioResample:resample.GstPad:sink: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:abin/GstPlaySinkAudioConvert:aconv/GstAudioConvert:conv.GstPad:sink: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:abin/GstPlaySinkAudioConvert:aconv.GstGhostPad:sink: caps = audio/x-raw, format=(string)S24_32LE, layout=(string)interleaved, rate=(int)96000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPlayBin:playbin0/GstInputSelector:inputselector0.GstSelectorPad:sink_0: tags = taglist, album=(string)"Bee\ Moved", title=(string)"Bee\ Moved", album-artist=(string)"Blue\ Monday\ FM", extended-comment=(string)"MRAT\=0", artist=(string)"Blue\ Monday\ FM", image=(sample)ffd8ffe000104a46494600010100000100010000ffdb0084000806060706050807070 ...

Both above commands exhibit the same characteristics:

clear; find /proc/asound/ -iname hw_params -exec cat "{}" \; | grep -v [c]closed
# cat /proc/asound/card0/pcm1p/sub0/hw_params yields the same result
access: MMAP_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)           -> I was expecting 96kHz
period_size: 1024
buffer_size: 32768

My default audio output is the optical-out (i.e. I guess iec958:CARD=PCH,DEV=0 → used with pipewire) hence the below result is weird for me (though I’m far from an expert in Linux audio):

gst-launch-1.0 filesrc location=$HOME/Music/Sample_BeeMoved_96kHz24bit.flac ! flacparse ! flacdec ! alsasink device=hw:CARD=PCH,DEV=1
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
ERROR: from element /GstPipeline:pipeline0/GstFlacParse:flacparse0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbaseparse.c(3694): gst_base_parse_loop (): /GstPipeline:pipeline0/GstFlacParse:flacparse0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
ERROR: from element /GstPipeline:pipeline0/GstAlsaSink:alsasink0: The stream is in the wrong format.
Additional debug info:
../gst-libs/gst/audio/gstaudiobasesink.c(1117): gst_audio_base_sink_wait_event (): /GstPipeline:pipeline0/GstAlsaSink:alsasink0:
Sink not negotiated before eos event.
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

All the below fail as above:

gst-launch-1.0 filesrc location=$HOME/Music/Sample_BeeMoved_96kHz24bit.flac ! flacparse ! flacdec ! alsasink device=hw:0,0

gst-launch-1.0 filesrc location=$HOME/Music/Sample_BeeMoved_96kHz24bit.flac ! flacparse ! flacdec ! alsasink device=hw:0,1

gst-launch-1.0 filesrc location=$HOME/Music/Sample_BeeMoved_96kHz24bit.flac ! flacparse ! flacdec ! alsasink device=iec958:CARD=PCH,DEV=0

gst-launch-1.0 filesrc location=$HOME/Music/Sample_BeeMoved_96kHz24bit.flac ! flacparse ! flacdec ! alsasink device=hw:CARD=PCH,DEV=1

Other information:

aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
lavrate
    Rate Converter Plugin Using Libav/FFmpeg Library
samplerate
    Rate Converter Plugin Using Samplerate Library
speexrate
    Rate Converter Plugin Using Speex Resampler
jack
    JACK Audio Connection Kit
oss
    Open Sound System
pipewire
    PipeWire Sound Server
pulse
    PulseAudio Sound Server
speex
    Plugin using Speex DSP (resample, agc, denoise, echo, dereverb)
upmix
    Plugin for channel upmix (4,6,8)
vdownmix
    Plugin for channel downmix (stereo) with a simple spacialization
default
    Default ALSA Output (currently PipeWire Media Server)
hw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    Direct hardware device without any conversions
hw:CARD=PCH,DEV=1
    HDA Intel PCH, ALC1220 Digital
    Direct hardware device without any conversions
hw:CARD=PCH,DEV=3
    HDA Intel PCH, LG TV SSCR2
    Direct hardware device without any conversions
hw:CARD=PCH,DEV=7
    HDA Intel PCH, HDMI 1
    Direct hardware device without any conversions
hw:CARD=PCH,DEV=8
    HDA Intel PCH, HDMI 2
    Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    Hardware device with all software conversions
plughw:CARD=PCH,DEV=1
    HDA Intel PCH, ALC1220 Digital
    Hardware device with all software conversions
plughw:CARD=PCH,DEV=3
    HDA Intel PCH, LG TV SSCR2
    Hardware device with all software conversions
plughw:CARD=PCH,DEV=7
    HDA Intel PCH, HDMI 1
    Hardware device with all software conversions
plughw:CARD=PCH,DEV=8
    HDA Intel PCH, HDMI 2
    Hardware device with all software conversions
sysdefault:CARD=PCH
    HDA Intel PCH, ALC1220 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    Front output / input
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Digital
    IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=PCH,DEV=0
    HDA Intel PCH, LG TV SSCR2
    HDMI Audio Output
hdmi:CARD=PCH,DEV=1
    HDA Intel PCH, HDMI 1
    HDMI Audio Output
hdmi:CARD=PCH,DEV=2
    HDA Intel PCH, HDMI 2
    HDMI Audio Output
dmix:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    Direct sample mixing device
dmix:CARD=PCH,DEV=1
    HDA Intel PCH, ALC1220 Digital
    Direct sample mixing device
dmix:CARD=PCH,DEV=3
    HDA Intel PCH, LG TV SSCR2
    Direct sample mixing device
dmix:CARD=PCH,DEV=7
    HDA Intel PCH, HDMI 1
    Direct sample mixing device
dmix:CARD=PCH,DEV=8
    HDA Intel PCH, HDMI 2
    Direct sample mixing device
usbstream:CARD=PCH
    HDA Intel PCH
    USB Stream Output

dpkg -l gstreamer*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
++±===============================-===============-============-=======================================================
un gstreamer0.10-packagekit (no description available)
ii gstreamer1.0-alsa:amd64 1.22.6-1 amd64 GStreamer plugin for ALSA
un gstreamer1.0-audiosink (no description available)
un gstreamer1.0-audiosource (no description available)
ii gstreamer1.0-clutter-3.0:amd64 3.0.27-3 amd64 Clutter PLugin for GStreamer 1.0
un gstreamer1.0-doc (no description available)
un gstreamer1.0-fluendo-mp3 (no description available)
ii gstreamer1.0-gl:amd64 1.22.6-1 amd64 GStreamer plugins for GL
ii gstreamer1.0-gtk3:amd64 1.22.6-1ubuntu1 amd64 GStreamer plugin for GTK+3
ii gstreamer1.0-libav:amd64 1.22.5-1 amd64 ffmpeg plugin for GStreamer
ii gstreamer1.0-libcamera:amd64 0.1.0-3ubuntu1 amd64 complex camera support library (GStreamer plugin)
ii gstreamer1.0-packagekit 1.2.7-1 amd64 GStreamer plugin to install codecs using PackageKit
ii gstreamer1.0-pipewire:amd64 0.3.79-2 amd64 GStreamer 1.0 plugin for the PipeWire multimedia server
un gstreamer1.0-plugins-bad (no description available)
ii gstreamer1.0-plugins-base:amd64 1.22.6-1 amd64 GStreamer plugins from the “base” set
ii gstreamer1.0-plugins-base:i386 1.22.6-1 i386 GStreamer plugins from the “base” set
ii gstreamer1.0-plugins-base-apps 1.22.6-1 amd64 GStreamer helper programs from the “base” set
ii gstreamer1.0-plugins-good:amd64 1.22.6-1ubuntu1 amd64 GStreamer plugins from the “good” set
ii gstreamer1.0-plugins-good:i386 1.22.6-1ubuntu1 i386 GStreamer plugins from the “good” set
ii gstreamer1.0-plugins-ugly:amd64 1.22.5-1 amd64 GStreamer plugins from the “ugly” set
un gstreamer1.0-plugins-ugly-amr (no description available)
ii gstreamer1.0-pulseaudio:amd64 1.22.6-1ubuntu1 amd64 GStreamer plugin for PulseAudio (transitional package)
ii gstreamer1.0-tools 1.22.5-1 amd64 Tools for use with GStreamer
ii gstreamer1.0-vaapi:amd64 1.22.6-1 amd64 VA-API plugins for GStreamer
un gstreamer1.0-vaapi-doc (no description available)
un gstreamer1.0-videosink (no description available)
un gstreamer1.0-videosource (no description available)
un gstreamer1.0-visualization (no description available)
ii gstreamer1.0-x:amd64 1.22.6-1 amd64 GStreamer plugins for X11 and Pango
ii gstreamer1.0-x:i386 1.22.6-1 i386 GStreamer plugins for X11 and Pango

This does not look like a GStreamer issue then, but an audio system configuration issue?

well, I configured nothing …

Sure, just saying that GStreamer appears to do the right thing according to what it’s being told by the lower-level components, so you would need to look at making lower-level components advertise the higher sample rate, and then GStreamer should pick that up as well.

thanks, any advice on how should I do that?

ffmpeg -i Music/Sample_BeeMoved_96kHz24bit.flac Music/Sample_BeeMoved_96kHz24bit.wav
aplay --fatal-errors --dump-hw-params -v 'Music/Sample_BeeMoved_96kHz24bit.wav'
Playing WAVE 'Music/Sample_BeeMoved_96kHz24bit.wav' : Signed 16 bit Little Endian, Rate 96000 Hz, Stereo
HW Params of device "alsa_playback.aplay":
--------------------
ACCESS:  MMAP_INTERLEAVED MMAP_NONINTERLEAVED RW_INTERLEAVED RW_NONINTERLEAVED
FORMAT:  U8 S16_LE S24_LE S32_LE FLOAT_LE S24_3LE S24_3BE
SUBFORMAT:  STD
SAMPLE_BITS: [8 32]
FRAME_BITS: [8 2048]
CHANNELS: [1 64]
RATE: [1 384000]
PERIOD_TIME: (0 4294967295)
PERIOD_SIZE: (0 2097152]
PERIOD_BYTES: [128 2097152]
PERIODS: [2 1024]
BUFFER_TIME: (2 4294967295]
BUFFER_SIZE: [1 4194304]
BUFFER_BYTES: [256 4194304]
TICK_TIME: ALL
--------------------
ALSA <-> PipeWire PCM I/O Plugin
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 96000
  exact rate   : 96000 (96000/1)
  msbits       : 16
  buffer_size  : 48000
  period_size  : 12000
  period_time  : 125000
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 12000
  period_event : 0
  start_threshold  : 48000
  stop_threshold   : 48000
  silence_threshold: 0
  silence_size : 0
  boundary     : 6755399441055744000