Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pipewire-evaluation
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docs
pipewire-evaluation
Commits
52b0fb3a
Commit
52b0fb3a
authored
1 year ago
by
Dylan Aïssi
Browse files
Options
Downloads
Patches
Plain Diff
Finalize test-case-4-run.py
Signed-off-by:
Dylan Aïssi
<
dylan.aissi@collabora.com
>
parent
f9b9ffd3
Branches
main
Tags
apertis-v2024
No related merge requests found
Pipeline
#625283
passed
1 year ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+2
-1
2 additions, 1 deletion
README.md
scripts/test-case-4-run.py
+38
-23
38 additions, 23 deletions
scripts/test-case-4-run.py
with
40 additions
and
24 deletions
README.md
+
2
−
1
View file @
52b0fb3a
...
...
@@ -111,7 +111,7 @@ can install some tools that will be used in the next steps:
$ sudo apt update
$ sudo apt install alsa-utils pulseaudio-utils \
pipewire-jack sndfile-tools \
psmisc graphviz python3
psmisc graphviz python3
python3-matplotlib
```
-
**alsa-utils**
will be used to test sound cards directly using ALSA.
-
**pulseaudio-utils**
gives us
`pactl`
to check if pipewire is running.
...
...
@@ -124,6 +124,7 @@ $ sudo apt install alsa-utils pulseaudio-utils \
-
**graphviz**
provides
`dot`
which can convert dot files generated by
`pw-dot`
into png files to represent the PipeWire graph.
-
**python3**
to execute python test scripts.
-
**python3-matplotlib**
to generate graph from results.
If the linux kernel is recent enough, you should have sound cards registrered:
...
...
This diff is collapsed.
Click to expand it.
scripts/test-case-4-run.py
+
38
−
23
View file @
52b0fb3a
#!/usr/bin/env python3
from
statistics
import
mean
import
matplotlib.pyplot
as
plt
import
json
import
os
import
signal
...
...
@@ -78,32 +80,45 @@ if __name__ == "__main__":
# my_wav = "/usr/share/sounds/alsa/Front_Center.wav" # duration of 1.428 sec, checked with Audacity
# Generate different batches of sndfile-jackplay
for
nb_play
in
list
(
range
(
1
,
60
,
10
)):
# To avoid interference from previous run
kill_my_sinks
()
time
.
sleep
(
2
)
# Wait 2 sec to be sure all sndfile-jackplay are killed
print
(
f
"
\n
Starting
{
nb_play
}
sndfile-jackplay
"
)
start_jackplay_loop
(
my_wav_loop
)
for
nb_play_i
in
list
(
range
(
2
,
nb_play
)):
my_batches
=
list
(
range
(
1
,
60
,
10
))
my_results
=
{
new_list
:
[]
for
new_list
in
my_batches
}
for
nb_play
in
my_batches
:
for
run
in
range
(
1
,
11
):
# To avoid interference from previous run
kill_my_sinks
()
time
.
sleep
(
2
)
# Wait 2 sec to be sure all sndfile-jackplay are killed
print
(
f
"
\n
Starting
{
nb_play
}
sndfile-jackplay
"
)
start_jackplay_loop
(
my_wav_loop
)
time
.
sleep
(
2
)
# Wait 2 sec to be sure all sndfile-jackplay are running
print
(
"
Everything is ready for testing!
"
)
print
(
"
A new sndfile-jackplay will be run and time required will be measured
"
)
print
(
"
Press any key to start the test...
"
)
input
()
t_start
=
time
.
time
()
start_jackplay
(
my_wav
)
t_end
=
time
.
time
()
required_time
=
t_end
-
t_start
for
nb_play_i
in
list
(
range
(
2
,
nb_play
)):
start_jackplay_loop
(
my_wav_loop
)
time
.
sleep
(
2
)
# Wait 2 sec to be sure all sndfile-jackplay are running
print
(
"
Everything is ready for testing!
"
)
print
(
"
A new sndfile-jackplay will be run and time required will be measured
"
)
#print("Press any key to start the test...")
#input()
t_start
=
time
.
time
()
start_jackplay
(
my_wav
)
t_end
=
time
.
time
()
required_time
=
t_end
-
t_start
my_results
[
nb_play
].
append
(
required_time
)
print
(
f
"
With
{
nb_play
}
running, it tooks
{
required_time
}
"
+
"
to connect and play the sound
"
)
print
(
f
"
With
{
nb_play
}
running, it tooks
{
required_time
}
"
+
"
to connect and play the sound
"
)
kill_my_sinks
()
kill_my_sinks
()
# TODO generate a graph of required_time
# Generate a graph of required_time
x
=
list
(
my_results
.
keys
())
y
=
[]
for
run
in
my_batches
:
y
.
append
(
mean
(
my_results
[
run
]))
plt
.
plot
(
x
,
y
)
plt
.
xlabel
(
'
Already running sndfile-jackplay
'
)
plt
.
ylabel
(
'
Time to play a new sound
'
)
plt
.
title
(
"
Test case 4
"
)
plt
.
savefig
(
'
test_case_4_plot.png
'
)
# End of test case 4
print
(
"
End of test-case 4
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment