51 Commits

Author SHA1 Message Date
Andrea Bondavalli
1e652a046d Set of changes to keep compatibility between boost version 1.87 and earlier versions 2025-02-28 17:46:53 +01:00
Andrea Bondavalli
21690a8589 Replace ip::address_v4::to_ulong() with ip::address_v4::to_uint() to support boost 1.87, see #197 2025-02-27 20:54:39 +01:00
Andrea Bondavalli
efcf95522b Replace ip::address::to_string() with ip::make_address() to support Boost 1.87, see #197 2025-02-27 20:06:17 +01:00
Andrea Bondavalli
47da082405 - renamed USE_STREAMER compilation flag to _USE_STREAMER_
- changed cpp-httplib git submodule path to https://github.com/bondagit/cpp-httplib.git
- removed compilation warning related to the usage of Boost bind global placeholders
- updated daemon version to 2.0.2
2024-09-16 11:33:54 +02:00
Andrea Bondavalli
466f6b4fc4 First import of HTTP Streamer functionality in the daemon used to receive AES67 audio streams via HTTP file streaming.
The HTTP Streamer can be enabled via the _streamer_enabled_ daemon parameter.
When the Streamer is active the daemon starts capturing the configured _Sinks_ up to the maximum number of channels configured by the _streamer_channels_ parameters.

The captured PCM samples are split into _streamer_files_num_ files of _streamer_file_duration_ duration (in seconds) for each sink, compressed using AAC LC codec and served via HTTP.

The HTTP streamer requires the libfaac-dev package to compile.

Please note that since the HTTP Streamer uses the RAVENNA ALSA device for capturing it's not possible to use such device for other audio captures.
2024-07-06 17:27:49 +02:00
nsgundy
5511fe9d97 Support unicast sinks 2024-01-15 16:36:36 +01:00
Andrea Bondavalli
1fc529b035 Removed addtional code smells 2023-02-26 10:06:04 +01:00
Andrea Bondavalli
7bf73823c6 Fixed a few minor bugs and removed some code smells 2023-02-25 22:33:55 +01:00
Andrea Bondavalli
cd0d7b6210 Skip automatic sinks update cycle in case no remote source was updated by the browser 2023-01-18 19:19:18 +01:00
Andrea Bondavalli
148b717c02 Additional fixes 2023-01-15 11:15:27 +01:00
Andrea Bondavalli
d1708d6ee3 Session manager doesn't retrieve the remote sources in case the automatic Sinks update is disabled. 2023-01-15 10:59:04 +01:00
Andrea Bondavalli
ffa8e80213 Added "auto_sinks_update" to the daemon configuration parameters and to the WebUI.
JSON boolean specifying whether to enable or disable the automatic update of the configured Sinks.
When enabled the daemon will automatically update the configured Sinks according to the discovered remote sources via SAP and mDNS/RTSP updates.
The SDP Originator (o=) is used to match a Sink with the remote source/s.
2023-01-14 19:24:43 +01:00
Andrea Bondavalli
6ed3a9ef54 Remote source origin is parsed and extracted from SDP when the source is discovered or updated.
This way we avoid parsing the SDP multiple times.
2023-01-14 18:22:24 +01:00
Andrea Bondavalli
f826a5b2ef Implementation of automatic Sink updates based on remote source updates received by the Browser.
The daemon uses the most recent version of corresponding remote sources to update a Sync.
The Originator (o=) field of the SDP is used identify the corresponding remote sources.

Many thanks to @Sikabo for the original implementation !
2023-01-14 12:06:55 +01:00
Andrea Bondavalli
670a42d992
Merge pull request #101 from bondagit/fake-driver
Fake driver
2022-11-18 09:27:34 +01:00
Andrea Bondavalli
38dabd5887 Added support to the daemon for a fake driver version.
This allows daemon execution without the RAVENNA driver for testing purposes and to allow regression tests to run into a Docker container.
2022-11-15 22:00:51 +01:00
Andrea Bondavalli
1a4f5ac6c1 Fixed SDP related RFCs compliance issues. See #94 2022-09-29 17:07:28 +02:00
Andrea Bondavalli
046babca3d Added custom node id parameter to daemon and WebUI to allow for a user defined node id. See #73 2022-05-26 08:33:20 +02:00
Andrea Bondavalli
dbb593120a Enhancement of daemon reconfiguration and PTP status update notification via shell script. See #82
The daemon can apply a configuration change to the following parameters without a restart:
    sap_interval, syslog_proto, syslog_server, log_severity, sample_rate

