checkbox alsa_record_playback should use autoaudiosrc instead of alsasrc

Bug #1059544 reported by Swen Kühnlein on 2012-10-01
126
This bug affects 27 people
Affects Status Importance Assigned to Milestone
Checkbox
High
Unassigned
checkbox (Ubuntu)
High
Daniel Manrique
Raring
Undecided
Unassigned

Bug Description

[Impact]

 When running any job using the alsa_record_playback script from checkbox, the test fails and an exception with trace is produced. This happens on installations that don't have the alsasrc gstreamer element, such as kubuntu or xubuntu. Thus, the test fails
 even if audio on the system is indeed working properly.

 Due to the high incidence of this bug as mentioned in comment #17, and the fact that the fix is relatively simple, it's worth backporting this so it's available on the latest stable release (13.04).

 The fix was introduced in checkbox trunk revision 2083, it simply modifies the script itself so it uses the autoaudiosrc element which should be available in any sane gstreamer installation (with the good set of plugins), and it also modifies the job definition so that the job won't even run in the unlikely event that not even the
 gstreamer*-plugins-good are available, rather than producing a confusing crash and trace.

[Test Case]

- Ensure that gstreamer1.0-alsa is NOT installed. It's not installed by default on Ubuntu flavours such as kubuntu or xubuntu. If you're running vanilla Ubuntu, you can sudo apt-get remove gstreamer1.0-alsa.

  - Run this command:
    PATH=$PATH:/usr/share/checkbox/scripts alsa_record_playback
  - Expected result:
    Sound is recorded from the microphone for a few seconds, then played back through the speakers/headphones.

  - Actual result: Error Trace as seen in the original report.

[Regression Potential]

 * Not much of a chance for regressions, since the autoaudiosrc source has been in the gstreamer-plugins-good package since at least Ubuntu 12.10. As mentioned in the comments, checkbox has been using autoaudiosrc without any reports of problems in *most* of our audio-related jobs, so this should benefit from that experience.
Checking for the gstreamer{0.10,1.0}-plugins-good packages is a safety net that may nevertheless cause problems if a user has a version of the plugins package that contains autoaudiosrc and doesn't match the package names we're expecting, however this is unlikely for the targeted versions of Ubuntu.

ProblemType: Crash
DistroRelease: Ubuntu 12.10
Package: checkbox 0.14.7
ProcVersionSignature: Ubuntu 3.5.0-16.25-generic 3.5.4
Uname: Linux 3.5.0-16-generic i686
ApportVersion: 2.5.3-0ubuntu1
Architecture: i386
Date: Mon Oct 1 14:01:28 2012
ExecutablePath: /usr/lib/checkbox/bin/gst_pipeline_test
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111012)
InterpreterPath: /usr/bin/python3.2mu
ProcCmdline: /usr/bin/python3 /usr/share/checkbox/scripts/gst_pipeline_test -t 5 alsasrc\ !\ audioconvert\ !\ level\ name=recordlevel\ interval=10000000\ !\ audioconvert\ !\ wavenc\ !\ filesink\ location=/tmp/tmp.1IiyjmqnYo/test.wav
PythonArgs: ['/usr/share/checkbox/scripts/gst_pipeline_test', '-t', '5', 'alsasrc ! audioconvert ! level name=recordlevel interval=10000000 ! audioconvert ! wavenc ! filesink location=/tmp/tmp.1IiyjmqnYo/test.wav']
SourcePackage: checkbox
Title: gst_pipeline_test crashed with gi._glib.GError in function(): Kein Element »alsasrc«
UpgradeStatus: Upgraded to quantal on 2012-09-08 (23 days ago)
UserGroups: adm admin audio cdrom debian-tor dialout fuse lpadmin plugdev sambashare vboxusers video

Related branches

Swen Kühnlein (swen) wrote :
tags: removed: need-duplicate-check
Changed in checkbox (Ubuntu):
importance: Undecided → Medium
Swen Kühnlein (swen) on 2012-10-01
visibility: private → public
Daniel Manrique (roadmr) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

The error means that the alsasrc gstreamer element couldn't be found. This is very strange as this element is part of gstreamer's base plugins.

Could you open a terminal (ctrl-alt-t), run these two commands, and then add the output of running that as a comment here?

gst-launch-0.10 "alsasrc ! audioconvert ! level name=recordlevel interval=10000000 ! audioconvert ! wavenc ! filesink location=/tmp/test.wav"

apt-cache show gstreamer0.10-plugins-base

