Batch Conversion & Recording


Batch Mode

DpdoEngine supports batch processing of multiple files via shell scripting. There is no dedicated --batch flag — a shell loop does the job easily.

Shell Batch Conversion

Bash example — batch FLAC → DSF:

#!/bin/bash
	for f in *.flac; do
	  DpdoEngine -i "$f" "${f%.flac}.dsf" --oversampling 128 --order 7
	done
	

Recursive processing of subdirectories:

#!/bin/bash
	find /music/pcm -name "*.flac" | while read f; do
	  outdir="/music/dsd${f#/music/pcm}"
	  mkdir -p "$(dirname "$outdir")"
	  DpdoEngine -i "$f" "${outdir%.flac}.dsf" --oversampling 128 --order 7
	done
	

Multi-Core Parallel Conversion

Use xargs or GNU parallel to fully utilize multi-core CPUs:

# xargs — 4 parallel jobs per batch
	find . -name "*.flac" -print0 | xargs -0 -n1 -P4 -I{} sh -c \
	  'f="{}"; DpdoEngine -i "$f" "${f%.flac}.dsf" --oversampling 128 --order 7 -opencl'
	
	# GNU parallel (recommended)
	find . -name "*.flac" | parallel DpdoEngine -i {} {.}.dsf --oversampling 128 --order 7
	

Tip: combined with --opencl, GPU acceleration is especially efficient in multi-task scenarios.


Pipe Mode

--pipe enables stdin/stdout piping so DpdoEngine can be combined with other command-line tools to build flexible processing pipelines.

Basic Usage

# Read PCM from stdin, write to stdout
	cat input.wav | DpdoEngine -i pipe output.dsf --oversampling 64 --pipe
	
	# Chain with ffmpeg
	ffmpeg -i source.flac -f wav - | DpdoEngine -i pipe output.dsf --oversampling 128 --pipe
	

Pipeline Examples

Multi-stage chain:

# PCM source → loudness normalization → noise shaping → DSD output
	ffmpeg -i track.flac -f wav - | \
	  DpdoEngine -i pipe track.dsf --oversampling 128 --order 7 --lufs -16 --pipe
	

Real-time monitoring with DpdoPlayer:

# Convert and monitor through DpdoPlayer at the same time
	DpdoEngine -i input.flac output.dsf --oversampling 64 --pipe | DpdoPlayer - -vol 80
	

Record Mode

DpdoEngine can record directly from compatible audio interfaces. The goal is lossless direct-to-DSD recording.

Basic Recording

# Start recording to a DSF file
	DpdoEngine --record recording.dsf
	

Recording Options

ParameterDescriptionExample
--recordEnable record mode (mono default, press q to stop)--record
--record-device NAMERecording device name (default: system default)--record-device "USB Mic"
--record-samplerate HZCapture sample rate (0=auto)--record-samplerate 44100
--record-channels NCapture channels (0=auto)--record-channels 2
--record-duration SECAuto-stop after SEC seconds (0=manual)--record-duration 300
--record-buffer NFrames per buffer (64–65536, default 512)--record-buffer 512
--record-headroom DBHeadroom dB (default 3.0)--record-headroom 3
--list-devicesList available audio devices--list-devices

Output format is determined by the output file extension (.dsf / .dff).

Native DSD Recording

For audio interfaces with native DSD output, DpdoEngine records the DSD stream directly (DoP or ALSA raw DSD):

# DoP mode (PortAudio, broad compatibility)
	DpdoEngine --record-dsd --dsd-mode dop live.dsf
	
	# Native mode (ALSA raw DSD_U32_BE, requires device support)
	DpdoEngine --record-dsd --dsd-mode native live.dsf
	

The recorded DSD stream never passes through a PCM intermediate format — the PDM bitstream goes straight from the ADC into a DSF file, keeping the recording chain maximally clean.

Record + Real-Time Monitoring

Record and monitor through DpdoPlayer simultaneously, zero latency:

DpdoEngine --record recording.dsf --pipe | DpdoPlayer - -vol 70
	

Statistics & Logging

Statistics

DpdoEngine -i input.wav output.dsf --oversampling 128 --stats
	

Reported statistics include: - Input/output sample rates - Processing time and utilization - Peak and RMS levels - Noise floor - Dynamic range

Verbose Logging

By default DpdoEngine prints progress to the terminal. To save a log:

DpdoEngine -i input.wav output.dsf --oversampling 128 2>&1 | tee conversion.log
	

Automation Script Reference

Full-Album Conversion (with metadata)

#!/bin/bash
	# Batch-convert an entire album, adding metadata to each track
	ALBUM="Symphony No. 9"
	ARTIST="Beethoven"
	YEAR=2024
	
	for f in *.flac; do
	  TITLE="${f%.flac}"
	  DpdoEngine -i "$f" "${f%.flac}.dsf" \
	    --oversampling 128 --order 7 \
	    --artist "$ARTIST" \
	    --album "$ALBUM" \
	    --title "$TITLE" \
	    --year "$YEAR"
	done
	

Folder Watch + Auto-Convert

# Watch a folder with inotifywait, convert new files automatically
	inotifywait -m /watch/folder -e close_write --format '%f' | while read f; do
	  if [[ "$f" == *.flac || "$f" == *.wav ]]; then
	    DpdoEngine -i "/watch/folder/$f" "/output/${f%.*}.dsf" --oversampling 64 --order 7
	  fi
	done
	

One-Shot Album Authoring with DpdoPackSACD

#!/bin/bash
	# Batch convert → author SACD ISO
	for f in *.flac; do
	  DpdoEngine -i "$f" "${f%.flac}.dsf" --oversampling 128 --order 7 \
	    --artist "Artist" --album "Album" --title "${f%.flac}"
	done
	
	# Author the SACD ISO
	DpdoPackSACD --album "Album" --artist "Artist" -cover cover.jpg *.dsf