From nobody Wed Aug 03 00:10:42 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LyC1Z5rpdz4Y0GF; Wed, 3 Aug 2022 00:10:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LyC1Z5MSPz3SyQ; Wed, 3 Aug 2022 00:10:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659485442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eO6dvSW55TfMVdQkx0aSovFgbVHijh2ivOYLINxyS5s=; b=Q+YAoqtDx786SeV1KaxAFeUTbTY8NMybrg8+eCEWjSMLDl+kJvKr5NSdTOJrCzhN2jko+y TN5NSNBBLMPFqBNAIbZ3vwPVbgcYlK0j4i3aRuetUKp+QL2u9shV0LlaPp46A3+LN5ogDJ 39GF+GoeLhjLlEsevffwD8IBuqFgJg7/ns8mkFK8+YtLAxisUbwf+h4ks3PsttvKYHROAD pd9P42kMmYJSbImdGka7GJJXpxeIJH4jXPmSH5Nb3dRG1IRUdN3zT9jJP/WlvTK8SHmd7Z 0vsgq7CGum5AS2mc+pDJapix791RUqcb0GEE/+e/gbsyER/8BGmCV0VkVRDz8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LyC1Z4QVfzWvV; Wed, 3 Aug 2022 00:10:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2730AgeU084819; Wed, 3 Aug 2022 00:10:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2730AgbV084818; Wed, 3 Aug 2022 00:10:42 GMT (envelope-from git) Date: Wed, 3 Aug 2022 00:10:42 GMT Message-Id: <202208030010.2730AgbV084818@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Diane Bruce Subject: git: 5daa5d9a69bf - main - audio/lpcnet: New port: Neural Net speech coding List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: db X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5daa5d9a69bf6c60a39927dc99c7ca92ac61c906 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659485442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eO6dvSW55TfMVdQkx0aSovFgbVHijh2ivOYLINxyS5s=; b=ko+v9N+VD8ObtxOx7nTg8VNBbhQ/j2WXdgXD2NNCtsBKIH0d4shamNb7u1N3AN1nIPyrEB AE112Z6BAY+carpozjo4nQpbyK0bjnkpsN1IusR4QVRxsrOSK5C2VvVvp6Mf2ZUd9umnIX lVSLVS4TYdpppPvLjGC/Cz35f27JVm1sSGD4mck2qDRiobHTrvwjymTMIS2uIz8/A/nazV TIf4Kdlk9CCALjHtpgaVfCeK3oaGBoFdOfHcAfPKmlFQVWCxz+bs+QcXhvITLjsxia2kQ9 MLn7rFH5Z4F+mjNAWiw+I97+2fz1+vSSZHJYmzZ9JYrukER/cLW9FOkVMULuiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659485442; a=rsa-sha256; cv=none; b=dx1TnaKCAXYtXeKnniuLFSPccRn52JivOhu8hezHC9wQZpUUe2EmG3gttp0530Z06ExdMM zXzy9Ec/XYSCWRxgNmOx99pN9fZ/yZWnJos6BVY7VI14Q0XsBDyzyswpE9BV1/0rmgiuxE jhG+d2Sn/PNWhK4jW92E2ZUy7S74MoJiEaQ4nzNjO88+A12trMLRxUZM6OOW4Dmedej+an QWs4u8Rjc4pGz839rcP43KYqeBy/meiA+S4AiH+h7vpGk0ikTLhg68U+XHFZzv6vnK5enp HPfDlhRLvgfLgB7MgPp72nVVpAfnEavcO5O3uFezUZdVxkfp3mc7nP/6o28nnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by db: URL: https://cgit.FreeBSD.org/ports/commit/?id=5daa5d9a69bf6c60a39927dc99c7ca92ac61c906 commit 5daa5d9a69bf6c60a39927dc99c7ca92ac61c906 Author: Diane Bruce AuthorDate: 2022-08-03 00:00:35 +0000 Commit: Diane Bruce CommitDate: 2022-08-03 00:10:23 +0000 audio/lpcnet: New port: Neural Net speech coding Needed for freedv update see: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264769 Experimental version of LPCNet that has been used to develop FreeDV 2020 - a HF radio Digial Voice mode for over the air experimentation with Neural Net speech coding. Possibly the first use of Neural Net speech coding in real world operation. --- audio/Makefile | 1 + audio/lpcnet/Makefile | 27 +++++++++++ audio/lpcnet/distinfo | 7 +++ audio/lpcnet/files/patch-CMakeLists.txt | 86 +++++++++++++++++++++++++++++++++ audio/lpcnet/pkg-descr | 6 +++ audio/lpcnet/pkg-plist | 7 +++ 6 files changed, 134 insertions(+) diff --git a/audio/Makefile b/audio/Makefile index 80e05f9e50a2..2d4bf717cc7e 100644 --- a/audio/Makefile +++ b/audio/Makefile @@ -443,6 +443,7 @@ SUBDIR += logitechmediaserver-sqlplaylist SUBDIR += logitechmediaserver-trackstat SUBDIR += lollypop + SUBDIR += lpcnet SUBDIR += lsp-plugins-lv2 SUBDIR += lua-mpd SUBDIR += luppp diff --git a/audio/lpcnet/Makefile b/audio/lpcnet/Makefile new file mode 100644 index 000000000000..9ec36f347f5f --- /dev/null +++ b/audio/lpcnet/Makefile @@ -0,0 +1,27 @@ +PORTNAME= lpcnet +PORTVERSION= 20210629 +CATEGORIES= audio hamradio +MASTER_SITES= http://rowetel.com/downloads/deep/:main \ + GH:sub +DISTFILES= lpcnet_191005_v1.0.tgz:main \ + ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}:sub + +MAINTAINER= hamradio@FreeBSD.org +COMMENT= Neural Net speech coding + +LICENSE= LGPL21 + +LIB_DEPENDS= libcodec2.so:audio/codec2 + +USES= cmake compiler:c++11-lib +CMAKE_ARGS+= -DMACHINE_CPU:STRING="${MACHINE_CPU}" \ + -DWRKDIR:STRING=${WRKDIR} + +USE_GITHUB= yes +GH_ACCOUNT= drowe67 +GH_PROJECT= LPCNet +GH_TAGNAME= 0dc5935 + +.include +.include +.include diff --git a/audio/lpcnet/distinfo b/audio/lpcnet/distinfo new file mode 100644 index 000000000000..a0b495a1716d --- /dev/null +++ b/audio/lpcnet/distinfo @@ -0,0 +1,7 @@ +TIMESTAMP = 1641483640 +SHA256 (lpcnet_191005_v1.0.tgz) = 509440924751fdd87ffaa5683ee3dddd937af5c833b9104ccce65d51614926c8 +SIZE (lpcnet_191005_v1.0.tgz) = 18396516 +SHA256 (lpcnet-20210629.tar.gz) = 31a687ac5e822c6c2cf75fe8e7371a5cd834d692635a802ec8fd33dc340d9cf2 +SIZE (lpcnet-20210629.tar.gz) = 33016759 +SHA256 (drowe67-LPCNet-20210629-0dc5935_GH0.tar.gz) = 31a687ac5e822c6c2cf75fe8e7371a5cd834d692635a802ec8fd33dc340d9cf2 +SIZE (drowe67-LPCNet-20210629-0dc5935_GH0.tar.gz) = 33016759 diff --git a/audio/lpcnet/files/patch-CMakeLists.txt b/audio/lpcnet/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..d11722280aa1 --- /dev/null +++ b/audio/lpcnet/files/patch-CMakeLists.txt @@ -0,0 +1,86 @@ +--- CMakeLists.txt.orig 2021-06-29 09:04:36 UTC ++++ CMakeLists.txt +@@ -87,15 +87,32 @@ message(STATUS "Host system arch is: ${CMAKE_SYSTEM_PR + # Detection of available CPU optimizations + if(NOT DISABLE_CPU_OPTIMIZATION) + if(UNIX AND NOT APPLE) +- message(STATUS "Looking for available CPU optimizations on Linux/BSD system...") +- execute_process(COMMAND grep -c "avx2" /proc/cpuinfo +- OUTPUT_VARIABLE AVX2) +- execute_process(COMMAND grep -c "avx " /proc/cpuinfo +- OUTPUT_VARIABLE AVX) +- execute_process(COMMAND grep -c "sse4_1 " /proc/cpuinfo +- OUTPUT_VARIABLE SSE) +- execute_process(COMMAND grep -c "neon" /proc/cpuinfo +- OUTPUT_VARIABLE NEON) ++ if ( ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") ++ message(STATUS "Looking for available CPU optimizations on FreeBSD system...") ++ message (STATUS "MACHINE_CPU = ${MACHINE_CPU}") ++ if (MACHINE_CPU MATCHES "avx") ++ set(AVX TRUE) ++ endif() ++ if (MACHINE_CPU MATCHES "avx2") ++ set(AVX2 TRUE) ++ endif() ++ if (MACHINE_CPU MATCHES "sse") ++ set(SSE TRUE) ++ endif() ++ if (MACHINE_CPU MATCHES "neon") ++ set(NEON TRUE) ++ endif() ++ else() ++ message(STATUS "Looking for available CPU optimizations on Linux system...") ++ execute_process(COMMAND grep -c "avx2" /proc/cpuinfo ++ OUTPUT_VARIABLE AVX2) ++ execute_process(COMMAND grep -c "avx " /proc/cpuinfo ++ OUTPUT_VARIABLE AVX) ++ execute_process(COMMAND grep -c "sse4_1 " /proc/cpuinfo ++ OUTPUT_VARIABLE SSE) ++ execute_process(COMMAND grep -c "neon" /proc/cpuinfo ++ OUTPUT_VARIABLE NEON) ++ endif() + elseif(APPLE) + if(BUILD_OSX_UNIVERSAL) + # Presume AVX/AVX2 are enabled on the x86 side. The ARM side will auto-enable +@@ -140,36 +157,12 @@ if(${NEON} OR ${NEON} GREATER 0) + endif() + + # grab latest NN model (or substitute your own) +-set(LPCNET_ROOT http://rowetel.com/downloads/deep/) +-set(LPCNET_FILE lpcnet_191005_v1.0.tgz) +-set(LPCNET_URL ${LPCNET_ROOT}${LPCNET_FILE}) ++# retrieved by port ++#set(LPCNET_ROOT http://rowetel.com/downloads/deep/) ++#set(LPCNET_FILE lpcnet_191005_v1.0.tgz) ++#set(LPCNET_URL ${LPCNET_ROOT}${LPCNET_FILE}) + +-if(EXISTS ${CMAKE_BINARY_DIR}/${LPCNET_FILE}) +- set(lpcnet_SOURCE_DIR ${CMAKE_BINARY_DIR}/src) +- file(MAKE_DIRECTORY ${lpcnet_SOURCE_DIR}) +- execute_process(COMMAND tar -xzf ${CMAKE_BINARY_DIR}/${LPCNET_FILE} -C ${CMAKE_BINARY_DIR}/src) +- +-# Work around not having the FetchContent module. +-elseif(CMAKE_VERSION VERSION_LESS 3.11.4) +- set(lpcnet_SOURCE_DIR ${CMAKE_BINARY_DIR}/src) +- if(NOT EXISTS ${lpcnet_SOURCE_DIR}) +- file(DOWNLOAD ${LPCNET_URL} +- ${CMAKE_BINARY_DIR}/${LPCNET_FILE} +- SHOW_PROGRESS +- ) +- file(MAKE_DIRECTORY ${lpcnet_SOURCE_DIR}) +- execute_process(COMMAND tar -xzf ${CMAKE_BINARY_DIR}/${LPCNET_FILE} -C ${CMAKE_BINARY_DIR}/src) +- endif() +-else() +- include(FetchContent) +- FetchContent_Declare( +- lpcnet +- URL ${LPCNET_URL}) +- FetchContent_GetProperties(lpcnet) +- if(NOT lpcnet_POPULATED) +- FetchContent_Populate(lpcnet) +- endif() +-endif() ++set(lpcnet_SOURCE_DIR ${WRKDIR}) + + # Find codec2 + if(CODEC2_BUILD_DIR) diff --git a/audio/lpcnet/pkg-descr b/audio/lpcnet/pkg-descr new file mode 100644 index 000000000000..86c8314a1260 --- /dev/null +++ b/audio/lpcnet/pkg-descr @@ -0,0 +1,6 @@ +Experimental version of LPCNet that has been used to develop FreeDV 2020 +- a HF radio Digial Voice mode for over the air experimentation with +Neural Net speech coding. Possibly the first use of Neural Net speech +coding in real world operation. + +WWW: http://freedv.org/tiki-index.php diff --git a/audio/lpcnet/pkg-plist b/audio/lpcnet/pkg-plist new file mode 100644 index 000000000000..54460bd5512e --- /dev/null +++ b/audio/lpcnet/pkg-plist @@ -0,0 +1,7 @@ +bin/lpcnet_dec +bin/lpcnet_enc +include/lpcnet/lpcnet_freedv.h +lib/cmake/lpcnetfreedv/lpcnetfreedv-config-%%CMAKE_BUILD_TYPE%%.cmake +lib/cmake/lpcnetfreedv/lpcnetfreedv-config.cmake +lib/liblpcnetfreedv.so +lib/liblpcnetfreedv.so.0.2