If the output to the last command is too long, you can send it to a file:

apt-cache show gstreamer0.10-plugins-base >/tmp/show.txt

and then attach the /tmp/show.txt file here.

Thanks!

Changed in checkbox (Ubuntu):
status: New → Incomplete
Swen Kühnlein (swen) wrote :
Download full text (3.9 KiB)

$ LANG=en_US gst-launch-0.10 "alsasrc ! audioconvert ! level name=recordlevel interval=10000000 ! audioconvert ! wavenc ! filesink location=/tmp/test.wav"
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstAudioSrcClock
ERROR: from element /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2625): gst_base_src_loop (): /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0:
streaming task paused, reason not-linked (-1)
Execution ended after 16955651 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

$ LANG=en_US apt-cache show gstreamer0.10-plugins-base
Package: gstreamer0.10-plugins-base
Priority: optional
Section: libs
Installed-Size: 2174
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Maintainers of GStreamer packages <email address hidden>
Architecture: i386
Source: gst-plugins-base0.10
Version: 0.10.36-1ubuntu1
Replaces: gstreamer0.10-plugins-bad (<< 0.10.3+cvs20060814-0ubuntu4)
Provides: gstreamer0.10-audiosource, gstreamer0.10-videosource
Depends: libc6 (>= 2.7), libcdparanoia0 (>= 3.10.2+debian), libglib2.0-0 (>= 2.31.8), libgstreamer0.10-0 (>= 0.10.36), libogg0 (>= 1.0rc3), liborc-0.4-0 (>= 1:0.4.16), libtheora0 (>= 1.0), libvisual-0.4-0 (>= 0.4.0-4), libvorbis0a (>= 1.1.2), libvorbisenc2 (>= 1.1.2), libxml2 (>= 2.7.4), libgstreamer-plugins-base0.10-0 (>= 0.10.36)
Suggests: gvfs
Filename: pool/main/g/gst-plugins-base0.10/gstreamer0.10-plugins-base_0.10.36-1ubuntu1_i386.deb
Size: 764934
MD5sum: 27f0253ec46d0884da63313286af4ae7
SHA1: 8fbdc93d989ce98ab7c6e44c9c04269ba18fd886
SHA256: 6d8b702d924699542d87128743169674132f29865c6ac2d73037cdf13d3f1f9b
Description-en: GStreamer plugins from the "base" set
 GStreamer is a streaming media framework, based on graphs of filters
 which operate on media data. Applications using this library can do
 anything from real-time sound processing to playing videos, and just
 about anything else media-related. Its plugin-based architecture means
 that new data types or processing capabilities can be added simply by
 installing new plug-ins.
 .
 This package contains the GStreamer plugins from the "base" set, an
 essential exemplary set of elements.
Multi-Arch: same
Homepage: http://gstreamer.freedesktop.org
Gstreamer-Decoders: application/ogg; application/x-annodex; application/x-ass; application/x-ogg-avi; application/x-ogm-audio; application/x-ogm-text; application/x-ogm-video; application/x-ssa; application/x-subtitle; application/x-subtitle-dks; application/x-subtitle-mpl2; application/x-subtitle-qttext; application/x-subtitle-sami; application/x-subtitle-tmplayer; audio/x-vorbis; video/x-theora
Gstreamer-Elements: adder, appsink, appsrc, audioconvert, audiorate, audioresample, audiotestsrc, cdparanoiasrc, decodebin, decodebin2, encodebin, ffmpegcolorspace, gdpdepay, gdppay, giosink, giosrc, giostreamsink, giostreamsrc, multifdsink, oggaviparse, oggdemux, oggmux, oggparse, ogmaudioparse, ogmtextparse, ogmvideoparse, playbin, playbin2, playsink, ssaparse...

Read more...

Daniel Manrique (roadmr) wrote :

Thanks so much. This is strange because it seems to indicate all is working well. Next, could you try running the exact command that checkbox uses for this test, on a terminal? this would be simply:

/usr/share/checkbox/scripts/alsa_record_playback

When you run it it will record from your microphone (speak a bit!), then play it back for you to confirm.

Let me know if it errors out or works as intended. If it errors out, you could paste the output here.

Thanks!

Swen Kühnlein (swen) wrote :

