Home Theater Forum and Systems banner

Getting around the limitations of JavaSound on OS X

86K views 170 replies 41 participants last post by  mikaelb 
#1 · (Edited)
John Reekie has produced a great blog post about how to work around the problems Java has on OS X with audio input from Firewire cards, multi-input USB cards and 48kHz sources. You can find the cure for these JavaSound ills at Room EQ Wizard on the Mac - An Input Workaround. Great work John, and thank you!

Edit 12th September: Here is a related post on using HDMI output with REW on OS X, thanks to EmagSamurai: 8 channel HDMI output from REW on the Mac.

Edit 29th June 2014: Use V5.01 beta 21 or later (available here) for OS X 10.7.3 onwards, removes the need for workarounds.
 
#32 ·
I have a Umik-1 here connected to my mac mini and I was wondering if I can measure an accurate absolute SPL level now ?

If I start the REW software on OSX it is advised to use Soundflower, LineIn and Audio Midi Setup.
I noticed that the following settings influenced the SPL readout:
-1- System Preferences - Sound - Soundflower (2ch) - Input volume
-2- Audio Midi Setup - Umik-1 - Sliders
-3- Audio Midi Setup - Soundflower - Input - Sliders
-4- Audio Midi Setup - Soundflower - Output - Sliders

In the REW software -2- is advised to be set at 0 dB

Does anybody know what are the right settings for -1- ; -3- ; -4- to have the right readout of SPL in the Umik-1?
 
#44 · (Edited)
Hi again, I'm not sure that you can (usefully) run a measurement sweep with your amps switched off, as REW won't be able to calculate a proper impulse response. If you are measuring ambient noise, use the RTA function. Bear in mind that USB mics are probably not the best tool for this anyway, as they are not as quiet as phantom powered mics and an external soundcard. Quiet mics = expensive...

With regard to the SPL level reported by UMIK-1, with the pink noise generator and the SPL meter, I got the same reading on the Mac with the Soundflower input level set full up (as shown in tutorial), as on Windows in a VM. I don't have a calibrated SPL meter to compare them against for absolute accuracy, the point is that the result on a Mac is the same as on Windows.

Note that the generated SPL under Windows was 3 dB higher (with the same setting in the Generator), I'm not sure why but didn't bother to track it down as it has no effect on the mic calibration/SPL reading.

-1- System Preferences - Sound - Soundflower (2ch) - Input volume
Leave full up as shown in tutorial - http://johnr.hifizine.com/2013/02/room-eq-wizard-on-the-mac-an-input-workaround/.
-2- Audio Midi Setup - Umik-1 - Sliders
As instructed by REW, set to 0 dB.
-3- Audio Midi Setup - Soundflower - Input - Sliders
This is the same parameter as #1 above.
-4- Audio Midi Setup - Soundflower - Output - Sliders
This is on the output side and has no effect on the mic calibration.

Hope this helps :)
 
#39 ·
Thanks John.

If in Audio Devices - Soundflower (2ch) input is at 0 dB (see screenshot) there is no measurement at all.
Also in in Preferences - Sound Input and Output there is no setting in dB, just percentage.

I guess I'm not the only one with OSX and Umik-1 who wants absolute SPL level, do I understand correctly that this is not possible?

I also received no answer from the minidsp help desk, can someone point me in the right direction for support on this issue or is this the wrong thread?

Is it still necessary to use Soundflower and LineIn at this point in time ?

I tried searching the forum but it is hard to find the right info, I also read the thread about the Umik-1 but no luck there also.

Would it make more sense to use Windows as a virtual machine in OSX, can I have absolute SPL then?

.
 

Attachments

#34 ·
Hello, first of all I apologize for all my possible errors since English is not my language.
I just downloaded the beta version for macosx but when I launch it the Mac says it is corrupted and the system asks me if I want to put it in the trash.
What should I do what is the link that I have to choose?
Sorry if i'm in the wrong 3ad... :help:
 