The daemon can apply a configuration change to the following parameters without a light restart:
    http_port, rtsp_port, http_base_dir, rtp_mcast_base, sap_mcast_addr, rtp_port, rtp_port, status_file, interface_name, mdns_enabled

A light restart means that the configuration can be applied without interrupting the playback/capture applications

A change to one of following paramters causes a full daemon restart:
    interface_name, tic_frame_size_at_1fs, max_tic_frame_size

On PTP status change the daemon can run in background an external shell script whose path name is specified by the new ptp_status_script Config parameter.
If this parameter is empty, no script is invoked. The PTP clock status is passed as first parameter to the script and it can be unlocked, locking or locked.
A sample script is provided in daemon/scripts/ptp_status.sh
2022-05-19 19:04:26 +02:00
Andrea Bondavalli
1af74dcbf0 Added support for unicast RTP stream address to daemon and WebUI, see #30
- added address field to Source struct definition to contain the destination address. If this field is left empty the default multicast address is used.
- if a unicast address is provided when creating a new Source the daemon looks in the ARP cache to retrieve the corresponding MAC address.
  If this is not found the daemon tries to connect to echo TCP service of the destination host and looks into the ARP cache up to 3 times and then returns and error.
- added RTP address field in the Source creating form of the WebUI. If this field is left empty the default multicast address is used instead.
- updated documentation and regression test suite
2021-03-04 18:31:34 +01:00
Andrea Bondavalli
aa8c08d8a9 The daemon set the driver sample rate when a new sample rate is advertised.
The issue was found during investigation of #27.
2021-01-15 12:37:11 +01:00
Andrea Bondavalli
cee8823e5c Added handling of session ID <sess-id> and session version <sess-version> in the Origin ("o=") field of the Sources SDP files.
Session ID is the Node ID plus the source ID.
Session version is the session ID plus an increasing version identifier.
This fixes issue #10 and allows Dante Controller to properly handle the daemon Sources.
2020-06-27 09:32:06 +02:00
Andrea Bondavalli
6449524ed5 Modified daemon code and build.sh script to use version v0.7.0 of cpp-httplib 2020-06-18 19:33:21 +02:00
Andrea Bondavalli
098cebd056 Applied Clang source code formatting to daemon sources 2020-06-16 21:14:44 +02:00
Andrea Bondavalli
3a386696e9 Removed execute permission from source files 2020-06-14 23:54:36 +02:00
Andrea Bondavalli
7f2bd7f4f0 Fix to generation of Node ID based on get_node_id() utils function: if gethostid() uses the loopback address interface IPv4 we create a new ID based on the current interface IPv4
This fixes a problem on old Ubuntu distro causing the Node ID to be the same for multiple hosts.
Additional minor changes:
 - removed compilation warnings
 - some fixes to code indentation