$ LANG=en_US /usr/share/checkbox/scripts/alsa_record_playback
/usr/share/checkbox/scripts/alsa_record_playback: 4: /usr/share/checkbox/scripts/alsa_record_playback: gst_pipeline_test: not found
/tmp/tmp.H7asQKjGjV/test.wav: No such file or directory
rm: cannot remove `/tmp/tmp.H7asQKjGjV/test.wav': No such file or directory

Daniel Manrique (roadmr) wrote :

Hi, thanks for testing! and apologies, I missed a crucial part to ensure that gst_pipeline_test is findable. can you run it like this? (the LANG part should be unnecessary; rather, if it gives trouble due to your locale, I'd like to know about it):

PATH=$PATH:/usr/share/checkbox/scripts /usr/share/checkbox/scripts/alsa_record_playback

Swen Kühnlein (swen) wrote :

$ PATH=$PATH:/usr/share/checkbox/scripts /usr/share/checkbox/scripts/alsa_record_playback
Traceback (most recent call last):
  File "/usr/share/checkbox/scripts/gst_pipeline_test", line 59, in <module>
    sys.exit(main())
  File "/usr/share/checkbox/scripts/gst_pipeline_test", line 42, in main
    element = Gst.parse_launch(args.PIPELINE)
  File "/usr/lib/python3/dist-packages/gi/types.py", line 47, in function
    return info.invoke(*args, **kwargs)
gi._glib.GError: Kein Element »alsasrc«
/tmp/tmp.PHmyhpUST3/test.wav: Datei oder Verzeichnis nicht gefunden
rm: Entfernen von »/tmp/tmp.PHmyhpUST3/test.wav“ nicht möglich: Datei oder Verzeichnis nicht gefunden

Daniel Manrique (roadmr) on 2012-10-19
Changed in checkbox (Ubuntu):
status: Incomplete → Confirmed
CSRedRat (csredrat) wrote :

Affected with test system Ubuntu 13.04 on Miсrosft Hyper-V Server 2008 R2 SP1.

Msirdian (arena7) wrote :

Affected with test system Ubuntu 13.04 Kernel Linux 3.8.0-3-generic , on VMware player

CSRedRat (csredrat) wrote :

Need fix.

Same in 13.04

Fejjari semah (semah-fejjari) wrote :

the graphic bar didn' t show !!

the graphics bare and the camera can't be shown !!

Jaime Pereira (jaimepereira) wrote :

the graphic bar didn' t show

col reilly (lupinehorror) wrote :

doing this on the daily of 13.04 for me too.

CSRedRat (csredrat) wrote :

Ubuntu 13.04 affected with test system.

Sebastien Bacher (seb128) wrote :

Raising the setting, the issue is one of the most reported one in raring:

@Daniel:

the problem is that your code is using gstreamer1.0, not 0.10, that version doesn't have a "alsasrc"

$ gst-launch-1.0 alsasrc
ERROR: pipeline could not be constructed: no element "alsasrc".

Changed in checkbox (Ubuntu):
importance: Medium → High
Sebastien Bacher (seb128) wrote :

ok, you just need to depends on gstreamer1.0-alsa, it seems it's not installed for quite some users

summary: - gst_pipeline_test crashed with gi._glib.GError in function(): Kein
- Element »alsasrc«
+ checkbox should depends on gstreamer1.0-alsa
Daniel Manrique (roadmr) on 2013-04-25
Changed in checkbox (Ubuntu):
assignee: nobody → Daniel Manrique (roadmr)

Hi Sebastien,

At some point we replaced all our instances of alsasrc with autoaudiosrc, however this script seems to have escaped that process. This is the fix we can propose, that way we don't need to add any additional dependencies.

However I'm unsure of how people arrived at the situation where the alsasrc element is not present. I have been unable to reproduce this, and while as you mention, "quite some users" don't have it, it's not a problem on a default raring installation, leading me to wonder what is different about these user's systems.

Anyway, I'll submit a fix for checkbox devel and continue to try to find a reproduction case so we can SRU this fix.

Thanks for your help!

Changed in checkbox (Ubuntu):
status: Confirmed → In Progress
Changed in checkbox:
status: New → In Progress
importance: Undecided → High
Daniel Manrique (roadmr) wrote :

How to reproduce this bug:

- Ensure that gstreamer1.0-alsa is NOT installed. It's not installed by default on Ubuntu flavours such as kubuntu or xubuntu. If you're running vanilla Ubuntu, you can sudo apt-get remove gstreamer1.0-alsa.

- Run this command:
PATH=$PATH:/usr/share/checkbox/scripts alsa_record_playback
- Expected result:
  Sound is recorded from the microphone for a few seconds, then played back through the speakers/headphones.

Actual result:
$ PATH=$PATH:/usr/share/checkbox/scripts alsa_record_playback
Traceback (most recent call last):
  File "/usr/share/checkbox/scripts/gst_pipeline_test", line 59, in <module>
    sys.exit(main())
  File "/usr/share/checkbox/scripts/gst_pipeline_test", line 42, in main
    element = Gst.parse_launch(args.PIPELINE)
  File "/usr/lib/python3/dist-packages/gi/types.py", line 113, in function
    return info.invoke(*args, **kwargs)
gi._glib.GError: no element "alsasrc"
/tmp/tmp.FcbJd1DjLy/test.wav: No such file or directory
rm: cannot remove ‘/tmp/tmp.FcbJd1DjLy/test.wav’: No such file or directory

Daniel Manrique (roadmr) on 2013-04-25
Changed in checkbox:
status: In Progress → Fix Committed
Changed in checkbox (Ubuntu):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :
Download full text (7.8 KiB)

This bug was fixed in the package checkbox - 0.16

---------------
checkbox (0.16) saucy; urgency=low

  * New upstream release (LP: #1178403):

  * Launchpad automated translation updates

  [ Jeff Lane ]
  * scripts/cpu_offlining: Modified script to no longer offline cpu0 to resolve
    a bug on ARM. Modified output so most of it is redirected to stderr for
    fail cases, we don't need that much for success cases. (LP: #1078897)
  * jobs/mediacard.txt.in: Modified test instructions to be less confusing
    (LP: #970857)
  * scripts/cpu_topology: define the cpuinfo nested dicts on creation rather
    than define elements during parsing of /proc/cpuinfo (LP: #1111878)
  * scripts/lsmod_info: Corrected error handling for the check_output() call to
    trap the correct error. (LP: #1103647)
  * jobs/camera.txt.in: removed an extraneous requres line for gir1.2
    scripts/camera_test: added code to determine what version of gst we're
    using and set video type and plugin accordingly. (LP: #1100594)
  * scripts/network_check: added ability to specify custom target URL for
    debugging failures (LP: #1128017)
  * scripts/sleep_test_log_check: added new script to parse fwts logs for
    errors
    jobs/hibernate.txt.in, jobs/stress.txt.in, jobs/suspend.txt.in: added jobs
    to use the sleep_test_log_check script after s3/s4 tests. Modified current
    s3/s4 tests to use the new None fail level for fwts_test
    scripts/fwts_test: no longer fails on fwts errors if "-f none" is chosen.
    Now it should only fail by manual indication if the actual sleep action
    fails. (LP: #1169922)
  * scripts/bluetooth_test: test no longer generates odd Broken Pipe error when
    the dpkg bit verifies obexftp is installed (LP: #1169488)
  * jobs/networking.txt.in: fixed networking/info jobs that were not being run
    because $output was being resolved too early (LP: #1065983)
  * scripts/memory_compare: cleaned up the output to be more explanatory and
    easier to visually parse (LP: #1072666)
  * jobs/miscellanea.txt.in: Added jobs for manual verification of PXE boot and
    remote IPMI to improve server test coverage.
  * jobs/led.txt.in: Modified Jobs: led/power, led/wlan, led/wlan-disabled. New
    jobs: led/power-blink-suspend, led/suspend, led/mute
    jobs/keys.txt.in: modified keys/wireless
  * plugins/lock_prompt.py: added a lock release to cleanly clear lock on stop.
    plugins/persist_prompt.py: promoted save to run before lock release.
    checkbox/lib/fifo.py: trap OSError exception at close when the input/output
    fifo fds disappear before fifo.close() can get to them. (LP: #115561)
  * jobs/info.txt.in: fixed bad driver name in audio_codecs job (LP: #1165215)
  * jobs/mediacard.txt.in: reduce test file size for MMC to 64MB (LP: #1167214)
  * jobs/led.txt.in, jobs/suspend.txt.in: removed bits about WLAN LED flashing
    from the WLAN jobs as that no longer happens on data tx/rx (LP: #1157606)
  * jobs/power-management.txt.in: added manual reboot and shutdown tests for
    server and Xen testing. Took the opportunity to correct punctuation in the
    descriptions or other manual jobs.
    jobs/virtualization.txt.in: added virtualization/x...

Read more...

Changed in checkbox (Ubuntu):
status: Fix Committed → Fix Released
Daniel Manrique (roadmr) on 2013-05-10
Changed in checkbox:
status: Fix Committed → Fix Released
Daniel Manrique (roadmr) on 2013-05-10
description: updated
summary: - checkbox should depends on gstreamer1.0-alsa
+ checkbox alsa_record_playback should use autoaudiosrc instead of alsasrc

Hello Swen, or anyone else affected,

Accepted checkbox into raring-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/checkbox/0.15.6 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in checkbox (Ubuntu Raring):
status: New → Fix Committed
tags: added: verification-needed
Daniel Manrique (roadmr) wrote :
Download full text (4.0 KiB)

I ended up testing this myself, by the following procedure:

- Installed 13.04 on a virtual machine
- Verified installed version of checkbox:

$ dpkg --list checkbox*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii checkbox 0.15.5 i386 System testing application
un checkbox-cli <none> (no description available)
un checkbox-gtk <none> (no description available)
ii checkbox-qt 0.15.5 i386 QT4 interface for checkbox

- Removed gstreamer1.0-alsa:
$ sudo apt-get remove gstreamer1.0-alsa
[sudo] password for ubuntu:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  gstreamer1.0-alsa ubuntu-desktop
0 upgraded, 0 newly installed, 2 to remove and 45 not upgraded.
After this operation, 239 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 156244 files and directories currently installed.)
Removing ubuntu-desktop ...
Removing gstreamer1.0-alsa:i386 ...

- Run the test case:
$ PATH=$PATH:/usr/share/checkbox/scripts alsa_record_playback
OpenGL Warning: Failed to connect to host. Make sure 3D acceleration is enabled for this VM.
libGL error: failed to load driver: vboxvideo
libGL error: Try again with LIBGL_DEBUG=verbose for more details.
Traceback (most recent call last):
  File "/usr/share/checkbox/scripts/gst_pipeline_test", line 59, in <module>
    sys.exit(main())
  File "/usr/share/checkbox/scripts/gst_pipeline_test", line 42, in main
    element = Gst.parse_launch(args.PIPELINE)
  File "/usr/lib/python3/dist-packages/gi/types.py", line 113, in function
    return info.invoke(*args, **kwargs)
gi._glib.GError: no element "alsasrc"
/tmp/tmp.JmIQqZjD3q/test.wav: No such file or directory
rm: cannot remove ‘/tmp/tmp.JmIQqZjD3q/test.wav’: No such file or directory

OK, now to update checkbox, first I enable proposed and apt-get update, then:
$ sudo apt-get install checkbox checkbox-qt
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  bonnie++ bootchart checkbox-cli checkbox-gtk ethtool fwts git-core glmark2
  glmark2-es2 mesa-utils nmap obexftp render-bench smartmontools sox stress
  sysstat wmctrl
The following packages will be upgraded:
  checkbox checkbox-qt
2 upgraded, 0 newly installed, 0 to remove and 73 not upgraded.
Need to get 1,486 kB of archives.
After this operation, 28.7 kB disk space will be freed.
Get:1 http://us.archive.ubuntu.com/ubuntu/ raring-proposed/main checkbox i386 0.15.6 [1,409 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ raring-proposed/main checkbox-qt i386 0.15.6 [76.7 kB]
Fetched 1,486 kB in 1s (1,025 kB/s)
Preconfiguring packages ...
(Reading database ... 156234 files and directories currently installed.)
Preparing to replace checkbox 0.15.5 (using .../checkbox_0.15.6_i386.deb) ...
Unpackin...

Read more...

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package checkbox - 0.15.6

---------------
checkbox (0.15.6) raring-proposed; urgency=low

  [ Daniel Manrique ]
  * scripts/alsa_record_playback: Replaced alsasrc with autoaudiosrc
    (LP: #1059544)
 -- Daniel Manrique <email address hidden> Fri, 10 May 2013 17:24:26 -0400

Changed in checkbox (Ubuntu Raring):
status: Fix Committed → Fix Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

DonnieD (donnied) wrote :

Get this error in Graphics Test (default display test)

DonnieD (donnied) wrote :

Oh forgot to mention checkbox v0.16.2 Saucy as of 2013-07-01

DonnieD (donnied) wrote :

in my case failed gst_pipeline_test

Daniel Manrique (roadmr) wrote :

Hi Pekorius,

the graphics test problem was due to use of ffmpegcolorspace instead of videoconvert element in the pipeline.

This is bug https://bugs.launchpad.net/checkbox/+bug/1199259 which has a fix committed, but not yet released.

You should see this problem disappear in checkbox 0.16.3, which should release in a few days.

Thanks!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers