mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.79k stars 2.93k forks source link

mpv is silent at volume below 12% under Pipewire and formats s16/s32 #12223

Open theo77186 opened 1 year ago

theo77186 commented 1 year ago

Important Information

Reproduction steps

Play any audio file with mpv --no-config --volume=12 --audio-format=s32 <file>.

Expected behavior

A very quiet sound should be produced.

Actual behavior

There is no sound emitted at all. This can be reproduced with Pipewire sound server and with ao pipewire, pulse and alsa. The jack ao is also affected but at volume=3 instead.

Log file

Log file ``` [ 0.000][d][global] user path: 'volume.log' -> 'volume.log' [ 0.006][v][cplayer] mpv v0.36.0-162-gaf9b53f3a3 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects [ 0.006][v][cplayer] built on Aug 22 2023 11:22:11 [ 0.006][v][cplayer] libplacebo version: v6.292.0 [ 0.006][v][cplayer] FFmpeg version: 6.0-5+b1 [ 0.006][v][cplayer] FFmpeg library versions: [ 0.006][v][cplayer] libavutil 58.2.100 [ 0.006][v][cplayer] libavcodec 60.3.100 [ 0.006][v][cplayer] libavformat 60.3.100 [ 0.006][v][cplayer] libswscale 7.1.100 [ 0.006][v][cplayer] libavfilter 9.3.100 [ 0.006][v][cplayer] libswresample 4.10.100 [ 0.006][v][cplayer] [ 0.006][v][cplayer] Configuration: [ 0.006][v][cplayer] List of enabled features: alsa av-channel-layout avif_muxer build-date caca cplugins cuda-hwaccel cuda-interop debug dmabuf-interop-gl dmabuf-interop-pl dmabuf-wayland drm egl egl-drm egl-helpers egl-wayland egl-x11 ffmpeg ffnvcodec gbm gl glibc-thread-name glob glob-posix gpl iconv jack javascript jpeg jpegxl lcms2 libarchive libass libavdevice libbluray libdl libm libplacebo librt linux-fstatfs lua52 manpage-build memfd-create noexecstack pipewire posix posix-shm pulse rubberband rubberband-3 sixel sndio sndio-1-9 spirv-cross stdatomic threads uchardet vaapi vaapi-drm vaapi-egl vaapi-libplacebo vaapi-wayland vaapi-x11 vdpau vector vk-khr-display vt.h vulkan wayland wayland-protocols-1-27 wayland-protocols-1-31 wayland-protocols-1-32 x11 xv zimg zimg-st428 zlib [ 0.006][v][cplayer] Command line options: '--no-config' '--log-file=volume.log' '--volume=12' 'sine.wav' [ 0.006][v][cplayer] mpv v0.36.0-162-gaf9b53f3a3 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects [ 0.006][v][cplayer] built on Aug 22 2023 11:22:11 [ 0.006][v][cplayer] libplacebo version: v6.292.0 [ 0.006][v][cplayer] FFmpeg version: 6.0-5+b1 [ 0.006][v][cplayer] FFmpeg library versions: [ 0.006][v][cplayer] libavutil 58.2.100 [ 0.006][v][cplayer] libavcodec 60.3.100 [ 0.006][v][cplayer] libavformat 60.3.100 [ 0.006][v][cplayer] libswscale 7.1.100 [ 0.006][v][cplayer] libavfilter 9.3.100 [ 0.006][v][cplayer] libswresample 4.10.100 [ 0.006][v][cplayer] [ 0.006][v][cplayer] Configuration: [ 0.006][v][cplayer] List of enabled features: alsa av-channel-layout avif_muxer build-date caca cplugins cuda-hwaccel cuda-interop debug dmabuf-interop-gl dmabuf-interop-pl dmabuf-wayland drm egl egl-drm egl-helpers egl-wayland egl-x11 ffmpeg ffnvcodec gbm gl glibc-thread-name glob glob-posix gpl iconv jack javascript jpeg jpegxl lcms2 libarchive libass libavdevice libbluray libdl libm libplacebo librt linux-fstatfs lua52 manpage-build memfd-create noexecstack pipewire posix posix-shm pulse rubberband rubberband-3 sixel sndio sndio-1-9 spirv-cross stdatomic threads uchardet vaapi vaapi-drm vaapi-egl vaapi-libplacebo vaapi-wayland vaapi-x11 vdpau vector vk-khr-display vt.h vulkan wayland wayland-protocols-1-27 wayland-protocols-1-31 wayland-protocols-1-32 x11 xv zimg zimg-st428 zlib [ 0.006][d][global] home path: '' -> '-' [ 0.006][d][global] user path: '~~home/' -> '' [ 0.006][d][global] user path: '~~old_home/' -> '' [ 0.006][v][cplayer] Setting option 'config' = 'no' (flags = 8) [ 0.006][v][cplayer] Setting option 'log-file' = 'volume.log' (flags = 8) [ 0.006][v][cplayer] Setting option 'volume' = '12' (flags = 8) [ 0.006][d][global] user path: 'volume.log' -> 'volume.log' [ 0.006][d][osc] Loading lua script @osc.lua... [ 0.006][d][ytdl_hook] Loading lua script @ytdl_hook.lua... [ 0.006][d][stats] Loading lua script @stats.lua... [ 0.006][d][console] Loading lua script @console.lua... [ 0.006][d][auto_profiles] Loading lua script @auto_profiles.lua... [ 0.006][v][cplayer] Waiting for scripts... [ 0.006][d][console] loading mp.defaults [ 0.007][d][console] loading @console.lua [ 0.008][d][console] reading options for console [ 0.008][d][console] script-opts/console.conf not found. [ 0.008][d][console] lua-settings/console.conf not found. [ 0.008][d][osd/libass] ASS library version: 0x1701000 (runtime 0x1701000) [ 0.008][v][osd/libass] libass API version: 0x1701000 [ 0.008][v][osd/libass] libass source: tarball: 0.17.1 [ 0.008][v][osd/libass] Shaper: FriBidi 1.0.8 (SIMPLE) HarfBuzz-ng 8.0.1 (COMPLEX) [ 0.009][v][osd/libass] Setting up fonts... [ 0.010][d][ytdl_hook] loading mp.defaults [ 0.010][d][osc] loading mp.defaults [ 0.010][d][stats] loading mp.defaults [ 0.010][d][auto_profiles] loading mp.defaults [ 0.011][d][osc] loading @osc.lua [ 0.011][d][ytdl_hook] loading @ytdl_hook.lua [ 0.011][d][stats] loading @stats.lua [ 0.012][d][auto_profiles] loading @auto_profiles.lua [ 0.014][d][stats] reading options for stats [ 0.014][d][stats] script-opts/stats.conf not found. [ 0.014][d][stats] lua-settings/stats.conf not found. [ 0.015][d][osc] reading options for osc [ 0.015][d][osc] script-opts/osc.conf not found. [ 0.015][d][osc] lua-settings/osc.conf not found. [ 0.020][d][ytdl_hook] reading options for ytdl_hook [ 0.020][d][ytdl_hook] script-opts/ytdl_hook.conf not found. [ 0.020][d][ytdl_hook] lua-settings/ytdl_hook.conf not found. [ 0.027][v][osd/libass] Using font provider fontconfig [ 0.027][v][osd/libass] Done. [ 0.029][d][auto_profiles] Exiting... [ 0.030][d][cplayer] Run command: define-section, flags=64, args=[name="showhide", contents="mouse_move script-binding osc/__keybinding1\nmouse_leave script-binding osc/__keybinding2\n", flags="force"] [ 0.030][d][cplayer] Run command: define-section, flags=64, args=[name="input_stats", contents="", flags="default"] [ 0.030][d][cplayer] Run command: enable-section, flags=64, args=[name="input_stats", flags="allow-hide-cursor+allow-vo-dragging"] [ 0.030][d][cplayer] Run command: define-section, flags=64, args=[name="input_forced_stats", contents="", flags="force"] [ 0.030][d][cplayer] Run command: enable-section, flags=64, args=[name="input_forced_stats", flags="allow-hide-cursor+allow-vo-dragging"] [ 0.030][d][cplayer] Run command: define-section, flags=64, args=[name="showhide_wc", contents="mouse_move script-binding osc/__keybinding3\nmouse_leave script-binding osc/__keybinding4\n", flags="force"] [ 0.030][d][cplayer] Run command: enable-section, flags=64, args=[name="showhide", flags="allow-hide-cursor+allow-vo-dragging"] [ 0.030][d][cplayer] Run command: enable-section, flags=64, args=[name="showhide_wc", flags="allow-hide-cursor+allow-vo-dragging"] [ 0.030][d][cplayer] Run command: define-section, flags=64, args=[name="input", contents="mbtn_left script-binding osc/__keybinding5\nshift+mbtn_left script-binding osc/__keybinding6\nmbtn_right script-binding osc/__keybinding7\nmbtn_mid script-binding osc/__keybinding8\nwheel_up script-binding osc/__keybinding9\nwheel_down script-binding osc/__keybinding10\nmbtn_left_dbl ignore\nshift+mbtn_left_dbl ignore\nmbtn_right_dbl ignore\n", flags="force"] [ 0.030][d][cplayer] Run command: enable-section, flags=64, args=[name="input", flags=""] [ 0.030][d][cplayer] Run command: define-section, flags=64, args=[name="window-controls", contents="mbtn_left script-binding osc/__keybinding11\n", flags="force"] [ 0.030][d][cplayer] Run command: enable-section, flags=64, args=[name="window-controls", flags=""] [ 0.030][d][cplayer] Run command: change-list, flags=64, args=[name="shared-script-properties", operation="append", value="osc-visibility=auto"] [ 0.030][v][cplayer] Set property: shared-script-properties -> 1 [ 0.030][v][cplayer] Set property: user-data/osc/visibility="auto" -> 1 [ 0.030][d][cplayer] Run command: disable-section, flags=64, args=[name="input"] [ 0.030][d][cplayer] Run command: disable-section, flags=64, args=[name="window-controls"] [ 0.030][d][cplayer] Run command: change-list, flags=64, args=[name="shared-script-properties", operation="append", value="osc-margins=0.000000,0.000000,0.000000,0.000000"] [ 0.030][v][cplayer] Set property: shared-script-properties -> 1 [ 0.030][v][cplayer] Set property: user-data/osc/margins={"b":0,"l":0,"t":0,"r":0} -> 1 [ 0.031][v][cplayer] Done loading scripts. [ 0.031][d][global] state path: 'watch_later' -> '-' [ 0.031][d][global] state path: 'watch_later' -> '-' [ 0.031][v][cplayer] Running hook: ytdl_hook/on_load [ 0.031][v][ytdl_hook] ytdl:// hook [ 0.031][v][ytdl_hook] not a ytdl:// url [ 0.031][d][cplayer] Run command: change-list, flags=64, args=[name="shared-script-properties", operation="append", value="osc-margins=0.000000,0.000000,0.000000,0.000000"] [ 0.031][v][cplayer] Set property: shared-script-properties -> 1 [ 0.031][v][cplayer] Set property: user-data/osc/margins={"b":0,"l":0,"t":0,"r":0} -> 1 [ 0.031][d][osc] osc_init [ 0.032][d][cplayer] Run command: change-list, flags=64, args=[name="shared-script-properties", operation="append", value="osc-margins=0.000000,0.000000,0.000000,0.000000"] [ 0.032][v][cplayer] Set property: shared-script-properties -> 1 [ 0.032][v][cplayer] Set property: user-data/osc/margins={"b":0,"l":0,"t":0,"r":0} -> 1 [ 0.032][d][osd/libass] ASS library version: 0x1701000 (runtime 0x1701000) [ 0.032][v][osd/libass] libass API version: 0x1701000 [ 0.032][v][osd/libass] libass source: tarball: 0.17.1 [ 0.032][v][osd/libass] Shaper: FriBidi 1.0.8 (SIMPLE) HarfBuzz-ng 8.0.1 (COMPLEX) [ 0.032][v][osd/libass] Setting up fonts... [ 0.035][v][bdmv/bluray] Opening sine.wav [ 0.035][v][file] Opening sine.wav [ 0.035][d][file] resize stream to 131072 bytes, drop 0 bytes [ 0.035][d][file] Stream opened successfully. [ 0.035][v][demux] Trying demuxers for level=normal. [ 0.035][d][demux] Trying demuxer: disc (force-level: normal) [ 0.035][d][demux] Trying demuxer: edl (force-level: normal) [ 0.035][d][demux] Trying demuxer: cue (force-level: normal) [ 0.035][d][demux] Trying demuxer: rawaudio (force-level: normal) [ 0.035][d][demux] Trying demuxer: rawvideo (force-level: normal) [ 0.035][d][demux] Trying demuxer: mkv (force-level: normal) [ 0.035][d][demux] Trying demuxer: libarchive (force-level: normal) [ 0.036][d][demux] Trying demuxer: lavf (force-level: normal) [ 0.039][v][lavf] Found 'wav' at score=99 size=2048. [ 0.051][v][osd/libass] Using font provider fontconfig [ 0.051][v][osd/libass] Done. [ 0.052][d][cplayer] Run command: define-section, flags=64, args=[name="input_console", contents="", flags="default"] [ 0.052][d][cplayer] Run command: enable-section, flags=64, args=[name="input_console", flags="allow-hide-cursor+allow-vo-dragging"] [ 0.052][d][cplayer] Run command: define-section, flags=64, args=[name="input_forced_console", contents="", flags="force"] [ 0.052][d][cplayer] Run command: enable-section, flags=64, args=[name="input_forced_console", flags="allow-hide-cursor+allow-vo-dragging"] [ 0.052][d][cplayer] Run command: define-section, flags=64, args=[name="input_osc", contents="", flags="default"] [ 0.052][d][cplayer] Run command: enable-section, flags=64, args=[name="input_osc", flags="allow-hide-cursor+allow-vo-dragging"] [ 0.052][d][cplayer] Run command: define-section, flags=64, args=[name="input_forced_osc", contents="", flags="force"] [ 0.052][d][cplayer] Run command: enable-section, flags=64, args=[name="input_forced_osc", flags="allow-hide-cursor+allow-vo-dragging"] [ 0.054][d][ffmpeg/demuxer] wav: parser not found for codec pcm_s16le, packets or times may be invalid. [ 0.054][v][lavf] avformat_find_stream_info() finished after 229376 bytes. [ 0.054][v][demux] Detected file format: wav (libavformat) [ 0.054][v][cplayer] Opening done: sine.wav [ 0.054][v][find_files] Loading external files in . [ 0.054][v][cplayer] Running hook: ytdl_hook/on_preloaded [ 0.054][v][lavf] select track 0 [ 0.054][i][cplayer] (+) Audio --aid=1 (pcm_s16le 1ch 44100Hz) [ 0.055][v][ad] Codec list: [ 0.055][v][ad] pcm_s16le - PCM signed 16-bit little-endian [ 0.055][v][ad] Opening decoder pcm_s16le [ 0.055][v][ad] Requesting 1 threads for decoding. [ 0.055][v][ad] Selected codec: pcm_s16le (PCM signed 16-bit little-endian) [ 0.055][v][af] User filter list: [ 0.055][v][af] (empty) [ 0.055][v][cplayer] Starting playback... [ 0.058][v][af] [in] 44100Hz mono 1ch s16 [ 0.058][v][af] [userspeed] 44100Hz mono 1ch s16 [ 0.058][v][af] [userspeed] (disabled) [ 0.058][v][af] [convert] 44100Hz mono 1ch s16 [ 0.058][v][ao] Trying audio driver 'pipewire' [ 0.058][v][ao/pipewire] requested format: 44100 Hz, mono channels, s16 [ 0.058][v][ao/pipewire] Headers version: 0.3.77 [ 0.058][v][ao/pipewire] Library version: 0.3.77 [ 0.063][v][ao/pipewire] Core user: theo [ 0.063][v][ao/pipewire] Core host: sakamata.sassytheo.moe [ 0.063][v][ao/pipewire] Core version: 0.3.77 [ 0.063][v][ao/pipewire] Core name: pipewire-0 [ 0.063][d][ao/pipewire] Stream state changed: old_state=unconnected state=connecting error=(null) [ 0.064][d][ao/pipewire] Stream state changed: old_state=connecting state=paused error=(null) [ 0.068][v][ao/pipewire] using soft-buffer of 8820 samples. [ 0.068][i][cplayer] AO: [pipewire] 44100Hz mono 1ch s16 [ 0.068][v][cplayer] AO: Description: PipeWire audio output [ 0.068][v][af] [convert] (disabled) [ 0.068][v][af] [out] 44100Hz mono 1ch s16 [ 0.068][v][cplayer] audio ready [ 0.068][v][cplayer] starting audio playback [ 0.068][v][cplayer] playback restart complete @ 0.000000, audio=playing, video=eof [ 0.068][d][ao/pipewire] Stream state changed: old_state=paused state=streaming error=(null) [ 0.082][d][osc] osc_init [ 0.082][d][cplayer] Run command: change-list, flags=64, args=[name="shared-script-properties", operation="append", value="osc-margins=0.000000,0.000000,0.000000,0.000000"] [ 0.082][v][cplayer] Set property: shared-script-properties -> 1 [ 0.082][v][cplayer] Set property: user-data/osc/margins={"b":0,"l":0,"t":0,"r":0} -> 1 [ 3.852][v][lavf] EOF reached. [ 4.874][v][af] filter input EOF [ 4.874][v][af] filter output EOF [ 4.874][v][cplayer] audio filter EOF [ 4.874][v][cplayer] audio draining [ 4.874][v][cplayer] audio EOF reached [ 4.874][v][cplayer] EOF code: 1 [ 4.874][d][ad] Uninit decoder. [ 4.874][d][cplayer] Terminating demuxers... [ 4.874][d][cplayer] Done terminating demuxers. [ 4.874][v][cplayer] finished playback, success (reason 0) [ 4.874][i][cplayer] [ 4.874][i][cplayer] Exiting... (End of file) [ 4.874][d][ytdl_hook] Exiting... [ 4.874][d][console] Exiting... [ 4.874][d][cplayer] Run command: change-list, flags=64, args=[name="shared-script-properties", operation="remove", value="osc-margins"] [ 4.874][v][cplayer] Set property: shared-script-properties -> 1 [ 4.874][d][cplayer] Run command: del, flags=64, args=[name="user-data/osc"] [ 4.874][d][stats] Exiting... [ 4.874][d][osc] Exiting... [ 4.877][v][cplayer] draining left over audio [ 5.089][d][ao/pipewire] Stream state changed: old_state=streaming state=paused error=(null) ```

Sample files

A sample file can be generated using ffmpeg -f lavfi -i sine=d=5,volume=8 sine.wav but any audio file should work.

llyyr commented 1 year ago

A very quiet sound is produced, you can verify this by recording mpv's sound output and loading it in Audacity or some other spectrum analyzer, or by setting your audio server/headphone volume to the max.

Imo a better issue would be discussing if there's any utility to having 1 to 10% of the volume control be inaudibly quiet, but I don't really think that's an issue.

theo77186 commented 1 year ago

okay with further testing, if the output format is float, the bug doesn't occur, therefore only affecting s16 and s32. This means that compressed codecs won't trigger this and only uncompressed fixed-point PCM can trigger this (and flac too).