Re: [REQ] Which codec for (S32_LE) multichannel lossless RECORDING ?
Reply #8 – 2025-03-28 22:34:32
Okay, that command definitely has some issues. The biggest is it doesn’t specify “raw-pcm” for the format even though the arecord command is definitely outputting raw audio. So it’s going to fail because it won’t get a valid WAV header. Here is the command I use for my 8-channel recorder (M-Audio FastTrack Ultra 8R ):arecord -Dhw:F8R -t raw -r48000 -c8 -fS24_3LE | wavpack - --raw-pcm=48000,24,8 --channel-order=... -hvmo File.wv This does 24 bit, 8 channel (note that I use the short version of the arecord options). If that format doesn’t work in your setup then you can replace it with “S32_LE” and the 24 in the raw-pcm spec with 32. This will take a little more CPU to encode and I know your data is just 24 bits, but the driver might not do S24_3LE. I have never needed to specify the buffer size in the arecord command, but maybe someone did. I don’t understand what they’re doing with redirection of stdin and stderr, but I just leave the terminal open during recording. You can add -q in the WavPack line to force error display only. That command uses a mounted output device (probably USB?) because there's no storage (I assume). You'll have to use that. To terminate the session there are two ways. If you know the time beforehand you can use the -d option in arecord to specify the number of seconds. What I generally do is use “top” to find the PID of the arecord process and then kill it when the recording is done. That terminates the pipe to WavPack which can then properly terminate the file. If you just ^C the terminal then it doesn’t seem to work right (I think maybe WavPack deletes the output file). One thing you can do is test the arecord and WavPack lines separately using files. In other words add "> temp-file" to the arecord to capture the raw data. Then add "< temp-file" to the WavPack line to test that part (or even better, use cat to pipe the file into WavPack: "cat test-file | wavpack -". This sometimes makes it easier to see where things are messing up. Let me know if you run into trouble.