I know this is application specific, but this relates to my overrall nix config i think, pipewire, wireplumber, all enabled. But I cannot record internal desktop audio, how do i fix this? is it a nix fix

I set the recording device to pipewire, I heard the host device needed to be set to pipewire or smthin, but only alsa shows up. If any logs are needed tell me.

EDIT: Not really solved but I found a script that worked for pw-record, now ideally I would like to fix it for audacity at some point, or just some other gui audio recorder

cat > ~/Music/record-desktop.sh << 'EOF'
#!/bin/bash
OUTPUT="${1:-$HOME/Music/Recordings/recording-$(date +%Y%m%d-%H%M%S).wav}"
pw-record --target 0 "$OUTPUT" &
PID=$!
sleep 0.5
pw-link bluez_output.30:50:75:16:40:A6:monitor_FL pw-record:input_FL
pw-link bluez_output.30:50:75:16:40:A6:monitor_FR pw-record:input_FR
echo "Recording to $OUTPUT (PID $PID) — press Enter to stop"
read
kill $PID
echo "Done! Saved to $OUTPUT"
EOF
chmod +x ~/Music/record-desktop.sh

EDIT (2): Found a better script which autodetects the monitor:

#!/bin/bash
OUTPUT="${1:-$HOME/Music/Recordings/recording-$(date +%Y%m%d-%H%M%S).wav}"

# Find the RUNNING monitor source
MONITOR=$(pactl list short sources | awk '/monitor.*RUNNING/ {print $2}' | head -1)

if [ -z "$MONITOR" ]; then
    echo "Error: no active monitor source found" >&2
    exit 1
fi

# Try to find a matching input (e.g. bluez mic matching same MAC as monitor)
MAC=$(echo "$MONITOR" | grep -oP '[0-9A-Fa-f]{2}[_:][0-9A-Fa-f]{2}[_:][0-9A-Fa-f]{2}[_:][0-9A-Fa-f]{2}[_:][0-9A-Fa-f]{2}[_:][0-9A-Fa-f]{2}' | head -1 | tr '_' ':')
MIC=$(pactl list short sources | grep -v monitor | awk -v mac="$MAC" '$0 ~ mac {print $2}' | head -1)

# Fall back to first non-monitor non-suspended source
if [ -z "$MIC" ]; then
    MIC=$(pactl list short sources | awk '!/monitor/ && /RUNNING|IDLE/ {print $2}' | head -1)
fi

echo "Recording desktop from: $MONITOR"
echo "Recording to: $OUTPUT"
echo "Press Ctrl+C to stop"

if [ -n "$MIC" ]; then
    echo "Recording mic from: $MIC"
    ffmpeg -f pulse -i "$MONITOR" -f pulse -i "$MIC" \
        -filter_complex amix=inputs=2:duration=longest \
        "$OUTPUT"
else
    echo "Warning: no mic found, recording desktop only"
    ffmpeg -f pulse -i "$MONITOR" "$OUTPUT"
fi

echo "Done! Saved to $OUTPUT"

EDIT (3): found something that includes my mic:

#
#!/bin/bash
OUTPUT="${1:-$HOME/Music/Recordings/recording-$(date +%Y%m%d-%H%M%S).wav}"

MONITOR=$(pactl list short sources | awk '/monitor.*RUNNING/ {print $2}' | head -1)

if [ -z "$MONITOR" ]; then
    echo "Error: no active monitor source found" >&2
    exit 1
fi

MAC=$(echo "$MONITOR" | grep -oP '[0-9A-Fa-f]{2}[_:][0-9A-Fa-f]{2}[_:][0-9A-Fa-f]{2}[_:][0-9A-Fa-f]{2}[_:][0-9A-Fa-f]{2}[_:][0-9A-Fa-f]{2}' | head -1 | tr '_' ':')
MIC=$(pactl list short sources | grep -v monitor | awk -v mac="$MAC" '$0 ~ mac {print $2}' | head -1)

if [ -z "$MIC" ]; then
    MIC=$(pactl list short sources | awk '!/monitor/ && /RUNNING|IDLE/ {print $2}' | head -1)
fi

echo "Recording desktop from: $MONITOR"
echo "Recording to: $OUTPUT"
echo "Press Ctrl+C to stop"

if [ -n "$MIC" ]; then
    echo "Recording mic from: $MIC"
    ffmpeg -f pulse -i "$MONITOR" -f pulse -i "$MIC" \
        -filter_complex amix=inputs=2:duration=longest \
        "$OUTPUT"
else
    echo "Warning: no mic found, recording desktop only"
    ffmpeg -f pulse -i "$MONITOR" "$OUTPUT"
fi

echo "Done! Saved to $OUTPUT"
    • jafra@slrpnk.net
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      1 month ago

      Ah yeah. You’re right. There ist this one question mark in between thats i oversaw at first. Either way, i wanted to hint to you thats maybe your post doesn’t get perceived as a question much…