2020-06-14 14:05:21 +02:00
Andrea Bondavalli
9aaa5172ee Set of changes to support new ALSA RAVENNA/AES67 device driver version 1.1.93
- removed changes to driver/MTAL_LKernelAPI.c in ravenna-alsa-lkm-kernel-v5.patch
- added patch ravenna-alsa-lkm-disable-ptp-checksum.patch to the driver to the disable UDP checksum verification for the incoming PTP packets
- changed build.sh script to use new driver revision and apply the new patch
- added handling of the sink status flag "all_muted" in daemon, WebUI and regression tests
- updated documentation
2020-06-06 20:43:44 +02:00
Andrea Bondavalli
371090e7b9 Changes to SessionManager class to handle notifications for source updates triggered when the PTP GMID clock changes or the driver sample rate changes.
SessionManager allows the registration of source update observers and delivers via callbacks the above notifications.
RTSP server modified to register to source update notifications and to send updates to clients via ANNOUNCE method.
2020-06-04 09:14:17 -07:00
Andrea Bondavalli
d41b67d006 Set of changes to add support for mDNS sources SDP update via RTSP ANNOUNCE method as described by Ravenna.
- modified SessionManager class to register and trigger observer callbacks when a new session is added or removed
- moved MDNSServer out of the SessionManager and added instantiation in the daemon main
- MDNSServer instance registers to SessionManager to receive source add & remove events and invokes appropiate Avahi client operation
- RTSPServer instance registers to SessionManager to receive source update events. In case of update It sends RTSP ANNOUNCE (with the new SDP) to the connected RTSP clients that previously requested (via DESCRIBE method) the SDP file for the specific source
- removed disconnetion timeout handling in RTSPServer. RTSPServer connections are now persistent
2020-05-28 20:47:38 +02:00
Andrea Bondavalli
07c2b35777 Various enhancements and fixes:
- fixed handling of Max samples per packet Source parameter in the WebUI and added computation of the real frame duration
- fixed max number of channels configurable for a Sink in the WebUI
- fixed tic_frame_size_at_1fs daemon parameter documentation
- changed daemon default sample_rate parameter to 48000 Hz
2020-05-07 20:07:19 +02:00
Andrea Bondavalli
745fa05d0b Improved handling of "tic_frame_size_at_1fs" daemon parameter, added the possibility to configure it with the WebUI and updated the documentation. 2020-05-02 20:20:21 +02:00
Andrea Bondavalli
4ccc2f526f Fix for issue Daemon fails to parse AVIO SDP file
- use correct delimiter ('=') and unsigned integer when extracing RTP timestamp offset from mediaclk:direct SDP audio attribute
 - use session connection information (c=) when audio specific connection information is missing
2020-04-27 21:15:37 +02:00
Andrea Bondavalli
0757318732 Fixed bug in SessionMange::get_source_id() method 2020-04-24 09:09:40 -07:00
Andrea Bondavalli
b35b36c91e Merge branch 'master' into codec_am824 2020-04-23 12:11:26 -07:00
Andrea Bondavalli
0dbfe78a10 - Added support for mDNS/RTSP sources advertisement compatible with Ravenna standard.
- mDNS advertisement for all local Sources is implemented by mdns_server.[cpp,hpp] and based on Linux Avahi.
  - RTSP server implementation supports DESCRIBE method to return SDP of local Sources and supports persistent connection but doesn't provide service updates via UPDATE method.
- Modified RTSP client to browse for _ravenna_session subtype of _rtsp._tcp services only.
- Modified SAP and mDNS discovery to avoid returning local Sources advertised by the daemon.
- Added "rtsp_port" and "node_id" config parameters.
  - rtsp_port is a read/write parameter that contains the port of the RTSP server.
  - node_id is a read only parameter that contains the unique daemon identifier used in mDNS and SAP sources announcements.
- Modified session manager to check that every Source and Sink created by the user has a unique name.
- Modified WebUI to visualize node_id and to visualize and edit rtsp_port parameters in Config tab.
- Extended regression test to verify proper behaviour of mDNS/RTSP sources advertisement and discovery.
- Modified REST API to browse remote sources to allow browsing of SAP, mDNS and all sources via HTTP GET /api/browse/sources/[all|mdns|sap].
- Amended daemon documentation.
2020-04-23 11:45:58 -07:00
Andrea Bondavalli
1d2ea0875c Added support for AM824 codec for testing
- added patch to ravenna-alsa-lkm module to support AM824 codec and associated conversion functions
- added support for AM824 codec to daemon and in WebUI
- modifed demo to test 8 channels of AM824 with 6 samples per packet @ 48Khz (125us x packet)
2020-04-10 13:04:44 -07:00
Andrea Bondavalli
92768454f4 Increased HTTP client read timeout in session manager and in regression tests.
This fixes regression tests execution on slow hosts.
2020-04-01 17:39:48 +02:00
Andrea Bondavalli
bf8a4c56da Fixed handling of IGMP join and leave for the multicast RTP sessions.
The IGMP handling was broken in case the RTP multicast address of a stream was updated.
2020-03-30 18:58:07 +02:00
Andrea Bondavalli
5deb6c1927 Added to the daemon the support for Multicast DNS (using Linux Avahi) to allow discovery of remote audio sources and of RTSP for SDP transfer.
Added to the WebUI the possibility to directly select a remote source SDP file for a Sink.

