LAMA SPL Server (HTTP)

LAMA has a integrated HTTP server that can deliver Sound Pressure Level data and SPL Log data. It is intended to be used in situations where other people on site or authorities need to keep track of sound emissions.

Prerequisites

LAMA running on a computer with OS X 10.8. The computer must be reachable in a LAN or WAN. Clients must not block the LAMA HTTP port with a firewall, the server firewall settings must be adjusted to allow incoming connections on the server port.

Starting the SPL Server

In LAMA, go to Windows > SPL Server Settings, the settings window will open.

Parameters

  • Port: TCP/IP port the server will listen to. Must be a number between 1024 and 65535. If the port is in use by an other application, the server will refuse to start
  • Doc Root: A folder with HTML documents to be delivered.

To start, click the Start Server button, when it finished starting the status indicator will turn green. Short time later, when your local IP address has been resolved, a link will be presented to reach the server in your local network.

Server Process

For security reasons, the HTTP server is started as a single process detached from LAMA, named net.lama-audio.splserv.

The server process is sandboxed. LAMA will remain unaffected in case of a failure in the HTTP server.

Default doc root data

The default doc-root is ~/Library/Containers/net.lama-audio.LAMA/Data/Library/Application Support/splserv.

In case this folder does not exist, LAMA will copy default HTML files into this folder.

If you want to restore default data, trash the folder mentioned above.

The default data files are MIT licensed and can be modified without restrictions.

Content delivery

The server works as a usual HTTP server. If the address of the request can be mapped to a file in the Doc Root path, it will deliver this file.

SPL data can be delivered as XML data with the following requests:

Querying Live Data

A path starting with spl, followed by /Instrument Name will deliver current spl data,

e.g. http://192.168.1.10:28001/spl/SPL%20Meter%201 will deliver data of the SPL Instrument named "SPL Meter 1". Names must be unique, or the first instrument with this name will be used.

Result will be XML, with following properties:

  • An element named root

Attributes:

  • id: a UUID string uniquely identifying the instrument.
  • time: data timestamp.
  • name: SPL Instrument name.

Nodes:

  • spl, avg, leq, SPL, Average and LEQ Level. Each with an attribute unit.
  • avgtime duration of the linear average in seconds.
  • weighting SPL Instrument weighting.
  • speed SPL Instrument speed.
  • leqDuration duration of LEQ measurement in seconds.
  • leqRunningSince running time of the current LEQ measurement as a human-readable string.

Querying SPL Log Data

As querying live-data, the path postfixed with /log,

e.g. http://192.168.1.10:28001/spl/SPL%20Meter%201/log

Result will be XML, containing data when the log has run for at least one minute.

Root element named root with id and name attributes identifying the data source and a time attribute indicating timestamp of request. Children will be named log with following content: * Attribute timestamp: timestamp of log date. * Attribute index: running index of the log date. * Attribute relativeTime: time in seconds, relative to start time of log. * nodes named spl, avg and leq containing SPL, average and LEQ values, each with an attribute unit indicating unit.

Querying SPL Instruments

A request to /splinstruments will deliver a list of all available instruments.

Result:

A XML Element splinstruments with children instrument, each representing a SPL Instrument name, and an attribute id with the UUID string of the instrument.