123 lines
3.1 KiB
Bash
123 lines
3.1 KiB
Bash
version=\
|
|
(
|
|
'c-3.0.1'
|
|
)
|
|
|
|
md5=\
|
|
(
|
|
# '43c7c9363ca7bf93a7bfaffb9b61de6b'
|
|
''
|
|
)
|
|
|
|
unpack()
|
|
{
|
|
cd ${pkg_build_dir}/..
|
|
unzip ${cfg_dir_downloads}/${pkg}-${version}.zip
|
|
}
|
|
|
|
requires=\
|
|
(
|
|
'cmake/host'
|
|
'fftw/neon'
|
|
)
|
|
|
|
configure()
|
|
{
|
|
mkdir -p ../build-neon &&
|
|
cd ../build-neon
|
|
cmake \
|
|
-DCROSS="$cmd_target_cc" \
|
|
-DCMAKE_FIND_ROOT_PATH="${cfg_dir_toolchain_sysroot}/usr" \
|
|
-DCMAKE_INSTALL_PREFIX="$cfg_dir_toolchain_sysroot/usr" \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_C_FLAGS=" -pipe -funit-at-a-time -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp -mfpu=neon " \
|
|
-DJANUS_REAL_SINGLE=1 \
|
|
"../janus-$version"
|
|
}
|
|
|
|
build()
|
|
{
|
|
cd ${pkg_build_dir}/../build-neon &&
|
|
$cmd_make janus-rx &&
|
|
$cmd_make janus-tx
|
|
|
|
}
|
|
|
|
host_install()
|
|
{
|
|
cd ${pkg_build_dir}/../build-neon &&
|
|
$cmd_make install
|
|
}
|
|
|
|
target_install()
|
|
{
|
|
cp -a ../janus-$version/etc/parameter_sets.csv "$cfg_dir_rootfs/etc/janus-psets.csv" &&
|
|
cd ${pkg_build_dir}/../build-neon &&
|
|
$cmd_target_strip janus-tx -o "$cfg_dir_rootfs/usr/bin/janusn-tx" &&
|
|
$cmd_target_strip janus-rx -o "$cfg_dir_rootfs/usr/bin/janusn-rx" &&
|
|
for plugin in libplugin_???_??.so; do
|
|
$cmd_target_strip ${plugin} -o "$cfg_dir_rootfs/usr/lib/${plugin}";
|
|
done &&
|
|
_test_scripts
|
|
}
|
|
|
|
_test_scripts()
|
|
{
|
|
echo "#!/bin/sh
|
|
# output settings
|
|
amixer set -D hw:0 'Headset' 0dB
|
|
amixer set -D hw:0 'Headset' 6dB-
|
|
amixer set -D hw:0 'HeadsetL Mixer AudioL2' on
|
|
amixer set -D hw:0 'HeadsetR Mixer AudioR2' on
|
|
|
|
# input settings
|
|
amixer -c 0 cset numid=29 100%
|
|
amixer -c 0 cset numid=26 100%
|
|
|
|
|
|
COMMON_PARAMETERS=\"--verbose 1 --pset-file /etc/janus-psets.csv --pset-id 1\"
|
|
# Alsa or wave
|
|
STREAM_DRIVER=\"alsa\"
|
|
STREAM_DRIVER_ARGUMENTS=\"default\"
|
|
STREAM_SAMPLING_FREQUENCY=\"48000\"
|
|
STREAM_PARAMETERS=\" --stream-driver \${STREAM_DRIVER} --stream-driver-args \${STREAM_DRIVER_ARGUMENTS} --stream-fs \${STREAM_SAMPLING_FREQUENCY} \"
|
|
PAYLOAD=\"HelloU\"
|
|
#PAYLOAD=\"The_quick_brown_fox_jumps_over_the_lazy_dog\"
|
|
|
|
#
|
|
PARAMETERS_TX=\"\${COMMON_PARAMETERS} \${STREAM_PARAMETERS} --packet-payload \${PAYLOAD}\"
|
|
echo \"A) janusn-tx \${PARAMETERS_TX}\"
|
|
janusn-tx \${PARAMETERS_TX}
|
|
|
|
PARAMETERS_RX=\"\${COMMON_PARAMETERS} \${STREAM_PARAMETERS}\"
|
|
echo \"B) janusn-rx \${PARAMETERS_RX}\"
|
|
janusn-rx \${PARAMETERS_RX}
|
|
" > "$cfg_dir_rootfs/usr/bin/janusn_atest.sh"
|
|
|
|
|
|
echo "#!/bin/sh
|
|
|
|
COMMON_PARAMETERS=\"--verbose 1 --pset-file /etc/janus-psets.csv --pset-id 1\"
|
|
# Alsa or wave
|
|
STREAM_DRIVER=\"wav\"
|
|
STREAM_DRIVER_ARGUMENTS=\"janux.wav\"
|
|
STREAM_SAMPLING_FREQUENCY=\"48000\"
|
|
STREAM_PARAMETERS=\" --stream-driver \${STREAM_DRIVER} --stream-driver-args \${STREAM_DRIVER_ARGUMENTS} --stream-fs \${STREAM_SAMPLING_FREQUENCY} --stream-channel 1 \"
|
|
PAYLOAD=\"HelloU\"
|
|
#PAYLOAD=\"The_quick_brown_fox_jumps_over_the_lazy_dog\"
|
|
|
|
#
|
|
PARAMETERS_TX=\"\${COMMON_PARAMETERS} \${STREAM_PARAMETERS} --packet-payload \${PAYLOAD}\"
|
|
echo \"A) janusn-tx \${PARAMETERS_TX}\"
|
|
janusn-tx \${PARAMETERS_TX}
|
|
|
|
echo \"S) File is\"
|
|
ls -al \${STREAM_DRIVER_ARGUMENTS}
|
|
|
|
PARAMETERS_RX=\"\${COMMON_PARAMETERS} \${STREAM_PARAMETERS}\"
|
|
echo \"B) janusn-rx \${PARAMETERS_RX}\"
|
|
janusn-rx \${PARAMETERS_RX}
|
|
" > "$cfg_dir_rootfs/usr/bin/janusn_wtest.sh"
|
|
|
|
}
|