New files:
daemon/mdns_client.hpp,cpp -> mDNS client implementation using Avahi client library
daemon/rtsp_client.hpp,cpp -> RTSP client implementation used to transfer SDP file
daemon/utils.cpp -> used for common utility functions
.clang-format -> added clang-format configuration file

Modified files:
daemon/CMakeList.txt -> added support for Avahi and option WITH_AVAHI=[yes/no] to compile the daemon with or without Avahi mDNS support
daemon/config.hpp,cpp -> added configuration option mdns_enabled to enable or disable mDNS discovery at runtime
daemon/json.cpp -> extended JSON config with mdns_enabled option
daemon/browser.hpp,cpp -> added support for mDNS client to the browser
daemon/session_manager.cpp -> added support for RTSP protocol to Source URL field and fixed issue with SDP file parsing
webui/RemoteSources.js -> added visualization of mDNS remote sources
webui/SinkEdit.js -> added the possibility to directly select a remote source SDP file for a Sink
webui/SourceInfo.js -> added visualization of protocol source (SAP, mDNS or local) for a source
ubuntu-packages.sh -> added libavahi-client-dev to the list of required packages
build.sh -> added WITH_AVAHI=yes option when invoking CMake
README.md -> added notes about mDNS support via Avahi
daemon/README.md -> added notes about mDNS support via Avahi, support for RTSP protocol in source and new mdns_enabled config param

Additional minor changes to remaining files.
2020-03-29 19:41:56 +02:00
Andrea Bondavalli
596500b130 Minor changes 2020-03-20 22:58:21 +01:00
Andrea Bondavalli
dff3ab3cba Multiple fixes:
- fixed destination MAC address set when adding a source and a sink according to IANA specs
- fixed retrieval of network interface MAC address
- added <list> inclusion to header files using std::list
- fixed regression test suite
- additional minor changes
2020-03-20 18:58:08 +01:00
Andrea Bondavalli
f57046a478 fix: use steady_clock instead of high_resolution_clock to avoid being affected by date/time changes 2020-03-02 19:06:21 +01:00
Andrea Bondavalli
4c8b225c44 Set of fixes impacting playout delay, max SAP message size and minor enhancements to WebUI. 2020-02-10 21:32:02 +01:00
Andrea Bondavalli
a343123d81 set of small enhancements and fixes 2020-02-07 10:10:15 -08:00
Andrea Bondavalli
a9ad806c12 A single multicast address is used for PTP traffic. 2020-02-03 17:26:50 +01:00
Andrea Bondavalli
0c32e8e698 Added handling of multicast membership for PTP messages.
Limited PTP domain value to the range 0 - 127.
2020-02-02 07:12:36 -08:00
Andrea Bondavalli
67476189d2 Fixes to add and update of source and sink 2020-02-01 15:56:10 +01:00
Andrea Bondavalli
ed392d2719 Improved handling of update source and update sink operation in case of failure.
Changed WebUI to reload the list of sources and sinks also in case editing is cancelled.
2020-01-31 23:10:04 +01:00
Andrea Bondavalli
0b1a9c2688 minor optimization changes 2020-01-31 10:45:41 -08:00
Andrea Bondavalli
a91234d825 Fix to documentation and some code cleanup 2020-01-28 21:15:12 +01:00