Hello again
The resolution was the sample rate setting in devices. When manually plottting to test the correctness of filters, this setting is active, rather than the $samplerate$ construct in the config. You must change this setting to match the sample rate of your filter, otherwise the fillter will be offset + or - by the ratio of the device setting and the filter sample rate. So in my case the device setting was 96000 and the filter was 48000, reulting in a shift of that ratio. My silly mistake I guess because I always use automatic sample rate switching and forgot about the influence ot it. For REW, it must detect and use use the filter sample rate to overide any defaults, so that is why they plot there.
My apologies for the request, and happy experimenting!
- tonywsea
The resolution was the sample rate setting in devices. When manually plottting to test the correctness of filters, this setting is active, rather than the $samplerate$ construct in the config. You must change this setting to match the sample rate of your filter, otherwise the fillter will be offset + or - by the ratio of the device setting and the filter sample rate. So in my case the device setting was 96000 and the filter was 48000, reulting in a shift of that ratio. My silly mistake I guess because I always use automatic sample rate switching and forgot about the influence ot it. For REW, it must detect and use use the filter sample rate to overide any defaults, so that is why they plot there.
My apologies for the request, and happy experimenting!
- tonywsea
I have a question regarding scripple. Is it really necessary, in order to process a .wav file? It seems to me that once I create a loopback most of the work has been done, since I can use aplay to route the wav file to a loopback card. The camilla config file would have to include the specific hw:N,x,y source but that's trivial.
Being a total beginner on this side of things I expect to be wrong more often than right....
Being a total beginner on this side of things I expect to be wrong more often than right....
I am not familiar with scripple. Nonetheless, I used a .wav file, which I generated in REW, with CamillaDSP. Something was off, though. The frequency response did not measure as I expected. Perhaps there was some ringing, but I am not sure. I need to experiment with it some more.
IIUC by scripple you mean https://github.com/scripple/alsa_cdsp (scripple is owner of that github account, alsa_cdsp is name of his project/repository).I have a question regarding scripple. Is it really necessary, in order to process a .wav file? It seems to me that once I create a loopback most of the work has been done, since I can use aplay to route the wav file to a loopback card
The complication with the loopback is that it contains two alsa interfaces (playback -> capture) and alsa client is the one which decides the format and samplerate. This decision is restricted by the interface which limits the available combinations to the one already used on the other side. Therefore, if aplay opens the playback side at 44.1/16, the capture side starts supporting only 44.1/16. Hence CDSP can open the capture side at 44.1/16 only, all other variants will fail.
Then aplay will stop/quit/close the playback device, but CDSP will keep capturing at 44.1/16. The next time aplay will have only 44.1/16 available (because the other side is already open at that format).
The helpers overcome this limitation. The alsa-lib plugin alsa_cdsp starts cdsp with appropriate capture params when the player (aplay) opens the alsa device, and quits cdsp when the player closes the alsa device.
Projects like https://github.com/HEnquist/camilladsp-controller monitor status of the alsa capture interface (alsa loopback, USB gadget) and control running CDSP via its websockets API - starting at specific rate and format, stopping.
I want to play some .wav files to evaluate the room/speaker equalization that REW+camilladsp perform. So the source isn't a "card".@Mark'51 I don't understand the question. What are you trying to do?
Maybe I'm making it too complicated.
Did you try the WavFile capture type of CDSP https://github.com/HEnquist/camilladsp/?tab=readme-ov-file#file-rawfile-wavfile-stdin-stdout ?I want to play some .wav files
No.. That looks like it should work OK for my current requirement and won't require a loop back device. I will direct the playback to my sound card rather than another wave file (as shown in the example).
It appears that the filename is baked into the config file. I didn't see anything in the description of camilladsp's command-line options that would allow me to specify the location of the wav file. Not an issue for now.
Thanks for your help.
Mark
It appears that the filename is baked into the config file. I didn't see anything in the description of camilladsp's command-line options that would allow me to specify the location of the wav file. Not an issue for now.
Thanks for your help.
Mark
IMO for now the file can be a symbolic link with fixed name (hard-coded in the config), pointing to your specific wav file.It appears that the filename is baked into the config file.
Yes you give the filename in the config file. Not the most convenient for playing wave files, but then again playing wav files from the command line isn't a main feature of camilladsp 🙂It appears that the filename is baked into the config file. I didn't see anything in the description of camilladsp's command-line options that would allow me to specify the location of the wav file. Not an issue for now.
I have installed camilladsp on my Pi5 (the aarch64 precompled version) and am attempting to use a very simple config file to test it. The config file is very similar to the one called "file_pb.yml" on https://github.com/HEnquist/camilladsp/tree/master/exampleconfigs.
It doesn't run, giving me a message "unknown field 'channels', expected one of 'filename', 'extra_samples', 'labels' at line 2 column 13"
My config file is:
devices:
samplerate: 44100
chunksize: 1024
silence_threshold: -60
silence_timeout: 3.0
capture:
type: WavFile
channels: 2
filename: "/home/mark/Music/Track 2.wav"
format: S16LE
playback:
type: Alsa
channels: 2
device: "hw:2,0"
format: S32LE
The main changes are the capture type -- WavFlle instead of RawFile,
and the playback device type -- but it doesn't look like the parser makes it to the playback portion of the script.
Just for reference, here's "file_pb.yml":
devices:
samplerate: 44100
chunksize: 1024
silence_threshold: -60
silence_timeout: 3.0
capture:
type: RawFile
channels: 2
filename: "/home/henrik/test.raw"
format: S16LE
playback:
type: Pulse
channels: 2
device: "alsa_output.pci-0000_03_00.6.analog-stereo"
format: S32LE
I copied "file_pb.yml" from the web page and pasted it into a simple text editor (mousepad).
If I try to run the un-edited example the parser makes it to the playback section where it complains about Pulse (apparently not included in my OS).
If I change "WavFile" to "WaveFile" I get another complaint, indicating that the parser expects (among other possibilities) "WavFile". Soooo..... what the heck is going on?
It doesn't run, giving me a message "unknown field 'channels', expected one of 'filename', 'extra_samples', 'labels' at line 2 column 13"
My config file is:
devices:
samplerate: 44100
chunksize: 1024
silence_threshold: -60
silence_timeout: 3.0
capture:
type: WavFile
channels: 2
filename: "/home/mark/Music/Track 2.wav"
format: S16LE
playback:
type: Alsa
channels: 2
device: "hw:2,0"
format: S32LE
The main changes are the capture type -- WavFlle instead of RawFile,
and the playback device type -- but it doesn't look like the parser makes it to the playback portion of the script.
Just for reference, here's "file_pb.yml":
devices:
samplerate: 44100
chunksize: 1024
silence_threshold: -60
silence_timeout: 3.0
capture:
type: RawFile
channels: 2
filename: "/home/henrik/test.raw"
format: S16LE
playback:
type: Pulse
channels: 2
device: "alsa_output.pci-0000_03_00.6.analog-stereo"
format: S32LE
I copied "file_pb.yml" from the web page and pasted it into a simple text editor (mousepad).
If I try to run the un-edited example the parser makes it to the playback section where it complains about Pulse (apparently not included in my OS).
If I change "WavFile" to "WaveFile" I get another complaint, indicating that the parser expects (among other possibilities) "WavFile". Soooo..... what the heck is going on?
This means it doesn't like "channels", because it should not be given for WavFile. For a wav file, the number of channels is read from the file instead. See the WavFile example in the readme:unknown field 'channels', expected one of 'filename', 'extra_samples', 'labels' at line 2 column 13
https://github.com/HEnquist/camilladsp/blob/master/README.md#file-rawfile-wavfile-stdin-stdout
Ok, thanks for the info.
Is there a document anywhere that is a concise list of commands and their accepted parameters that might be used in a config file? I haven't found such a thing yet.
Is there a document anywhere that is a concise list of commands and their accepted parameters that might be used in a config file? I haven't found such a thing yet.
I have questions regarding camilladsp and the wav file(s) that REW outputs via the file menu. Information I found in https://github.com/HEnquist/camilladsp?tab=readme-ov-file#filters says that using the wav file type to provide filter coefficients only takes one parameter, the channel number and goes on to say that for a standard stereo file the value can either be 0 or 1. How does this work in terms of defining a filter? By this, I mean -- does the filter apply to a particular output channel? If not, does it mean that the wav file contains data for TWO filters?
Some browsing through the current version of REW I have (5.31.3) suggests that the info I found online is a bit out of date regarding how to output a wav file that's suitable for use as an FIR filter. Still not sure if the "EQ" tab to generate filters has any relevance w/regard to this, but I found that I can select the "actions" tab on the Measure window, then select "Export IR WAV". That brings up a dialog box which allows me to select the file format and the type of information to export. I think I want to select "Export EQ filtered IR". There also are some other options -- normalize samples, Apply IR Window before Export, place t=0 at sample index (default is 256) and the sample count. I left all these at their default settings. Is this going to produce the desired WAV format?
Some clarifications would be greatly appreciated.
Some browsing through the current version of REW I have (5.31.3) suggests that the info I found online is a bit out of date regarding how to output a wav file that's suitable for use as an FIR filter. Still not sure if the "EQ" tab to generate filters has any relevance w/regard to this, but I found that I can select the "actions" tab on the Measure window, then select "Export IR WAV". That brings up a dialog box which allows me to select the file format and the type of information to export. I think I want to select "Export EQ filtered IR". There also are some other options -- normalize samples, Apply IR Window before Export, place t=0 at sample index (default is 256) and the sample count. I left all these at their default settings. Is this going to produce the desired WAV format?
Some clarifications would be greatly appreciated.
Wav files can contain any number of channels, which are essentially separate waveforms of the same length, conveniently stored together. Usually a wav meant to be used as a filter only has one, but you could for example have a 2-channel file with separate filters for left and right. Or a 3-channel file containing the three crossover filters for a 3-way speaker. The channel parameter for a fir filter is there to choose which of the separate waveforms in the file to read. The others are ignored.says that using the wav file type to provide filter coefficients only takes one parameter, the channel number and goes on to say that for a standard stereo file the value can either be 0 or 1.
If the wav file contains two filters what would the channel(s) parameter be set to? I'm guessing it would be "[0,1]" but that's just a guess on my part. The info I found wasn't too explicit in this regard.
REW has a "sequence" option in its measurement application so that would be a nice way to put the filters for both channels in one file. I think that REW's channel 1 = ALSA #0 and 2 --> 1. Just to keep the confusion factor going strong 😀 .
BTW, the results I'm getting so far have been encouraging enough for me to justify buying a better USB ADC/DAC. Its capabilities include 24 bits resolution and 192KSPS. I'm looking forward to hearing how it performs!
Mark
REW has a "sequence" option in its measurement application so that would be a nice way to put the filters for both channels in one file. I think that REW's channel 1 = ALSA #0 and 2 --> 1. Just to keep the confusion factor going strong 😀 .
BTW, the results I'm getting so far have been encouraging enough for me to justify buying a better USB ADC/DAC. Its capabilities include 24 bits resolution and 192KSPS. I'm looking forward to hearing how it performs!
Mark
I have a config file that uses two separate wav files to generate FIR filters for the left and right outputs. While camilladsp is running it I'm getting a bunch of debug statements, although the playback seems to be working OK.
The debug printout is pretty long, referring to the buffer level, and time. I thought I used the standard 44.1KSPS when acquiring the FR for the equalization but I'm wondering if the messages are saying otherwise?
Here's a typical message:
2025-05-03 05:53:36.848065 DEBUG [src/alsadevice.rs:638] PB: buffer level: 490.5, signal rms: Some(HistoryRecord { time: Instant { tv_sec: 11037, tv_nsec: 253933004 }, values: [1.0479637e-5, 0.010867201] })
BTW I'm using a chunksize = 1024.
The debug printout is pretty long, referring to the buffer level, and time. I thought I used the standard 44.1KSPS when acquiring the FR for the equalization but I'm wondering if the messages are saying otherwise?
Here's a typical message:
2025-05-03 05:53:36.848065 DEBUG [src/alsadevice.rs:638] PB: buffer level: 490.5, signal rms: Some(HistoryRecord { time: Instant { tv_sec: 11037, tv_nsec: 253933004 }, values: [1.0479637e-5, 0.010867201] })
BTW I'm using a chunksize = 1024.
It's just a debug message https://github.com/HEnquist/camilla...76376103f83d6d9b3/src/alsadevice.rs#L636-L642 , not an error or warning - you can disable debugs by changing the verbosity level in your command line.
- Home
- Source & Line
- PC Based
- CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc