Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ee35c6a
Audio recording and playing test
nvelux Aug 11, 2017
ba989de
audio testing for record and playing
nvelux Aug 11, 2017
72909e5
Audio recoding and playback test
nvelux Aug 12, 2017
74b8466
Audio recording and playback test
nvelux Aug 12, 2017
f3cb878
Audio record and playback
nvelux Aug 14, 2017
1bd2116
audio test for record and playback
nvelux Aug 14, 2017
ece48a9
Pulseaudio recording and playback test
nvelux Aug 15, 2017
53affe5
Pulseaudio recoeding and playback testing
nvelux Aug 15, 2017
134497d
pulaeaudio recording and playback testing
nvelux Aug 15, 2017
7fbd082
Pulseaudio recording and playback testing
nvelux Aug 16, 2017
8762eae
Pulseaudio recording and playback testing
nvelux Aug 16, 2017
ba87342
Pulseaudio testing for record and playback
nvelux Aug 16, 2017
7abe1a8
Pulseaudio recording and playback testing
nvelux Aug 17, 2017
0a6829a
pulseaudio debugging for running
nvelux Aug 17, 2017
19012f8
pulse audio testing
nvelux Aug 17, 2017
0c00a39
Pulseaudio test for record and playback
nvelux Aug 18, 2017
b674d54
Pulseaudio testing
nvelux Aug 18, 2017
88274cf
Pulse audio playing debugging
nvelux Aug 21, 2017
dddd753
Pulseaudio recording and playing
nvelux Aug 21, 2017
aafa191
Pulseaudio recording and playing test
nvelux Aug 24, 2017
65fbca2
Pulseaudio recoding and playing testing
nvelux Aug 28, 2017
a250627
Pulseaudio recording and playback testing
nvelux Aug 29, 2017
298ea9d
Pulseaudio record and play back test
nvelux Aug 29, 2017
299419f
pulseaudio recording and playback testing
nvelux Aug 29, 2017
443ec36
Pulseaudio recording and playback testing
nvelux Aug 30, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions meta-iotqa/conf/test/refkit-image-gateway.manifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Tests for gateway profile
oeqa.runtime.core.iotivity.client
oeqa.runtime.multimedia.audio.pulseaudio
oeqa.runtime.multimedia.audio.pulseaudio_rec_play
oeqa.runtime.peripherals.mraa.mraa_gpio
oeqa.runtime.peripherals.mraa.mraa_hello
oeqa.runtime.peripherals.upm.upm
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import time
from oeqa.oetest import oeRuntimeTest


class PulseaudioTest(oeRuntimeTest):
def test_rec_play(self):
# Start pulseaudio daemon
(status, output) = self.target.run("pulseaudio -D")
self.assertEqual(status, 0, msg="Error pulseaudio not started: %s" % output)
# Recording audio
(status, output) = self.target.run("parecord -r /tmp/rec.wav &")
time.sleep(3)
self.assertEqual(status, 0, msg="Error not recorded: %s" % output)
# Stop pulseaudio daemon
(status, output) = self.target.run("pulseaudio -k")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that parecord doesn't have time parameter to stop the recording, but maybe you could dig out or save the previously started parecord process id and kill thaq (instead of killing pulseaudio server)

self.assertEqual(status, 0, msg="Error pulseaudio not stop: %s" % output)
# start pulseaudio daemon
(status, output) = self.target.run("pulseaudio -D")
self.assertEqual(status, 0, msg="Error pulseaudio not started: %s" % output)
# Checking recorded file present
(status, output) = self.target.run("ls /tmp/ |grep 'rec.wav'")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have to do the grep "rec.wav", could you just ls?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just confirming the recorded file present.

self.assertEqual(status, 0, msg="Error file not found: %s" % output)
# Playing audio
(status, output) = self.target.run("paplay /tmp/rec.wav &")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you actually tried that you can record and play the audio with these commands (like in your own pc)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's playing the audio.

self.assertEqual(status, 0, msg="Error not played: %s" % output)
# Audio running states checking
(status, output) = self.target.run("cat /proc/asound/card1/pcm3p/sub0/status |grep 'state: RUNNING'")
self.assertEqual(status, 0, msg="Error not running: %s" % output)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how portable the alsa card path here is...? You could do "pactl list sinks" and grep for "RUNNING" and so on.