# "Headless" REW on Raspberry Pi (REW with Webinterface)



## root2 (Feb 17, 2015)

Hello there.

I'm planning to use a Raspberry Pi (preferably a Raspberry Pi Zero) together with a Behringer UCA 202 to get an ultra portable REW Tool.

The Raspberry should be running Raspbian (or better Raspbian light) and provide a "headless" way to use REW.
Audio Signals should be sent/received via the USB Behringer Interface. The Raspberry Pi is connected to LAN/WLAN as needed.

My question is: Is there any way I can get REW to work/be controlled via a web interface (like routers or NAS are using)?

My fallback option would be to use remote desktop to get to the X-Session that is running REW. But I'm having concerns it could cause too much load on the system to use REW effectively.

Has anyone tried out what I'm planning and is willing to share some input?

Thanks a lot for your support!


----------



## AudiocRaver (Jun 6, 2012)

I have a raspberry pi 3B up and running headless with Kodi, and hope to get the Linux version of REW working on it, but have not ventured into that part of the project yet.

I was thinking I would be really happy to get REW working with monitor and kb/mouse. I cannot imagine runnning it headless.Someone would have to write a remote control app for it, and that is probably not even on John's priority list.


----------



## 3ll3d00d (Jun 6, 2006)

Look at x11vnc or x forwarding (which means running an x server on the client machine)


----------



## AudiocRaver (Jun 6, 2012)

I should say that I am weak on Linux. I thought of Chrome Remote Desktop as a possibility.


----------



## root2 (Feb 17, 2015)

Thank you for all your replies!

Well, I guess my fallback option (rdesktop) will be the solution to (hopefully) get things running.


----------



## 3ll3d00d (Jun 6, 2006)

put simply....

x11vnc is a way of displaying an existing desktop session on your client computer
rdesktop is a way of creating a new desktop session to serve your client computer
x forwarding is a way of starting a gui app that runs on the rpi but whose UI is rendered by the X server running on your client computer

the first 2 require an X server on the rpi, the last one doesn't (but requires an X server on your client so you need to know a bit more about what you're doing & it can be quite slow)

x11vnc is probably the easiest one to go with (lots of links on google about it, e.g. http://www.linuxcircle.com/2015/05/...esktop-remotely-in-headless-mode-with-x11vnc/)


----------



## AudiocRaver (Jun 6, 2012)

3ll3d00d said:


> put simply....
> 
> x11vnc is a way of displaying an existing desktop session on your client computer
> rdesktop is a way of creating a new desktop session to serve your client computer
> ...


Great info, thanks! I will be doing some experimenting with this soon.


----------



## root2 (Feb 17, 2015)

AudiocRaver said:


> Great info, thanks! I will be doing some experimenting with this soon.


I second this! Thank you for the input.

As my Raspberry Pi Zero arrived yesterday, I can start the implementation.

What I try to accomplish with this (reasonably priced) approach is to get a solution that:
- is portable enough to be carried around without heavy gear (like Laptop)
- uses common USB powering, provided by cellphone chargers to operate
- uses the microphone, that comes shipped with most AVR to get an acceptable measurement of the room
- can be operated remotely (even through the internet, if necessary)

Are there any concerns about the audio interface I tend to use (Behringer UCA 202)?

I thought about feeding the REW test signals to the System using the Behringers' analog cinch-outputs, the headphone output or the optical S/PDIF output. The audio should be recorded back into REW using the analog cinch-inputs.

I know the microphone might be a bottleneck for getting even more accurate results. But I don't want to do professional support/measuring. Just getting knowledge about any low frequency room modes that might get disturbing or the reverb decay time for a given room are sufficient.

Best regards


----------



## AudiocRaver (Jun 6, 2012)

root2 said:


> ...Raspberry Pi Zero...


Not a fan of the mini-HDMI. Had one on an early Chromebook, any twisting or vertical deflection and it would cut out. I spent half of my time babying that connector. Just saying...



> What I try to accomplish with this (reasonably priced) approach is to get a solution that:
> - is portable enough to be carried around without heavy gear (like Laptop)
> - uses common USB powering, provided by cellphone chargers to operate
> - uses the microphone, that comes shipped with most AVR to get an acceptable measurement of the room
> - can be operated remotely (even through the internet, if necessary)


A worthy set of goals. Headless WOULD be nice, and even over Internet.



> Are there any concerns about the audio interface I tend to use (Behringer UCA 202)?


That UCA 202 is a decent little device for the price. I have a couple of them kicking around here. Forgot about the optical output, a bonus! It has no mic level input, not sure how you will run one of those AVR calibration mics with it.



> I thought about feeding the REW test signals to the System using the Behringers' analog cinch-outputs, the headphone output or the optical S/PDIF output. The audio should be recorded back into REW using the analog cinch-inputs.


By "cinch" I assume you mean the stereo RCA ins and outs.



> I know the microphone might be a bottleneck for getting even more accurate results. But I don't want to do professional support/measuring. Just getting knowledge about any low frequency room modes that might get disturbing or the reverb decay time for a given room are sufficient.


Those mics have a pretty odd frequency response above 1 kHz (or so, I forget where exactly), but for the purpose you suggest they should work, if you can figure out how to get the extra boost you need and get it split out to the two RCA inputs.

Keep in touch.


----------



## root2 (Feb 17, 2015)

AudiocRaver said:


> Not a fan of the mini-HDMI. Had one on an early Chromebook, any twisting or vertical deflection and it would cut out. I spent half of my time babying that connector. Just saying...


Thanks for the input! As I'm planning to use the device remotely, the HDMI would not be connected at all 



AudiocRaver said:


> That UCA 202 is a decent little device for the price. ... It has no mic level input, not sure how you will run one of those AVR calibration mics with it.


Oh, that's a fact I need to solve. I'll keep on searching for a solution.



AudiocRaver said:


> By "cinch" I assume you mean the stereo RCA ins and outs.


Yes, you are correct. "Cinch" is not the correct wording but used a lot (here in Germany).



AudiocRaver said:


> Keep in touch.


I will report back if I got a solution for the microphone issue.

Maybe a "the t.bone MicPlug USB Interface" would do the trick? See it's specs here: https://www.thomann.de/de/the_tbone_micplug_usb.htm
But I'm not sure, if the USB Port of the Raspberry Pi Zero can handle the phantom voltage - and I don't want to occupy two mains sockets if there's another way. And I'm not sure about the Linux support for this device. But I think a call at Thomann will clarify things a bit 

Edit: A fallback solution for the microphone issue could be some audio interfaces like this:
- Creative Sound Blaster X-Fi Go! Pro USB
- Sound Blaster Play! 2
They seem to handle line out and mic in as needed. But I'm not sure about the signal/build quality compared to the Behringer.


----------



## AudiocRaver (Jun 6, 2012)

Microphone Input:

This might work better.

The AVR mic needs a small bias voltage of 1.2v or 1.5v or something in that range, like is supplied from a laptop mic input jack. True phantom power is 48v, although some get away with 24v.


----------



## root2 (Feb 17, 2015)

AudiocRaver said:


> Microphone Input:
> 
> This might work better.


Just such kind of device I added via edit in my last post  Not sure about the audio quality of those very cheap devices, though.


----------



## 3ll3d00d (Jun 6, 2006)

why would you want to be able to operate this via the internet? seems a bit of an odd requirement. 

there are HATs with audio IO, for example http://www.audioinjector.net/#!/rpi-hat (NB: they even have a 6in, 8out model coming soon - http://www.audioinjector.net/#!/rpi-octo-hat), which would make for a more compact solution. Mic calibration would be an issue of course but you could always use a proper mic with separate phantom power.


----------



## root2 (Feb 17, 2015)

3ll3d00d said:


> why would you want to be able to operate this via the internet? seems a bit of an odd requirement...


Not if you plan to hand the device to your friend, have him set it up for your and you just simply take the measurements from your office or home whenever your friend has set it up.

The internet connectivity more or less comes with the ability to get a remote desktop on the device and it's not a top requirement as you might have noticed I put it into brackets and added "if necessary". So one _could_ forward the VNC/RDP/SSH/etc. session directly through a router - if needed - with no additional hardware required.

My primary plan for operating the device via internet, though, was to use a notebook/tablet/smartphone/etc. that uses tools like TeamViewer, etc. and to connect to the VNC/RDP/etc. session running on the RPi from there.

To make it short: If remote sessions on the RPi work, the hardware can be operated through the internet - if needed.



3ll3d00d said:


> ...there are HATs with audio IO, for example http://www.audioinjector.net/#!/rpi-hat (NB: they even have a 6in, 8out model coming soon - http://www.audioinjector.net/#!/rpi-octo-hat), which would make for a more compact solution. Mic calibration would be an issue of course but you could always use a proper mic with separate phantom power.


Looks nice! Especially because the impact of heavy CPU load would not lead to stuttery signals when using GPIOs for the job.

Sadly, as far as I've seen, the PCB is designed to fit on a "normal" sized RPi, though. So it would mean, I have to build an extra case around my RPi Zero (which is significantly smaller than a normal RPi) to protect the PCB components from being touched.

Using just a simple RPi Zero Pi-Bow case and attaching an USB audio card would mean no extra case and no touchable electronic devices.


----------



## root2 (Feb 17, 2015)

Short Update:
- Raspbian with Pixel is running on my RPi Zero
- VNC is running nice (no need to ever attach a keyboard/display up to now)
- REW installation script has finished smoothly
- REW is up and running

Now I need to wait for the USB Soundcard to arrive.
In the meanwhile I'm using the Pi as a pi-hole device for ad-blocking


----------



## AudiocRaver (Jun 6, 2012)

root2 said:


> Short Update:
> - Raspbian with Pixel is running on my RPi Zero
> - VNC is running nice (no need to ever attach a keyboard/display up to now)
> - REW installation script has finished smoothly
> ...


I am following with GREAT interest. The internet operability gets the imagination rolling. Running REW on a Raspberry Pi was on my "see if it can be done" list.:T Now it is on my "DO IT" list.


----------



## root2 (Feb 17, 2015)

I hope everything goes well when attaching the USB Souncard 
And I hope the little RPi Zero has enough power to manage all tasks (I will be disabling pi-hole and everything not needed, when testing, though).

Fingers crossed! :sweat:


----------



## AudiocRaver (Jun 6, 2012)

I am working with a R Pi 3B, so anticipate having plenty of horsepower.


----------



## root2 (Feb 17, 2015)

AudiocRaver said:


> I am working with a R Pi 3B, so anticipate having plenty of horsepower.


You might need the horsepower 

Another update:
- Installing the Sound Blaster X-Fi 5.1 USB Soundcard (SB1090), wich I got from a friend of mine, was a bit tricky (using pulseaudio) but I finally got it working to use stereo at last.
- Sadly REW tells me that the device (in combination with pulseaudio) seems not to handle the correct data format
- Strangely I once was able to do a calibration/test and produce some test signals through REWs "Generator" section
- The generated sound was very stuttering, though. CPU usage was at 100% all the time when generating sound

I will investigate into the driver/pulseaudio thing a bit more when I have the time to do so.
I'm still waiting for my cheap USB Soundcard to arrive - hopefully it will be a bit easier to get things running with this device.
The pulseaudio server does not autostart at the moment (not a thing related to REW, though). Maybe I try using a .destop file to autostart it next time.
I thing I have a unused RPi 3B lying around somwhere - If there's enough time, I'll try setting things up on this device and see, if it handles things a bit better due to its better CPU.

Let's see what's next


----------



## AudiocRaver (Jun 6, 2012)

What I have done with my R Pi 3b:

installed raspbian
installed Kodi server
added Tidal2 plugin to Kodi
My original project, still under way, is preparing the image to run my R Pi as a media server with a 128 GB USB flash ROM for media - no fans, no moving parts!

Tested: stereo flac files, 16-44, 24-44, 24-48, 24-96, 24-192

Tested: 5.1 flac files, 24-48, 24-96

Tested: mp4 movie with 5.1 surround audio

all work smoothly with very small CPU usage

edit: the 3B might have a lot more horsepower than it really needs, but at only $35, that is CHEAP horsepower - always a YES!


----------



## nibbelodean (11 mo ago)

root2 said:


> Short Update:
> 
> Raspbian with Pixel is running on my RPi Zero
> VNC is running nice (no need to ever attach a keyboard/display up to now)
> ...


It's been 5 years since you did this, but... How did you get the REW installation script to run smoothly? My Java appears to be having trouble (see below).

Any input would be highly appreciated!

Thanks

No protocol specified
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:131)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.Toolkit$2.run(Toolkit.java:860)
at java.awt.Toolkit$2.run(Toolkit.java:855)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
at sun.swing.SwingUtilities2.getSystemMnemonicKeyMask(SwingUtilities2.java:2032)
at javax.swing.plaf.basic.BasicLookAndFeel.initComponentDefaults(BasicLookAndFeel.java:1158)
at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:431)
at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:148)
at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1577)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:539)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:579)
at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1349)
at javax.swing.UIManager.initialize(UIManager.java:1459)
at javax.swing.UIManager.maybeInitialize(UIManager.java:1426)
at javax.swing.UIManager.getUI(UIManager.java:1006)
at javax.swing.JPanel.updateUI(JPanel.java:126)
at javax.swing.JPanel.<init>(JPanel.java:86)
at javax.swing.JPanel.<init>(JPanel.java:109)
at javax.swing.JPanel.<init>(JPanel.java:117)
at com.install4j.runtime.installer.frontend.FormPanel.<init>(FormPanel.java:49)
at com.install4j.runtime.installer.frontend.headless.AbstractHeadlessScreenExecutor.init(AbstractHeadlessScreenExecutor.java:67)
at com.install4j.runtime.installer.frontend.headless.ConsoleScreenExecutor.<init>(ConsoleScreenExecutor.java:24)
at com.install4j.runtime.installer.frontend.headless.InstallerConsoleScreenExecutor.<init>(InstallerConsoleScreenExecutor.java:6)
at com.install4j.runtime.installer.Installer.getScreenExecutor(Installer.java:88)
at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:57)
at com.install4j.runtime.installer.Installer.main(Installer.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:85)
at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:62)
An error occurred:
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
Error log: /tmp/install4jError4018638071721673562.log
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:131)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.Toolkit$2.run(Toolkit.java:860)
at java.awt.Toolkit$2.run(Toolkit.java:855)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
at sun.swing.SwingUtilities2.getSystemMnemonicKeyMask(SwingUtilities2.java:2032)
at javax.swing.plaf.basic.BasicLookAndFeel.initComponentDefaults(BasicLookAndFeel.java:1158)
at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:431)
at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:148)
at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1577)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:539)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:579)
at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1349)
at javax.swing.UIManager.initialize(UIManager.java:1459)
at javax.swing.UIManager.maybeInitialize(UIManager.java:1426)
at javax.swing.UIManager.getUI(UIManager.java:1006)
at javax.swing.JPanel.updateUI(JPanel.java:126)
at javax.swing.JPanel.<init>(JPanel.java:86)
at javax.swing.JPanel.<init>(JPanel.java:109)
at javax.swing.JPanel.<init>(JPanel.java:117)
at com.install4j.runtime.installer.frontend.FormPanel.<init>(FormPanel.java:49)
at com.install4j.runtime.installer.frontend.headless.AbstractHeadlessScreenExecutor.init(AbstractHeadlessScreenExecutor.java:67)
at com.install4j.runtime.installer.frontend.headless.ConsoleScreenExecutor.<init>(ConsoleScreenExecutor.java:24)
at com.install4j.runtime.installer.frontend.headless.InstallerConsoleScreenExecutor.<init>(InstallerConsoleScreenExecutor.java:6)
at com.install4j.runtime.installer.Installer.getScreenExecutor(Installer.java:88)
at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:57)
at com.install4j.runtime.installer.Installer.main(Installer.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:85)
at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:62)


----------

