# SPL calibration not saved (user error? bug?)



## jefferee (Jul 16, 2012)

Greetings.

The SPL calibration for my measurement mic is not being saved after I exit REW.

I can run the SPL calibration from the meter screen (using a CheckMate SPL meter to measure level at the mic) which turns the red numbers on the meter to white, but if I close REW and open it again the calibration disappears and the numbers are red.

I'm using a Presonus FireStudio interface connected by FireWire, ASIO drivers, Win 7 Ultimate. My user account on the computer has local administrator privileges.

I've tried it on a couple different channels of the FireStudio, and with the standard and private-JRE versions of the install.

Any ideas? Where should that calibration file be stored, so I can check whether or not it's saved and for any oddities in those folder permissions?

Thanks.


----------



## JohnM (Apr 11, 2006)

Hi Jeff, that is a bug in V5.12 (when using ASIO drivers), it will be fixed in the next release but has already been fixed in the V5.13 beta versions, you can find them at http://roomeqwizard.com/installers/ - the latest is beta 7.


----------



## jefferee (Jul 16, 2012)

Thanks, John.


----------



## barsailer (Aug 12, 2015)

Hello,

Thanks John, I was also experiencing same troubles with SPL calibration and error messages indication SPL level was not propelly calibrated at each MEASURE session, now all is fine with 5.13 beta 8.

For the purpose of REW software duplication from one PC to another, I'm also interested to learn where is SPL calibration data stored ( Sound card and mic calibration files are well identified but not SPL meter level ) in order to get advantage of the calibration session that was done with a loan SPL meter no longer available.

Thanks in advance


----------



## JohnM (Apr 11, 2006)

The SPL offset for calibration is stored in the registry in Windows in HKEY_CURRENT_USER\Software\JavaSoft\Prefs\room eq wizard, in a key called lastSplOffset. There is another key called splcaldone which is true if the SPL has been calibrated. Note, however, that the SPL offset is only valid for the input volume setting at which it was done, any change in the input volume setting (or any other gain setting in the input path) will mean the offset is no longer correct.


----------



## barsailer (Aug 12, 2015)

John,

Many thanks for the hints.
Yes it is perfectly understood, Any Input level variation would affects the resulting SPL calibration.

I use always Digibox Mbox 1 external soundcard, and I assumed I'm able to get always the same Input level by verifying soundcard input level using Loopback calibration procedure.

Thanks again.


----------



## MABO (Oct 2, 2015)

Hi, I am browsing the forum because I also have this problem in Linux (Lubuntu 14.10) with REW 5.13
When I install it on my daughters windows PC it works though.

So either the bug has been solved in REW windows but not in the Linux version,
or I am doing something wrong, which is very possible as I just start using REW.

I also see that with the Alsa mixer I can change the input sensitivity of the Umik-1, so it does not seem to be possible to do a real SPL calibration, unless you always use the same input sensitivity setting before starting REW.
To do this, I add this line to the REW startup script because I thougt that was the reason why the SPL calibration was not used when starting REW again, 
but it does not help, REW still says that SPL is not calibrated and displays red SPL readings instead of white.

#!/bin/sh
*amixer -c 1 set Mic 55*
# Uncomment the following line to override the JVM search sequence
# INSTALL4J_JAVA_HOME_OVERRIDE=
# Uncomment the following line to add additional VM parameters
# INSTALL4J_ADD_VM_PARAMS=


When Using REW in windows, the calibration remains valid, even if you change the Umik-1 input sensitivity with the windows mixer, I suppose REW takes the windows mixer settings into account ??

Please let me know if I am doing something wrong.
If you think it is a bug, let me know if you need me to send you some error logs or do some tests to give you more info on this.

PS: I replaced openjave by oracle java 8 to solve some problems with generating audio.


----------



## MrGrey (Oct 6, 2015)

This problem with REW forgetting the UMIK-1 calibration file wile using ASIO drivers continues in the latest release and in REW_windows_5_14_beta3, is there no fix? its a real pain. i am on Windows 10 Pro x64


----------



## JohnM (Apr 11, 2006)

To apply the sensitivity value in the cal file REW needs to know it is using a UMIK for input. It determines that by checking the input name to see if it contains 'UMIK'. That has become problematic on Win8.1 and Win10 of late as the UMIK sometimes appears as a generic USB audio device instead of showing the UMIK name. MiniDSP are looking into that, though it seems to be a Windows change that has prompted it. A similar problem may affect Linux.


----------



## MrGrey (Oct 6, 2015)

OK thanks for the information.


----------



## MABO (Oct 2, 2015)

JohnM said:


> To apply the sensitivity value in the cal file REW needs to know it is using a UMIK for input. It determines that by checking the input name to see if it contains 'UMIK'.


I just checked in linux, the name UMIK is not available in alsa mixer, like in W8&10 it has a generic name.
*amixer -c 1 contents*
The -c option means that the next digit selects the sound device (in this case 0 is my laptop soundcard and 1 is the UMIK)
The command contents tells amixer to readout and display the settings of the selected sound device
numid=2,iface=MIXER,name='Mic Capture Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
numid=3,iface=MIXER,name='Mic Capture Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=55,step=0
: values=55,55
| dBminmax-min=-31.00dB,max=24.00dB
numid=1,iface=PCM,name='Capture Channel Map'
; type=INTEGER,access=r----R--,values=2,min=0,max=36,step=0
: values=0,0
| container
| chmap-fixed=FL,FR

In REW it shows up as U18db [plughw:1.0]
Is it not possible to change something in the preferences gui to enable users to designate this as UMIK and save this choice in some configuration file ?
Please mind that I am not a java developper, I am just thinking outloud, trying to offer some ideas to implement a solution
and may be this idea is just impossible to realise.


----------



## JohnM (Apr 11, 2006)

MABO, could you use the 'Generate Debug File' button on the REW soundcard preferences and attach the file that produces here, please?


----------



## MABO (Oct 2, 2015)

Uploading the file is not possible, it exceeds the max allowed space of this forum.

Perhaps these are the things you need:
SoundCard Debug Data generated by REW V5.13
Dated: Oct 10, 2015 11:18:35 AM
Input Device: U18dB [plughw:1,0]
Input: Default Input
Input Volume: no control
Output Device: Default Device
Output: Default Output
Output Volume: No control
Output Mute: Off
Wave Volume: No control
Wave Mute: Off

4: U18dB [plughw:1,0], ALSA (http://www.alsa-project.org), 3.19.0-30-generic, Direct Audio Device: Umik-1 Gain: 18dB, USB Audio, USB Audio
Line interface TargetDataLine supporting 16 audio formats, and buffers of at least 32 bytes (max. 1 simultaneously): 
0: PCM_SIGNED unknown sample rate, 24 bit, mono, 3 bytes/frame, little-endian (1 channels, frameSize=3, little endian)
1: PCM_SIGNED unknown sample rate, 24 bit, mono, 3 bytes/frame, big-endian (1 channels, frameSize=3, big endian)
2: PCM_SIGNED unknown sample rate, 24 bit, stereo, 6 bytes/frame, little-endian (2 channels, frameSize=6, little endian)
3: PCM_SIGNED unknown sample rate, 24 bit, stereo, 6 bytes/frame, big-endian (2 channels, frameSize=6, big endian)
4: PCM_SIGNED unknown sample rate, 20 bit, mono, 3 bytes/frame, little-endian (1 channels, frameSize=3, little endian)
5: PCM_SIGNED unknown sample rate, 20 bit, mono, 3 bytes/frame, big-endian (1 channels, frameSize=3, big endian)
6: PCM_SIGNED unknown sample rate, 20 bit, stereo, 6 bytes/frame, little-endian (2 channels, frameSize=6, little endian)
7: PCM_SIGNED unknown sample rate, 20 bit, stereo, 6 bytes/frame, big-endian (2 channels, frameSize=6, big endian)
8: PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, little-endian (1 channels, frameSize=2, little endian)
9: PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, big-endian (1 channels, frameSize=2, big endian)
10: PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, little-endian (2 channels, frameSize=4, little endian)
11: PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, big-endian (2 channels, frameSize=4, big endian)
12: PCM_SIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame, (1 channels, frameSize=1, little endian)
13: PCM_UNSIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame, (1 channels, frameSize=1, little endian)
14: PCM_SIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame, (2 channels, frameSize=2, little endian)
15: PCM_UNSIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame, (2 channels, frameSize=2, little endian)

LineUnavailableException when trying to open this line
[no controls]

6: Port U18dB [hw:1], ALSA (http://www.alsa-project.org), 3.19.0-30-generic, Umik-1 Gain: 18dB, USB Mixer
Port Mic source port
Controls[0]: CompoundControl: Mic Control containing Volume, Balance, and Select Controls.
MemberControls[0]: FloatControl: Volume with current value: 1.0 (range: 0.0 - 1.0)
MemberControls[1]: FloatControl: Balance with current value: 0.0 (range: -1.0 - 1.0)
MemberControls[2]: BooleanControl: Select Control with current value: true

I shared the complete file on 
https://drive.google.com/file/d/0B7s5wjwdpM2pSFBTcXptSVZrYnc/view?usp=sharing


----------



## JohnM (Apr 11, 2006)

Very helpful, thanks. Please try V5.14 beta 5 (linux) to see if it manages to detect the UMIK and if it allows an input to be selected for it (rather than just showing default input).


----------



## MABO (Oct 2, 2015)

I installed the beta5
- First renamed the old REW directory
- Installed the beta5 version
When I run it, I cannot select an output device, the dropdown box is empty,there is nothing to select.

You can find the full soundcard debug file here 
https://drive.google.com/file/d/0B7s5wjwdpM2pRkVialgwQnMxRVU/view?usp=sharing

SoundCard Debug Data generated by REW V5.14
Dated: Oct 10, 2015 10:09:54 PM
Input Device: U18dB [plughw:1,0]
Input: null
Input Volume: no control
*Output Device: null*
Output: null
Output Volume: No control
Output Mute: Off
Wave Volume: No control
Wave Mute: Off

4: U18dB [plughw:1,0], ALSA (http://www.alsa-project.org), 3.19.0-30-generic, Direct Audio Device: Umik-1 Gain: 18dB, USB Audio, USB Audio
Line interface TargetDataLine supporting 16 audio formats, and buffers of at least 32 bytes (max. 1 simultaneously): 
0: PCM_SIGNED unknown sample rate, 24 bit, mono, 3 bytes/frame, little-endian (1 channels, frameSize=3, little endian)
1: PCM_SIGNED unknown sample rate, 24 bit, mono, 3 bytes/frame, big-endian (1 channels, frameSize=3, big endian)
2: PCM_SIGNED unknown sample rate, 24 bit, stereo, 6 bytes/frame, little-endian (2 channels, frameSize=6, little endian)
3: PCM_SIGNED unknown sample rate, 24 bit, stereo, 6 bytes/frame, big-endian (2 channels, frameSize=6, big endian)
4: PCM_SIGNED unknown sample rate, 20 bit, mono, 3 bytes/frame, little-endian (1 channels, frameSize=3, little endian)
5: PCM_SIGNED unknown sample rate, 20 bit, mono, 3 bytes/frame, big-endian (1 channels, frameSize=3, big endian)
6: PCM_SIGNED unknown sample rate, 20 bit, stereo, 6 bytes/frame, little-endian (2 channels, frameSize=6, little endian)
7: PCM_SIGNED unknown sample rate, 20 bit, stereo, 6 bytes/frame, big-endian (2 channels, frameSize=6, big endian)
8: PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, little-endian (1 channels, frameSize=2, little endian)
9: PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, big-endian (1 channels, frameSize=2, big endian)
10: PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, little-endian (2 channels, frameSize=4, little endian)
11: PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, big-endian (2 channels, frameSize=4, big endian)
12: PCM_SIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame, (1 channels, frameSize=1, little endian)
13: PCM_UNSIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame, (1 channels, frameSize=1, little endian)
14: PCM_SIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame, (2 channels, frameSize=2, little endian)
15: PCM_UNSIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame, (2 channels, frameSize=2, little endian)

LineUnavailableException when trying to open this line
[no controls]

6: Port U18dB [hw:1], ALSA (http://www.alsa-project.org), 3.19.0-30-generic, Umik-1 Gain: 18dB, USB Mixer
Port Mic source port
Controls[0]: CompoundControl: Mic Control containing Volume, Balance, and Select Controls.
MemberControls[0]: FloatControl: Volume with current value: 1.0 (range: 0.0 - 1.0)
MemberControls[1]: FloatControl: Balance with current value: 0.0 (range: -1.0 - 1.0)
MemberControls[2]: BooleanControl: Select Control with current value: true

When I start the previous version from the remamed directory, I can select the output device and sound is coming out of the laptop speaker.


----------



## JohnM (Apr 11, 2006)

Is there anything available in the input list for U18db?
Please try V5.14 beta 6 (linux).


----------



## MABO (Oct 2, 2015)

Just a quick feedback, because I have to leave to visit some family:

In beta5 there was nothing in the output list, and in the input list I saw my laptow soundcard and the umik

In beta6 both output and input dropdown boxes have multiple items in the list and I can generate sound and measure it via umik
When starting up, the preferences of V13 seemed to be there (umik calibration file, soundcard selection) but the measurement icon was grayed out.
So via the menu I deleted all preferences and restarted REW5.14beta6
It asked me if the mic was an umik, and asked to import the calibration file.
Afterwards in preferences I did not see the mic cal file, and when I tried to import it, it did not show in the mic preferences tab eiter
I could do a quick measurement though.
I'll do some better tests when I come back from the family visit.


----------



## MrGrey (Oct 6, 2015)

Any updates on the issue?


----------



## pocek (Dec 11, 2015)

Regarding UMIK-1 detection and SPL calibration under Linux: detection works fine in v5.14 beta 14. SPL - I'm not sure. REW is now able to control/read the mixer ("Mic") but then it gives different results than "Default Input" (set to 0 dB in alsamixer). When configuring the device from "MiniDSP UMIK-1 detected" dialog, REW sets the mixer to -18 dB. Readings are way too low. When configuring it manually with "Mic" selected but "Control input mixer/volume" unchecked (mixer left at 0 dB), it comes up with lower SPL readings than v5.13 or v5.14 beta and "Default Input".

Unfortunately using "Default Input" leads REW to forget on subsequent run that it's been calibrated, just like v5.13 (it can recognize Umik-1 too, with some tricks).

So it looks like if REW is able to interpret mixer settings it skews the results in some way. Unfortunately I don't have anything to compare it to and don't know which configuration is correct, if any. I'm happy to test if further. I'm also a programmer, if that's of some use.


----------



## JohnM (Apr 11, 2006)

Could you use the button on the Soundcard preferences to generate a soundcard debug file, please? I suspect the issue is how the volume control settings are returned. REW needs to know the volume control setting to allow for that when calculating the SPL. On Windows and OS X a 0..1 figure is returned, which then needs mapping onto a dB value, the mapping is OS Version and device dependent.


----------



## pocek (Dec 11, 2015)

0%:

```
13: Port Umik-1 [hw:3], ALSA (URL...), 4.2.0-1-amd64, Umik-1  Gain: 18dB, USB Mixer
  Port Mic source port
    Controls[0]: CompoundControl: Mic Control containing Volume, Balance, and Select Controls.
      MemberControls[0]: FloatControl: Volume with current value: 0.0  (range: 0.0 - 1.0)
      MemberControls[1]: FloatControl: Balance with current value: 0.0  (range: -1.0 - 1.0)
      MemberControls[2]: BooleanControl: Select Control with current value: true
```
100%:

```
MemberControls[0]: FloatControl: Volume with current value: 1.0  (range: 0.0 - 1.0)
```
0dB:

```
MemberControls[0]: FloatControl: Volume with current value: 0.56363636  (range: 0.0 - 1.0)
```

On Linux (ALSA) level Umik-1 reports 0-55 "raw" volume value range, that means 55 steps in -31 dB to +24 dB range. Raw value 31 is 0 dB. 31/55 = 0.56363636.

$ amixer -D hw:CARD=Umik-1 set Mic 0dB 
Simple mixer control 'Mic',0
Capabilities: cvolume cswitch cswitch-joined
Capture channels: Front Left - Front Right
Limits: Capture 0 - 55
Front Left: Capture 31 [56%] [0.00dB] [on]
Front Right: Capture 31 [56%] [0.00dB] [on]

As far as JavaSound and its ALSA backend goes, it's unlikely to differ between Linux versions but it can likely differ between devices, like you said.


----------



## JohnM (Apr 11, 2006)

That's great, thanks. Rather more logical mapping than Windows or OS X. I've incorporated that in beta 15, should be available from the installers directory in a few minutes. If it's working correctly the SPL readings should remain consistent as the volume setting is adjusted, provided the UMIK-1 input has been selected on the soundcard preferences.


----------



## pocek (Dec 11, 2015)

Thanks! It seems to work like intended. I can see how lastSplOffset reacts to Mic mixer changes and it all makes sense now (mixer -= 1dB -> lastSplOffset += 1dB).

If we know all the inputs, I'd love to confirm that the value is calculated correctly, just to be sure. So, I've deleted the configuration and let REW do everything again. With mixer at 0dB, "Sens Factor =-.2354dB" I get lastSplOffset = 124.2354. Is this theoretically correct?


----------



## JohnM (Apr 11, 2006)

Excellent. Yes, that's exactly what it should be, 124 dB - sens factor - gain.


----------



## pocek (Dec 11, 2015)

Great! Thank you once again, John. I really appreciate that REW for Linux has such an excellent support.


----------



## ringor (Jul 27, 2014)

I'm new to REW and just bought a UMIK-1 to measure and improve two rooms. After a quick check with my desktop PC (Windows 7) everything seemed to work fine; the microphone was recognised, the calibration file got accepted and the SPL-meter showed plausible numbers (in white).

Since my desktop PC is a little too unwieldy to measure the two rooms in question, I tried REW on my notebook (Linux) instead. And that's where the trouble started. But then I found this thread describing my problems and the beta version 5.15 beta 2 for Linux in it so I gave it a try on two different Linux systems.

Both show different problems now, so I wanted to share my experiences. :wink2:

First I tried it on the exact same desktop PC where everything worked okay with Windows 7 - but I used Debian 7 (OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-1~deb7u1)) instead. If I choose "PulseAudio Mixer" for my Input Device, the microphone works and the SPL-meter's numbers seem about right - but are shown in red. I can load the calibration file but REW seems not to accept it for this Input Device and asks my every time I start REW if I want to use my UMIK instead.

Well - when choosing "U18db" for my Input Device, I get an exception:


```
Exception trying to open record device 
javax.sound.sampled.LineUnavailableException: U18dB [plughw:1,0] does not have any lines supporting PCM_SIGNED 48000.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian
```
I guess this has something to do with every device only showing "unknown sample rates":

```
5: U18dB [plughw:1,0], ALSA (http://www.alsa-project.org), 1.0.24, Direct Audio Device: Umik-1  Gain: 18dB, USB Audio, USB Audio
  Line interface TargetDataLine supporting 16 audio formats, and buffers of at least 32 bytes (max. 1 simultaneously): 
  0: PCM_SIGNED unknown sample rate, 24 bit, mono, 3 bytes/frame, little-endian (1 channels, frameSize=3, little endian)
  1: PCM_SIGNED unknown sample rate, 24 bit, mono, 3 bytes/frame, big-endian (1 channels, frameSize=3, big endian)
  2: PCM_SIGNED unknown sample rate, 24 bit, stereo, 6 bytes/frame, little-endian (2 channels, frameSize=6, little endian)
[...]
```
 (full file at http://pastebin.com/QbiWMZNR)

But I can live with that - it's still my unwieldy PC we are talking about. :smile:

So here comes my notebook: Ubuntu 15.10, Oracle JRE 1.8. REW detects the UMIK (every time anew...), asks for the calibration file but seems not to use it, even if the Input Device is "U18db" and the calibration file's filename is shown on the Mic/Meter-tab. The SPL-meter's red numbers are way too low, even negative. (Debug-output at http://pastebin.com/iQ60vcuw)

Since I neither want to carry my desktop PC around the house nor install Windows on my notebook I'm all ears for any advice. :smile:


----------



## JohnM (Apr 11, 2006)

"Unknown sample rate" is OK, means it will allow any. PulseAudio might confuse REW somewhat since it seems to use a 0 - 65536 volume control range in "pulseaudio units" rather than 0 - 1. There is an old (and nowadays unnecessary) check for a 0 - 1 range in part of the code that reads the volume setting to apply the calibration data, I'll remove that for the next beta release but I'm in the middle of other changes to allow an acoustic timing reference so can't make a beta release at the moment. Not sure what the issue might be on the notebook unless some other application might have locked the UMIK input, looks like REW is being told the input isn't available.


----------



## ringor (Jul 27, 2014)

The seemingly locked UMIK-device on my desktop PC doesn't bother me too much. Maybe the belated installation of PulseAudio by Steam broke something. On my notebook PulseAudio came with Ubuntu's default installation and is nearly invisible to the user (e.g. no "Pulse Audio"-devices to choose in REW).

I'm in no hurry. I will happily wait for the next beta version. :smile:

Thanks for your great help!


----------



## ringor (Jul 27, 2014)

Sorry for the delayed feedback, but I only just found the new beta version(s). 

With 5.15 beta 3 and 4 my notebook (Ubuntu) now recognises the UMIK-1 correctly.
The SPL-meter's numbers are shown in white and seem plausible.

The only difference to the Windows version is the little point of beeing asked if I wanted to use the UMIK-1 every time I start REW, where the Windows version remembers the device. And the REW window beeing opend behind every other window on Linux, where the window is opened on top on Windows.

But those are purely cosmetic issues. Since beta 3 I can work with REW on my notebook. 
Thank you for your wonderful work! :smile:


----------

