Merge pull request #129 from bondagit/issue-114

Issue 114
This commit is contained in:
Andrea Bondavalli 2023-05-18 12:27:24 +02:00 committed by GitHub
commit e64a5a7e76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 25 additions and 13 deletions

View File

@ -103,6 +103,8 @@ The [aes67-daemon branch of ravenna-alsa-lkm repository](https://github.com/bond
The following patches have been applied to the original module: The following patches have been applied to the original module:
* patch to support sample rates 192Khz and 384Khz (from driver version v1.7)
* patch to compile with Linux Kernel v6.2 and above (from driver version v1.7)
* patch to make the PTP slave status change from locked to unlocked if no announcement messages are received from the Master for more than 5 seconds (from driver version v1.6). See [issue 87](https://github.com/bondagit/aes67-linux-daemon/issues/87). * patch to make the PTP slave status change from locked to unlocked if no announcement messages are received from the Master for more than 5 seconds (from driver version v1.6). See [issue 87](https://github.com/bondagit/aes67-linux-daemon/issues/87).
* patch to fix issue causing the usage of wrong Sources and Sinks buffer offsets in case of reconfiguration or daemon restart (from driver version v1.5). See [issue 55](https://github.com/bondagit/aes67-linux-daemon/issues/55). * patch to fix issue causing the usage of wrong Sources and Sinks buffer offsets in case of reconfiguration or daemon restart (from driver version v1.5). See [issue 55](https://github.com/bondagit/aes67-linux-daemon/issues/55).
* patch to enable the configuration of smaller ALSA buffer sizes to reduce end-to-end latency up to 8ms (from driver version v1.4). See [platform latency test](#latency) and See [issue 53](https://github.com/bondagit/aes67-linux-daemon/issues/53) * patch to enable the configuration of smaller ALSA buffer sizes to reduce end-to-end latency up to 8ms (from driver version v1.4). See [platform latency test](#latency) and See [issue 53](https://github.com/bondagit/aes67-linux-daemon/issues/53)
@ -211,7 +213,7 @@ The script allows a user to test a specific configuration and it can be used to
Usage run_test.sh sample_format sample_rate channels duration Usage run_test.sh sample_format sample_rate channels duration
sample_format can be one of S16_LE, S24_3LE, S32_LE sample_format can be one of S16_LE, S24_3LE, S32_LE
sample_rate can be one of 44100, 48000, 96000 sample_rate can be one of 44100, 48000, 96000, 192000, 384000
channels can be one of 2, 4, 6, up to 64 channels can be one of 2, 4, 6, up to 64
duration is in the range 1 to 10 minutes duration is in the range 1 to 10 minutes
@ -269,7 +271,7 @@ The script allows a user to test the latency on a specific configuration and it
Usage run_latency_test.sh sample_format sample_rate channels duration frames Usage run_latency_test.sh sample_format sample_rate channels duration frames
sample_format can be one of S16_LE, S24_3LE, S32_LE sample_format can be one of S16_LE, S24_3LE, S32_LE
sample_rate can be one of 44100, 48000, 96000 sample_rate can be one of 44100, 48000, 96000, 192000, 384000
channels can be one of 2, 4, 6, up to 64 channels can be one of 2, 4, 6, up to 64
duration of the test in seconds duration of the test in seconds
frames buffer size in frames frames buffer size in frames

View File

@ -11,7 +11,7 @@ TOPDIR=$(pwd)
cd 3rdparty cd 3rdparty
if [ ! -d ravenna-alsa-lkm ]; then if [ ! -d ravenna-alsa-lkm ]; then
git clone --single-branch --branch aes67-daemon https://github.com/bondagit/ravenna-alsa-lkm.git git clone --single-branch --branch aes67-daemon-issue11 https://github.com/bondagit/ravenna-alsa-lkm.git
cd ravenna-alsa-lkm/driver cd ravenna-alsa-lkm/driver
make make
cd ../.. cd ../..

View File

@ -237,7 +237,7 @@ where:
> **sample\_rate** > **sample\_rate**
> JSON number specifying the default sample rate. > JSON number specifying the default sample rate.
> Valid values are 44100Hz, 48000Hz and 96000Hz. > Valid values are 44100Hz, 48000Hz, 96000Hz, 192000Hz and 384000Hz.
> **playout\_delay** > **playout\_delay**
> JSON number specifying the default safety playout delay at 1FS in samples. > JSON number specifying the default safety playout delay at 1FS in samples.

View File

@ -39,7 +39,7 @@ namespace po = boost::program_options;
namespace postyle = boost::program_options::command_line_style; namespace postyle = boost::program_options::command_line_style;
namespace logging = boost::log; namespace logging = boost::log;
static const std::string version("bondagit-1.6.2"); static const std::string version("bondagit-1.6.3");
static std::atomic<bool> terminate = false; static std::atomic<bool> terminate = false;
void termination_handler(int signum) { void termination_handler(int signum) {

View File

@ -13,9 +13,9 @@ function cleanup {
} }
function usage { function usage {
echo 'Usage run_latenvy_test.sh sample_format sample_rate channels duration frames' >&2 echo 'Usage run_latency_test.sh sample_format sample_rate channels duration frames' >&2
echo ' sample_format can be one of S16_LE, S24_3LE, S32_LE' >&2 echo ' sample_format can be one of S16_LE, S24_3LE, S32_LE' >&2
echo ' sample_rate can be one of 44100, 48000, 96000' >&2 echo ' sample_rate can be one of 44100, 48000, 96000, 192000, 384000' >&2
echo ' channels can be one of 2, 4, 6, up to 64' >&2 echo ' channels can be one of 2, 4, 6, up to 64' >&2
echo ' duration in seconds' >&2 echo ' duration in seconds' >&2
echo ' frames buffer size in frames' >&2 echo ' frames buffer size in frames' >&2
@ -85,6 +85,10 @@ elif [ $SAMPLE_RATE == "48000" ]; then
PTIME="1" PTIME="1"
elif [ $SAMPLE_RATE == "96000" ]; then elif [ $SAMPLE_RATE == "96000" ]; then
PTIME="0.5" PTIME="0.5"
elif [ $SAMPLE_RATE == "192000" ]; then
PTIME="0.25"
elif [ $SAMPLE_RATE == "384000" ]; then
PTIME="0.125"
else else
usage usage
fi fi

View File

@ -45,7 +45,7 @@ echo 'Creating test file ...' >&2
if ! ./createtest $1 $2 $3 $4 ; then if ! ./createtest $1 $2 $3 $4 ; then
echo 'Usage run_test.sh sample_format sample_rate channels duration' >&2 echo 'Usage run_test.sh sample_format sample_rate channels duration' >&2
echo ' sample_format can be one of S16_LE, S24_3LE, S32_LE' >&2 echo ' sample_format can be one of S16_LE, S24_3LE, S32_LE' >&2
echo ' sample_rate can be one of 44100, 48000, 96000' >&2 echo ' sample_rate can be one of 44100, 48000, 96000, 192000, 384000' >&2
echo ' channels can be one of 2, 4, 6, up to 64' >&2 echo ' channels can be one of 2, 4, 6, up to 64' >&2
echo ' duration is in the range 1 to 10 minutes' >&2 echo ' duration is in the range 1 to 10 minutes' >&2
exit 1 exit 1
@ -74,6 +74,10 @@ elif [ $SAMPLE_RATE == "48000" ]; then
PTIME="1" PTIME="1"
elif [ $SAMPLE_RATE == "96000" ]; then elif [ $SAMPLE_RATE == "96000" ]; then
PTIME="0.5" PTIME="0.5"
elif [ $SAMPLE_RATE == "192000" ]; then
PTIME="0.25"
elif [ $SAMPLE_RATE == "384000" ]; then
PTIME="0.125"
fi fi
SOURCE=$(cat <<-END SOURCE=$(cat <<-END

View File

@ -5,9 +5,9 @@
#create a user for the daemon #create a user for the daemon
sudo useradd -M -l aes67-daemon -c "AES67 Linux daemon" sudo useradd -M -l aes67-daemon -c "AES67 Linux daemon"
#copy the daemon binary #copy the daemon binary, make sure -DWITH_SYSTEMD=ON
sudo cp ../daemon/aes67-daemon /usr/local/bin/aes67-daemon sudo cp ../daemon/aes67-daemon /usr/local/bin/aes67-daemon
#create the daemon webui and scripts directories #create the daemon webui and script directories
sudo install -d -o aes67-daemon /var/lib/aes67-daemon /usr/local/share/aes67-daemon/scripts/ /usr/local/share/aes67-daemon/webui/ sudo install -d -o aes67-daemon /var/lib/aes67-daemon /usr/local/share/aes67-daemon/scripts/ /usr/local/share/aes67-daemon/webui/
#copy the ptp script #copy the ptp script
sudo install -o aes67-daemon ../daemon/scripts/ptp_status.sh /usr/local/share/aes67-daemon/scripts/ sudo install -o aes67-daemon ../daemon/scripts/ptp_status.sh /usr/local/share/aes67-daemon/scripts/

View File

@ -25,7 +25,7 @@ int main(int argc, char* argv[])
} }
int rate(atoi(argv[2])); int rate(atoi(argv[2]));
if (rate != 44100 && rate != 48000 && rate != 96000) { if (rate != 44100 && rate != 48000 && rate != 96000 && rate != 192000 && rate != 384000) {
cerr << "Unsupported rate " << rate << endl; cerr << "Unsupported rate " << rate << endl;
exit(1); exit(1);
} }

View File

@ -583,7 +583,7 @@ int main(int argc, char *argv[])
break; break;
case 'r': case 'r':
err = atoi(optarg); err = atoi(optarg);
rate = err >= 4000 && err < 200000 ? err : 44100; rate = err >= 4000 && err < 400000 ? err : 44100;
break; break;
case 'B': case 'B':
err = atoi(optarg); err = atoi(optarg);
@ -624,7 +624,7 @@ int main(int argc, char *argv[])
loop_limit = loop_sec * rate; loop_limit = loop_sec * rate;
latency = latency_min - 4; latency = latency_min - 4;
buffer = (char*)malloc((latency_max * 2 * snd_pcm_format_width(format) / 8) * channels); buffer = (char*)malloc((latency_max * 4 * snd_pcm_format_width(format) / 8) * channels);
setscheduler(); setscheduler();

View File

@ -186,6 +186,8 @@ class Config extends Component {
<option value="44100">44.1 kHz</option> <option value="44100">44.1 kHz</option>
<option value="48000">48 kHz</option> <option value="48000">48 kHz</option>
<option value="96000">96 kHz</option> <option value="96000">96 kHz</option>
<option value="192000">192 kHz</option>
<option value="384000">384 kHz</option>
</select> </select>
</th> </th>
</tr> </tr>