ammen99 / wf-recorder

MIT License
872 stars 63 forks source link

Can't record audio in PCM format #246

Open slonkazoid opened 10 months ago

slonkazoid commented 10 months ago

When I try to record with -a -P pcm_s16le (or any other PCM format), it gives me an error saying

Failed to read from PulseAudio stream: Invalid argument

I can record with ffmpeg -f pulse -i default -c:a pcm_s16le test.mkv so it's not a ffmpeg issue.
It has no issue recording in opus.

inxi -SMAxxx:

System:
  Host: getgot Kernel: 6.6.4-1-cachyos-lto arch: x86_64 bits: 64
    compiler: clang v: 16.0.6 clocksource: tsc Desktop: sway
    v: 1.9-dev-ae3acf26f info: waybar vt: 1 dm: SDDM Distro: Arch Linux
Machine:
  Type: Desktop System: ASUS product: N/A v: N/A serial: <superuser required>
  Mobo: ASUSTeK model: TUF GAMING B550-PLUS v: Rev X.0x
    serial: <superuser required> UEFI: American Megatrends v: 2803
    date: 04/27/2022
Audio:
  Device-1: AMD Navi 21/23 HDMI/DP Audio driver: snd_hda_intel v: kernel pcie:
    speed: 16 GT/s lanes: 16 bus-ID: 08:00.1 chip-ID: 1002:ab28 class-ID: 0403
  Device-2: AMD Starship/Matisse HD Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s lanes: 16
    bus-ID: 0a:00.4 chip-ID: 1022:1487 class-ID: 0403
  API: ALSA v: k6.6.4-1-cachyos-lto status: kernel-api
  Server-1: sndiod v: N/A status: off
  Server-2: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin
slonkazoid commented 10 months ago

This wouldn't be that big of a problem if there was an obvious way to specify audio bitrate

apiraino commented 7 months ago

which version of wf-recorder are you using at the time?

Providing -P like you report seems to be incorrect, I get an error "Invalid codec option pcm_s16le". I think the -P param should be in the form of -P <option_name>=<option_value> (according to the man page).

Otherwise, can you also try running with wf-recorder --log <other params> to get more insights on what's happening.

Hope it helps!

slonkazoid commented 7 months ago

which version of wf-recorder are you using at the time?

0.4.1

Providing -P like you report seems to be incorrect, I get an error "Invalid codec option pcm_s16le". I think the -P param should be in the form of -P <option_name>=<option_value> (according to the man page).

yeah that seems to be a copy paste issue, it's supposed to be -a -C pcm_s16le

Otherwise, can you also try running with wf-recorder --log <other params> to get more insights on what's happening.

unfortunately did not provide me any info other than this:

Choosing sample format s16 for audio codec pcm_s16le
[SWR @ 0x77ff2442c3c0] Using fltp internally between filters

which ffmpeg should be able to handle just fine

Hope it helps!

thank you

flac seems to kinda work so i think ill use that, the cpu time cost is negligible