Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Room correction with convolution per sample rate
03-12-2018, 04:10 (This post was last modified: 03-12-2018 04:37 by digimuse.)
Post: #21
RE: Room correction with convolution per sample rate
Quote:convOut=-i /mnt/disk1/share/MinimServer/convolution/Cor1S*.wav -lavfi afir=gtype=gn

Step 1 (configuration)

MinimStreamer searches for all convolution files matching the wildcard and reads their contents to check the sample rate.

Will you support stereo, 5.1, ...?

By "matching the wildcard" I think you mean "Cor1S*.wav" (in this case). This sounds good, as it allows the user to have multiple sets of convolution files in the directory, e.g., for different Target Curves.

Test Target Curve 1:
convOut=-i /mnt/disk1/share/MinimServer/convolution/Cor1S*.wav -lavfi afir=gtype=gn

Test Target Curve 2:
convOut=-i /mnt/disk1/share/MinimServer/convolution/Cor2S*.wav -lavfi afir=gtype=gn

Quote:Step 2 (transcoding)

When a file is transcoded using ffmpeg, the convolution file from step 1 that has the same sample rate as the input file is selected automatically and used on the ffmpeg command. This doesn't depend on the name of the convolution file but on its contents.

"This doesn't depend on the name of the convolution file but on its contents." - I presume it will still use the pattern specified by the user, e.g., for a 44.1 kHz audio track MinimStreamer will use the file "Cor1S<some text>.wav" and not "Cor2S<some text>.wav" (assuming both are 44.1 kHz convolution files).

Looking forward to trying out the new feature.
Find all posts by this user
Quote this message in a reply
03-12-2018, 08:24
Post: #22
RE: Room correction with convolution per sample rate
(03-12-2018 04:10)digimuse Wrote:  Will you support stereo, 5.1, ...?

I am not planning to do this initially. It might be possible to add this as a future enhancement if required, with MinimStreamer first looking for an exact match in channel configuration and fallng back to a single-channel convolution file if there is no exact match.

Quote:By "matching the wildcard" I think you mean "Cor1S*.wav" (in this case). This sounds good, as it allows the user to have multiple sets of convolution files in the directory, e.g., for different Target Curves.

Test Target Curve 1:
convOut=-i /mnt/disk1/share/MinimServer/convolution/Cor1S*.wav -lavfi afir=gtype=gn

Test Target Curve 2:
convOut=-i /mnt/disk1/share/MinimServer/convolution/Cor2S*.wav -lavfi afir=gtype=gn

Yes, this would be possible. To change from one set of files to another, the user would modify the stream.options property.

Quote:"This doesn't depend on the name of the convolution file but on its contents." - I presume it will still use the pattern specified by the user, e.g., for a 44.1 kHz audio track MinimStreamer will use the file "Cor1S<some text>.wav" and not "Cor2S<some text>.wav" (assuming both are 44.1 kHz convolution files).

Yes, that's correct. The wildcard string in convOut specifies which convolution files are available for selection.

Quote:Looking forward to trying out the new feature.

I will send you a PM when a test build is available for you to try.
Find all posts by this user
Quote this message in a reply
22-12-2018, 13:49
Post: #23
RE: Room correction with convolution per sample rate
Hi Simon,

very interesting discussion. I have tried to apply your suggested command:

convOut=-i /share/CACHEDEV1_DATA/Music/ConvolutionFiles/Cor1S*.wav -lavfi afir

It produces an error message in Minim: conOut setting incorrect for converter.

stream.transcose is set to: flac:wav24; ,wav:wav;

I am using FFMPEG 4.1.

I have got Convolution files created for all sample rates in the same folder.

Any idea what's wrong here?

Regards, SMSWAP
Find all posts by this user
Quote this message in a reply
22-12-2018, 21:59
Post: #24
RE: Room correction with convolution per sample rate
This support is not available in the current 0.7.10 version of MinimStreamer. I will send you a PM with information about how to access a test build that has this support.
Find all posts by this user
Quote this message in a reply
22-12-2018, 22:19
Post: #25
RE: Room correction with convolution per sample rate
(22-12-2018 21:59)simoncn Wrote:  This support is not available in the current 0.7.10 version of MinimStreamer. I will send you a PM with information about how to access a test build that has this support.