#36 ·
No isn't this the problem.
It's not a gatekeeper issue. I can open (ctr->open) a file and launch it.
Now, when I try to launch this REW version, the system says to me "the file is damaged and cannot be open"
P.S. I don't know English but I know the Mac since 1988 :nerd:
 
#37 ·
Regardless of how long you have been around Macs, I would suggest that you use the advanced search function ( for this forum ) .

- Look for posts from user JohnM & search for the word gatekeeper .
- Display the search results as threads ( & then follow the trail of bread-crumbs to one answer ).

:sn:
 
#40 ·
It should work fine using Windows in a VM.

Soundflower and LineIn are required for OSX, MiniDSP provide setup help in their application notes: http://www.minidsp.com/applications/acoustic-measurements

For the Soundflower setting the displayed dB value doesn't look meaningful - 0 dB should mean unity gain, what does the dB figure show if the level is set to the maximum? It may be that full/100% is unity gain.

If you have an external SPL meter you can calibrate REW against that as another route to correct SPL values.
 
#41 ·
I have seen minidsp's notes but they don't answer my specific questions.
Did you try the Umik-1 yourself with OSX?

Max level is Value "1" and 40.5 dB, I will try tomorrow how this looks.

I have an (uncalibrated) SPL meter that I can compare (Voltcraft Sound Level Meter).
Did I understand correctly that the Umik-1 should be compared at 1000Hz against the SPL meter (C-weighed)
 

Attachments

#42 ·
If you have the ability to run REW in a VM, then you could compare the result on the two OS for yourself. I'll see if I can get a chance to do that today. I've been assuming that setting Soundflower to "1" and System Preferences all the way up will give unity gain at those points.
 
#43 ·
Thanks, good to know I'm not the only person having a Umik-1 with OSX :)

With the setting as mentioned I read a very high SPL in a more or less quiet room.

Which leads me to my other issue, there is a big difference between my SPL meter A weighed and Z weighed (both readouts of 55 dB and 98dB in a quiet room).

This is because the Umik-1 seems to pick up a lot of low frequencies, there is about a 40 dB difference in SPL level between below and above 200 Hz, I have seen this when I did a measurement sweep with my amps switched off (so again in a quiet room).

See waterfall that I did previously.
Any ideas?

.
 

Attachments

#45 · (Edited)
Hi thanks a lot (again), I think I'm getting closer.

- For me it didn't really work with a virtual machine, maybe my machine (mac mini 2011) is too slow (delays and time outs)

- In Audio Midi Setup - Soundflower - Input - Sliders I have them all full up now at 1 (40,5 dB)

- The Audio Midi Setup - Soundflower - Output - Sliders DOES influence my mic readout, so left them all three at 1 (0dB)

- What bothers me most is not so much the absolute level but more the difference in level between low and high frequencies, this is what my RTA looks like in a more or less silent room with settings as described above. Is this normal behavior? What would this normally look like?
 

Attachments

#47 ·
Ok, so this looks right, then I don't have to worry sending back the microphone?

I still see the difference of about 40 dB, where does it come from?

I can understand there is a noise floor but why is this so much higher in the low frequencies?

Does this mean that I have to measure at about (50 + 60 =) 110dB to be able to see meaningful RT60 figures or am I mixing up things now? (ok, I know, I have to start reading the docs now :heehee: )
 

Attachments

#48 ·
#51 ·
NG

Umik-1 OSX Mavericks. Previously I posted that I had achieved a workable situation by tweaking many of the settings. I was able to force reasonable SPL readings and get Waterfalls etc. without warnings. However the measurements are faulty. They have weird HF oscillations in them.
I have to conclude the REW does not work with the UMIK-1 on OSX.
DD
 
#56 · (Edited)
A new solution: OSXJack. Works great!

I've conquered the loopback and OSX limitation issues and solved some Mavericks issues. I think this solution is actually fun. It's certainly more elegant in my mind than the previous workarounds. It doesn't even feel like a workaround. Now that I've caught your attention, here are

Instructions for using REW with loopback with OSX Mavericks, using JackOSX.

This method makes the ergonomics easier. Adapt this to your needs as you wish. JackOSX is very versatile. You can feed multiple outputs at once if desired. Jack replaces and surpasses the power of both Soundflower and Line In. The interface I'm using is the Motu Audio Express. Any interface which has combo mike/line inputs and which has two analog inputs as its first pair will work easily. Make a 1/4" to 1/4" analog patch cord for the analog loopback.

My goal: To feed REW's test signal to the digital input of a DAC, and selectively feed either the left or right channel so we can test either the left or right loudspeaker. AND, to have analog loopback from the interface so we can measure time-of-flight latency and center the microphone between left and right loudspeakers. If you are using an analog feed to your loudspeakers it's just a little less patching, but still you will need JackOSX.

UPDATE: I made this test with the MOTU interface's USB connection. When I tried Firewire I could not get it to work on my Retina/Mavericks or my MacPro/Snow Leopard. It would not appear as a device in OSX Sound Preferences. Perhaps the Motu driver is too new and will only work with Mavericks on a Mac which has native firewire, but I do not have Mavericks installed on the MacPro. If you have a Firewire interface and a Mac with native firewire (as opposed to a Thunderbolt adapter) perhaps this procedure will work.

1) Install JackOSX. http://sourceforge.net/projects/jackosx/?source=dlp. It's also free. Thank heaven for the developers! I found JackOSX 0.89 is completely stable in Mavericks. It's even more stable than Audio MIDI setup, which crashed for me all the time when I was trying the other workarounds. You won't even have to touch Audio MIDI setup for this procedure! JackOSX has thorough and easy-to-understand documentation. Jack allows you to patch any audio application (in fact multiple applications at once if desired). Read the JackOSX documentation. If some parts are a little obscure, they will become clear as soon as you use it. You will have to restart your computer after the install as JackOSX becomes part of the underlying operating system and becomes a device for sound input and output.

2) Run JackPilot, which has been installed in applications. Put the application in your dock for regular use. In Jack Preferences, set Press Start in JackPilot. This will enable JackRouter as an available output and input device.

3) In JackPilot Preferences, set JackPilot as pictured in the attached image. If your interface has fewer input or output channels, you can set it for less. Leave the Auto-connect off, it adds unnecessary patches for our purposes that you will have to unpatch. Leave System port monitoring off, it doesn't harm to turn it on, but it adds unnecessary inputs/outputs to Jack's patching matrix.

4) In OSX Sound preferences, set JackRouter as the Default output device, as pictured in the attached image. There is no need to set anything as your default input device, but you could set the Motu as the device so you can see the Motu mike signal on OSX's meter as a test. This is because REW has to use the default device as its output, but REW can choose your interface directly as its input device. REW defaults to the first two inputs of the interface for its main and reference inputs. (This procedure could be done with JackRouter as the default input device but it is unnecessary and would add extra patching within Jack.)

5) Connect your microphone to Motu input 2. For some reason the main input of REW defaults to input 2 and the Reference input to input 1. Who knows... UPDATE: This was true on my Macbook Pro/Mavericks. On the MacPro/Snow Leopard, Mike 1 is the input and Line input 2 is the reference. I have no idea at this point how consistent this will be, so check it. See where the mike comes up and if it comes up on the wrong input of REW, reverse things. Remember to switch off phantom power before unplugging a condensor mike!!! Connect an analog 1/4" patch cord from Motu Main out 1 to Line in 1 (or line in 2 if appropriate) for the loopback.

6) Launch REW. Go to Preferences/Analysis. Turn on Use Loopback as timing reference. Go to Soundcard. Set the output to the default device. Set the input to the Motu interface. Choose Use Main Speaker to Check/Set Levels. Press Check Levels. Press Next.

7) Switch to JackPilot. Press Routing. This opens the Connections manager. In a moment, JavaApplications will appear at the bottom of the connections manager. Now we will route REW's outputs to the Motu's SPDIF output(s) AND simultaneously to the Motu's main analog outputs. As pictured in the attached image.

Triangle open the system and the JavaApplications send and receive ports to reveal all the available patch points. Since REW is directly accessing the MOTU on its input, JavaApplications Receive ports will NOT appear in JackRouter. You only have to configure the SEND from REW in Jackrouter. REW itself takes care of the input and return audio. Click on JavaApplications out1 in the left hand column. Click on system playback_1 in the right hand column. Double click on playback_1. It becomes red which means that out1 is routed to playback_1. You should see output on Main 1 on the Motu. AND, presto ---- you will see the mike signal on REW In and the reference signal on REW Ref In!

NB: If you make a mistake in patching in JackOSX, just double click on any node and it will unpatch. Quite elegant for a non-gui application!

Test your work: Pull patch cords to see what happens. Turn the phantom power on the mike on and off and observe that things are patched correctly. This proves the loopback and the Input are working properly. If you are using analog out to loudspeakers, route out1 to playback_2 and this will allow you to feed your analog speakers with an analog cable without a Y cord. But you will have to move cables around to select speakers. With my method you can be a couch potato.

NB: REW feeds both output 1 and output 2 simultaneously so it really doesn't matter if you use output 1 or output 2. Or, you can use this as your virtual "y cord" if you are doing analog speakers.

8) If you are using speakers with digital inputs, like me, use (or add) one more route. Route REW's out1 to playback 5 (which in my interface is SPDIF out Left). Or to playback 6 (which is SPDIF out Right). In this way, Jack is your switcher which selects either left or right loudspeaker. You can be a couch potato, not move a single cable or human being during the measurement. To make things "foolproof", save a pair of Jack Studio setup documents, one for left speaker and one for right and load them to switch loudspeakers. This makes sure your nimble mouse fingers won't accidentally select the wrong patch once you have got things working.

Attached is a picture of a jack route, showing REW routed simultaneously to playback 1 and playback 5 in the Motu.

9) Have fun! Yes. Did I say "Have fun"! This procedure works so well that I am having fun. I must say that the Soundflower/Line Input thing gave me a headache, but Jack just makes me feel real good and real powerful.


Best wishes,


Bob Katz
2/22/14


-------------
Noto bene:

a) With this method, Soundflower and LineIn are NOT NEEDED. Aggregate Devices are NOT NEEDED. MULTIPLE OUTPUT DEVICES ARE NOT NEEDED. In fact, Linein currently is broken on OSX 10.9 Mavericks, it crashes during the install. And I also discovered that Soundflower will not feed any sound to the Motu SPDIF output although it can route to it on screen, no sound makes it to the MOTU SPDIF output. Since I am using SPDIF output AND I want to have analog loopback I have to use this method.

b) You may be able to pull this off with Soundflower alone and not need JackOSX if you are doing an analog feed to loudspeakers only, but I have not tested it. In that case you would use an analog loopback cable from the other analog channel into a combo mike/line input. Or, if you are adventurous, make a 60 dB attenuator, but I won't go there :) And assign REW's input to the Motu interface so you don't need LineIn.

c) Initially I tried to use JackRouter to route the input signals to REW. But for some reason, REW or Java or something parallels the left and right inputs to REW so that both the In and Ref inputs get the same signal. This could be a bug in Java or a bug in REW or something else. Fortunately, if you can use the first two inputs of your interface for in and ref then you do not have to use JackRouter for the input routing. UPDATE: I tried this with my Metric Halo ULN-8 interface (firewire), which has full internal routing facilities and so we would not need JackRouter, and got the same behavior. No matter what channel I routed the mike and loopback to, REW continues to receive information on BOTH the input and loopback. So it appears that REW's input, when set to default device, will not work properly for loopback purposes with routing software.
 

Attachments

#57 ·
Re: A new solution: OSXJack. Works great!

Update and confession:

When I made the previous post I had not taken a measurement. I only tested all the functionality of REW and the interface and observed REW's metering on two different computers. Now I tried my first measurement with the MacPro/Snow Leopard and the recording terminates before the sweep is finished. It ends around 300 Hz and I get this error: "Impulse peak is not where it should be. The measurement may have been corrupted." It doesn't matter if I'm in loopback mode or not. I tried different buffers, no luck. I'm hoping this MacPro is just the problem and I'm setting up my Macbook Pro Retina display in Studio B to try again and we shall see. Wish me luck.
 
#58 ·
Re: A new solution: OSXJack. Works great!

Unfortunately, the same symptom "Impulse response is not where it should be..." occurred with my Macbook Pro Retina display/Mavericks. So I'm dead in the water. I apologize for the premature elation of my post. Everything looked like it was going to be good, except for the actual measurement failure :eek:

I hope that someone out there can solve this issue because as you know from this thread, I had other problems on the PC side.


Back to the Mac: I tried different buffers. I tried non-loopback mode. I tried mike routing into REW from Jack on the theory that the latency has to be the same for the generator and the input. Jack definitely is feeding BOTH inputs of REW even though it sees two input ports on REW. In1 and In2 read on both meters of REW :-(.

I'll play around with a few more ideas, but so far we're dead in the water. If it means anything to you, I was successful using Acourate to analyze this room with the identical interface on the PC and with ASIO. So you might ask why should I bother to use REW if I have Acourate? Good question. Answer: Because REW has a few analysis features that Acourate does not have. And I'm an analysis addict ;-)
 
#59 · (Edited)
Re: A new solution: OSXJack. Works great!

Well, I was able to use Fuzz Measure on this interface and it works fine. So the problems are Java-related. It's a pity that LineInput has broken in Mavericks. I might never have restarted this thread :-(. I'm going back to the PC and try to debug that. It worked once and then failed from that point on (REW was not seeing the interface).
 
#60 ·
Hi Bob. Thanks for your staunch efforts. I have been there....... although the complexities of Jack were beyond me.
Is Line In really broken in Mavericks? I have a new boot SSD in my studio computer. afaik I have successfully used LineIn on Mavericks. ( I use Line In to access Dirac Live as a virtual piece of HW) Long story.
All readers plse note the onboard Line Input and Output both Analogue and Digital Optical on the Mac work fine with REW.
FuzzMeasure works fine with Macs and the IR's can be exported for Import into REW which has more and better analysis features.
DD
 
#61 · (Edited)
Excellent point Dan about exporting the IRs from Fuzzmeasure! That's exactly the procedure I will do from this moment on. I don't know for sure if LineIn is broken on Mavericks, I only know that the installer crashed on my machine. Did you install LineIn back in the day and then upgrade to Mavericks? Jack looks daunting, but it is really a sweet puppy that any engineer who has ever patched a gozinta into a gozouta can conquer. Just read the manual, then turn it on and use it. Suddenly the light bulb will light up and you've got it. Did you read my procedure in the other thread?

As for the onboard of the MacPro. I don't want to go lofi and use the analog interface. However, I do have the optical digital out of the MacPro hooked up and it can feed my DAC in Studio B. For the input side, I'll rig up an SPDIF to Toslink converter and try using the MOTU as a standalone external ADC. If the Mac can be put into external sync on digital in and then Java can address it maybe we can do it that way. Sounds like a project for another rainy weekend.
 
#62 ·
Unfortunately Bob, there is a little more.....
When Exporting from FM, first Normalise, then chose 24 or 32 Bit, not the default 16.
Import the resulting Aiff or Wav into REW and let the analysis begin. In a sense I wish that REW also cost 150 bucks because FM is kinda withering on the vine because the developer is trying to make a living with his other (quite interesting) iapps.
I will try Jack, reading your above post, in an effort to enable my Dirac Live workaround, which despite your gozintas and outas, which I regularly use, would make your eyes water. LineIn works for me but randomly comes up with long latencies which have to be cleared by clicking the pass through..... Two second long latencies.....
Mavericks finally dumps all support for PPC code. I expect that his why the Line In installer would not work.
Just copy your previous LineIn or I can send you the one I have working on Mav.

And more. Digidesign CoreAudioManager can nicely screw any scenario up if you change from 44.1 to 48 and then try to return. Glorious silence..... What is it with 48K? I never regarded this as a norm or a default, yet, Digidesign and many others, like MiniDSP, do.

Just to get fully back OT here though, are you now saying as I did some posts ago? ...i.e. 'These workarounds are not working'

DD
 
#64 ·
Dear DanDan and crew:

Yes, I am saying that these workarounds are not working for me, at least with the MOTU interface and the ULN-8. The problem with the ULN-8 is its output patching facility is not seen by REW, although it is seen by every other audio application on the Mac. The reason: Javasound. Audio applications have to directly support CoreAudio on the Mac in order to really work well. I'd be happy to switch back to PC, but I've got troubles with this MOTU interface and REW over there as you know.

My suggestion to John is that he continue to develop REW as a wonderful analysis program written in Java. And create an ancillary program written in another language for both PC and Mac that can do the sweeps. On the PC this ancillary program should support ASIO directly and stably. On the Mac it should support CoreAudio directly and stably. Maybe he should charge for the sampling program but continue to make REW freeware? In John's "copious free time" of course...

As an analyzer, REW works great and has some of the best and easiest-to-use and understand audio analysis tools on the planet. I also have Acourate and admire it greatly. It can do things which REW never dreamed of, it is extremely powerful but the learning curve is high. Even so, it does not have the graphic displays like RT60 and waterfalls, the automatic calculation of Eq's for IIR-based products, etc. Horses for courses as they say. REW was developed by a developer who knows how to make user-friendly software, right on down to the help menu. It should be a commercial product, John, I'd pay $200 for REW today! Actually, I did contribute to the HTS, hope some of this money got to John.

I decided to pretend it was a rainy day and try using the digital I/O of the MacPro with REW. The Mac Pro with Snow Leopard doesn't apparently lock to an external optical source as I could not even see the microphone output in OSX's Sound preferences. So end of that story.

Thanks for the offer, DanDan, but don't send me LineIn. I never had it in the first place and I'd rather not engage in the workaround. My short term memory isn't what it used to be, and carrying around a set of complicated notes just to take a sweep is not my idea of a fun day.

BK
 
#65 ·
Oh by the way, the Impulse which I exported from FuzzMeasure has some garbage in front of the impulse that FuzzMeasure itself does not show. So it must be some artifact of the export or perhaps the normalization. I shortened the REW analysis left hand window to (hopefully) not include most of that garbage. Here's a picture of it. Any thoughts on the cause or whether it hurts any of the analysis to include this garbage that's in front of the impulse?
 

Attachments

#66 · (Edited)
Bit beyond my pay grade but as best I can describe it, that pre information is the distortion.
Take no notice of it, but keep it in case you want to view harmonic distortion.
My MacPro is on Snow Leopard (and Mavericks on a second SSD boot) It is happily accepting a Digital Optical Stream from my Digi HD192. BUT a friend has just noticed that his MacPro won't accept 96K on the Dig input, while his Macbook Pro will. The following is working fine for me....LOL, try Gozinta on this lot.
Text Blue Font Line Technology

Note, the AMS stated Unlocked until I quit and reopened it!
Fuzz has a wonderful facility for remote recording. It generates a sweep that can be played on anything and the result recorded into anything, even Zooms or whatever. Altiverb has an even better system. But unfortunately I need to see my results immediately as this often dictates the next test, e.g. a change of position of speaker or mic and so on.

DD
 
#68 ·
The answer to your question is currently unknown ( as far as I'm concerned ) due to the fact that "Mavericks" has broken a couple of basic functionalities that people have come to rely on .

Running in an emulated ( virtual ) PC mode is ( apparently ) no longer a guarantee of success for REW/Java compatibility ( due to something changing within Mavericks ) .


In my ( limited ) experience , OSX 10.6.8 ( with Java 6 ) was the "sweet-spot" for REW compatibility ( when running an Intel-based Mac ) .

:sn:
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top