Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 885900 Details for
Bug 1084578
Audio HDMI test failed with Error: aplay command failed
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch using amixer to determine correct device number
0001-1084578-Audio-HDMI-test-failed-with-Error-aplay-comm.patch (text/plain), 5.84 KB, created by
Greg Nichols
on 2014-04-13 18:26:37 UTC
(
hide
)
Description:
patch using amixer to determine correct device number
Filename:
MIME Type:
Creator:
Greg Nichols
Created:
2014-04-13 18:26:37 UTC
Size:
5.84 KB
patch
obsolete
>From ae54c6974a0391d830272f8b1e43f81598516311 Mon Sep 17 00:00:00 2001 >From: Greg Nichols <gnichols@redhat.com> >Date: Sun, 13 Apr 2014 12:50:24 -0400 >Subject: [PATCH 1/2] 1084578 - Audio HDMI test failed with Error: aplay > command failed > >--- > tests/audio/audio.py | 85 ++++++++++++++++++++++++++++++++++++++-------------- > 1 file changed, 62 insertions(+), 23 deletions(-) > >diff --git a/tests/audio/audio.py b/tests/audio/audio.py >index 6d3c7dc..977c01b 100644 >--- a/tests/audio/audio.py >+++ b/tests/audio/audio.py >@@ -13,7 +13,7 @@ > # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. > # > # Author: Greg Nichols >-import os, sys, string, shutil, time, glob >+import os, sys, string, shutil, time, glob, re > > from hwcert.test import Test > from hwcert.tags import Constants, DeviceClass >@@ -26,6 +26,7 @@ class AudioTest(Test): > Test.__init__(self, name="audio") > self.deviceClass = DeviceClass.audio > self.cardNumber = 0 >+ self.captureSupport = False > > def plan(self, planner): > properties = dict() >@@ -49,10 +50,35 @@ class AudioTest(Test): > print infopath > Command("cat %s" % infopath).echo() > print "" >+ self.getDeviceNumber() > return True > # otherwise > return False > >+ def getDeviceNumber(self): >+ self.deviceNumber = -1 >+ idPattern = re.compile("numid=(?P<id>[0-9]+)") >+ pipe = os.popen("amixer -c %s controls" % self.cardNumber) >+ for line in pipe.readlines(): >+ if "Capture" in line: >+ self.captureSupport = True >+ if 'HDMI/DP,pcm=' in line: >+ match = idPattern.search(line) >+ if match: >+ id = match.group("id") >+ checkStatusCommand = Command("amixer -c %s cget numid=%s" %(self.cardNumber, id)) >+ try: >+ if checkStatusCommand.getString("values=on", singleLine=False): >+ if self.debug != Constants.off: >+ print "device id = %s" % id >+ self.deviceNumber = id >+ break >+ except Exception, e: >+ if self.debug != Constants.off: >+ print "Exception searching for device id:" >+ print e >+ >+ > def run(self): > FAILED = 1 > PASSED = 0 >@@ -73,19 +99,27 @@ class AudioTest(Test): > self.result = Constants.FAIL > return FAILED > >+ >+ if self.captureSupport: >+ waveFileDuration = 8 # sec. total >+ recordedWaveFile="./test.wav" >+ print "starting recording while playing demo sound" >+ if os.system("arecord -r 44100 -d %s -D plughw:%s %s &" % (waveFileDuration, self.cardNumber, recordedWaveFile)) != 0: >+ print "Error: arecord command failed" >+ self.result = Constants.FAIL >+ return FAILED >+ else: >+ print "Note: No Capture Support" >+ > waveFiles=["/usr/share/sounds/alsa/Front_Right.wav", > "/usr/share/sounds/alsa/Front_Left.wav"] >- waveFileDuration = 8 # sec. total >- recordedWaveFile="./test.wav" >- print "starting recording while playing demo sound" >- if os.system("arecord -r 44100 -d %s -D plughw:%s %s &" % (waveFileDuration, self.cardNumber, recordedWaveFile)) != 0: >- print "Error: arecord command failed" >- self.result = Constants.FAIL >- return FAILED >- > for waveFile in waveFiles: > if os.path.exists(waveFile): >- if os.system("aplay %s -D plughw:%s" % (waveFile, self.cardNumber)) != 0: >+ playCommand = "aplay %s -D plughw:%s" % (waveFile, self.cardNumber) >+ if self.deviceNumber >= 0: >+ playCommand = "aplay %s -D plughw:%s,%s" % (waveFile, self.cardNumber, self.deviceNumber) >+ print playCommand >+ if os.system(playCommand) != 0: > print "Error: aplay command failed" > self.result = Constants.FAIL > return FAILED >@@ -95,19 +129,24 @@ class AudioTest(Test): > self.result = Constants.FAIL > return FAILED > >- print "playing recorded sound" >- if os.system("aplay %s -D plughw:%s " % (recordedWaveFile, self.cardNumber)) != 0: >- print "Error: aplay command failed" >- self.result = Constants.FAIL >- return FAILED >- >- if not self.promptConfirm("Did you hear the recorded sound?"): >- self.result = Constants.FAIL >- return FAILED >- >- outputDirectory = os.path.dirname(self.outputFile) >- shutil.copy(recordedWaveFile, outputDirectory) >- print "Copied recorded sound %s to %s" % (recordedWaveFile, outputDirectory) >+ if self.captureSupport: >+ print "playing recorded sound" >+ playCommand = "aplay %s -D plughw:%s" % (recordedWaveFile, self.cardNumber) >+ if self.deviceNumber >= 0: >+ playCommand = "aplay %s -D plug:hdmi:%s,%s" % (recordedWaveFile, self.cardNumber, self.deviceNumber) >+ print playCommand >+ if os.system(playCommand) != 0: >+ print "Error: aplay command failed" >+ self.result = Constants.FAIL >+ return FAILED >+ >+ if not self.promptConfirm("Did you hear the recorded sound?"): >+ self.result = Constants.FAIL >+ return FAILED >+ >+ outputDirectory = os.path.dirname(self.outputFile) >+ shutil.copy(recordedWaveFile, outputDirectory) >+ print "Copied recorded sound %s to %s" % (recordedWaveFile, outputDirectory) > > self.result = Constants.PASS > return PASSED >-- >1.9.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1084578
: 885900 |
902298