Hi Simon, I am really curious to run the test build to experience the feat.
Find all posts by this user
Quote this message in a reply
22-12-2018, 22:31
Post: #26
RE: Room correction with convolution per sample rate
I have sent you a PM about this.
Find all posts by this user
Quote this message in a reply
23-12-2018, 07:27
Post: #27
RE: Room correction with convolution per sample rate
(22-12-2018 22:31)simoncn Wrote:  I have sent you a PM about this.

Hi Simon,

this works GREAT. Well done! It switches through all sample rates:

Using convolution file /share/CACHEDEV1_DATA/Music/ConvolutionFiles/Cor1S44.wav for sample rate 44100
Using convolution file /share/CACHEDEV1_DATA/Music/ConvolutionFiles/Cor1S88.wav for sample rate 88200
Using convolution file /share/CACHEDEV1_DATA/Music/ConvolutionFiles/Cor1S44.wav for sample rate 44100
Using convolution file /share/CACHEDEV1_DATA/Music/ConvolutionFiles/Cor1S192.wav for sample rate 192000
Using convolution file /share/CACHEDEV1_DATA/Music/ConvolutionFiles/Cor1S44.wav for sample rate 44100
Using convolution file /share/CACHEDEV1_DATA/Music/ConvolutionFiles/Cor1S88.wav for sample rate 88200
Using convolution file /share/CACHEDEV1_DATA/Music/ConvolutionFiles/Cor1S48.wav for sample rate 48000

Wonderful feature!

Again, many thanks for this!

Cheers, SMSWAP
Find all posts by this user
Quote this message in a reply
23-12-2018, 07:30
Post: #28
RE: Room correction with convolution per sample rate
Just as a summary for everyone who'd like to replicate this:

Minim Server 0.8 update 126.1
Minim Streamer 0.7.10.1
FFMPEG 4.1

Configuration:
stream.converter /share/CACHEDEV1_DATA/.qpkg/ffmpeg/ffmpeg
stream.options convOut=-i /share/CACHEDEV1_DATA/Music/ConvolutionFiles/Cor1S*.wav -lavfi afir=gtype=gn
stream.transcode flac:wav24; ,wav:wav;
Find all posts by this user
Quote this message in a reply
24-12-2018, 19:13
Post: #29
RE: Room correction with convolution per sample rate
Simon,

I followed your instructions to upgrade MinimServer and MinimStreamer on my Melco server - all without any problems.

Quote: 1) Select the Packages tab in the Properties window
2) In the 'Other package' tab, type: MinimServer-0.8-update-126.1
3) Click Install and follow the prompts to install the package
4) When installation has completed, in the 'Other package' tab, type: MinimStreamer-0.7.10.1
5) Click Install and follow the prompts to install the package
6) When installation has completed, click Relaunch to relaunch MinimServer and MinimStreamer

I configured MinimStreamer as follows:

stream.options:
convOut=-i /mnt/disk1/share/MinimServer/convolution/Cor1S*.wav -lavfi afir=gtype=gn

stream.transcode:
flac:wav;

On the Melco server, I have the following convolution files in /mnt/disk1/share/MinimServer/convolution

Cor1S44.wav
Cor1S48.wav
Cor1S88.wav
Cor1S96.wav
Cor1S176.wav
Cor1S192.wav
Cor1S352.wav
Cor1S384.wav

These are the same files that I uploaded to box.com:
https://app.box.com/s/272tgj9lfdlrp6txt4c0uc111ubcfmij

I tested a variety of sample rates, just to see if the output is reasonable.

There was a problem with the Melco CPU not being able to keep up with the convolution processing for 352 kHz and 384 kHz files (the music would pause for a second, about every five seconds). But this is unrelated to MinimStreamer.

The only problem I found was for 48 kHz files.

I got the following "verbose" logs from MinimWatch:

Quote: Using convolution file /mnt/disk1/share/MinimServer/convolution/Cor1S44.wav for sample rate 44100
Using convolution file /mnt/disk1/share/MinimServer/convolution/Cor1S48.wav for sample rate 48000
Converter program ended unexpectedly with exit value 135
Using convolution file /mnt/disk1/share/MinimServer/convolution/Cor1S48.wav for sample rate 48000
Converter program ended unexpectedly with exit value 139
Using convolution file /mnt/disk1/share/MinimServer/convolution/Cor1S88.wav for sample rate 88200
Using convolution file /mnt/disk1/share/MinimServer/convolution/Cor1S96.wav for sample rate 96000
Using convolution file /mnt/disk1/share/MinimServer/convolution/Cor1S176.wav for sample rate 176400
Using convolution file /mnt/disk1/share/MinimServer/convolution/Cor1S192.wav for sample rate 192000
Using convolution file /mnt/disk1/share/MinimServer/convolution/Cor1S352.wav for sample rate 352800
Using convolution file /mnt/disk1/share/MinimServer/convolution/Cor1S384.wav for sample rate 384000

With 48 kHz, there would be an error, no music would play, and JRiver (the Control Point) would switch to the next track. It's odd that the errors were 139 or 135.

Perhaps there is an error with my 48kHz convolution file. But the same file works with the JRiver convolution engine. You should be able to check this in your Melco system with my Cor1S48.wav (available at box.com link above).

I next tested the convolution files individually. When I changed stream.options to point to the 48 kHz convolution file in MinimWatch:

convOut=-i /mnt/disk1/share/MinimServer/convolution/Cor1S48.wav -lavfi afir=gtype=gn

I immediately got an error when I clicked "Apply":

Quote: convOut option incorrect for converter; correct highlighted value and retry

I'm guessing that MinimStreamer does a test run when "Apply" is clicked, and there is some problem detected with my 48 kHz convolution file.

I did not have a problem when I tried each of the other convolution files individually (44 kHz, 88 kHz, 96 kHz, 176 kHz, 192 kHz, 352 kHz, 384 kHz).

On a related topic, I'm guessing there is no way to get convolution to work with .dsf files, since with ffmpeg, convolution is done before conversion. So a .dsf will be convolved and then converted to 24/176 - which is not possible (cannot process one-bit DSD without converting to PCM first). This is different from JRiver, where the conversion is done before convolution.

I tested this - by changing stream.transcode to:
flac:wav;, dsf:wav24;176

When I played a regular (DSD64) .dsf file, the log complained:

Quote: Warning: no convolution file for stream sample rate 2822400; using /mnt/disk1/share/MinimServer/convolution/Cor1S44.wav
Converter program ended unexpectedly with exit value 1
and no music played (not unexpected).
Find all posts by this user
Quote this message in a reply
24-12-2018, 19:29
Post: #30
RE: Room correction with convolution per sample rate
Thanks very much for doing this very detailed testing.

The processor in the Melco N1 isn't very powerful and I am not surprised that it struggles to keep up with convolution processing on 352 kHz files.

The 48 kHz problem is caused by a bug (segmentation fault) in ffmpeg. It doesn't happen with a Windows build of ffmpeg, only with the armhf build used by the Melco. I tried the latest git version (20081220) and the bug is still there.

It isn't very easy to report bugs like this because FFmpeg is distributed as source code. All binaries available for download are produced by other parties. I will try building this from source myself to see if I get the same problem. It will be a week or so before I can do this.

I can't see any way to get FFmpeg to transcode from DSF to PCM before applying the filter. The only solution I have found on the forums is to create two instances of ffmpeg connected via a pipe and this would require major changes to how MinimStreamer does transcoding.

I am not sure why attempting this with a DSF file produces the "ended unexpectedly" error that you are seeing. I will do some investigation and post back here. Again, it will be a week or so before I can do this.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)