Parec Integration Issues
- PipeWire version: 0.3.65
- Distribution and distribution version: Debian GNU/Linux 12 (bookworm)
- Desktop Environment: Xfce
- Kernel version: 6.1.0-9-amd64
- session manager: wireplumber
Description of Problem:
I have the following script that records audio from the default output device: https://github.com/JayXT/RecordAudioOutput/blob/main/record_audio_output. When called the first time it starts audio recording with parec and in real-time redirects the output to lame that writes the stream data to mp3 file. When called the second time, it kills the parec process, thus finishes the recording of the mp3 file and copies it to clipboard. Usually, I call the script with Super + A shortcut. In case of PulseAudio in Debian 11 it worked fine, but with upgrade I've noticed two PipeWire-related issues:
- @DEFAULT_MONITOR@ is not supported. parec starts to record from input source (microphone) instead.
- When the recording gets finished (the second script run that kills the process), last few seconds of the recording are lost, which wasn't the case before.
How Reproducible:
The problem occurs when running the script utilizing parec and lame command-line utilities.
Steps to Reproduce:
- Launch the script to start the recording.
- Play the audio using the default output device/sink.
- Launch the same script again to stop the recording to mp3 file.
Actual Results:
- If @DEFAULT_MONITOR@ is used in the parec -d parameter, input audio device is used instead of the output one.
- Last few seconds of the recording before the step 3 occurs are lost.
Expected Results:
- @DEFAULT_MONITOR@ is respected and the default audio output device is used.
- The entire audio stream from start of the recording till its end is saved.
Additional Info (as attachments):
-
pw-dump > pw-dump.log
: pw-dump.log -
wpctl status > wpctl_status.log
wpctl_status.log
Of course, if possible I'd like to use pw-record instead of parec + lame combination, but based on my testing it doesn't look like pw-record supports saving to opus, or at least to mp3 file with high compression, but decent quality. Default output sink/device/node selection isn't supported too.
Also I wasn't able to record audio output with pw-record, only input (microphone) source was supported. When I tried to use this command:
pw-record --target=alsa_output.pci-0000_00_1f.3.analog-stereo file.wav
, the pw-record for some reason switched to microphone input as a source and used it instead.