kazam on Focal: No audio recorded

Bug #1876322 reported by SoundVM
64
This bug affects 12 people
Affects Status Importance Assigned to Milestone
kazam (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Dmitry Shachnev

Bug Description

[Impact]

* Kazam does not detect audio devices when running with Python 3.8
* Recording of audio does not work in Kazam

[Test Case]

* Run Kazam on a system with PulseAudio
* Check if audio devices have been detected, they must be listed in the GUI in settings of audio
* Check if console output contains "Unable to find any audio devices"

[Regression Potential]

The bug is fixed by replacing time.clock() with time.perf_counter(), as can be seen in this patch:

https://salsa.debian.org/python-team/applications/kazam/-/blob/master/debian/patches/perf_counter.patch

The old method was deprecated since Python 3.3, and completely removed in Python 3.8. So by replacing it with the new method, we are definitely not making the situation worse. So no regressions are expected (if for some reason the new method is not working properly, it won't be a regression).

[Other info]

Original bug description:

Hello,
I upgraded from Ubuntu 19.10 to 20.04. The process completed without any problem.

I meet a bug to execute kazam ( version 1.4.5-3 ) : No audio recoded with images : the video has no audio track. This occurson 2 differents computers ( where bug only appeared after upgrading to 20.04 )

No audio recorded even if i select Speaker and/or microphone boxes.

So I tried to configure the audio devices : in the preferences interface, it's impossible to select any of sound sources for recording, nor Speakers otr Microphones ( see screenshot : empty or unknown labels... )
And on one machine, trying to select devices with audio preferences conducts to crash Kazam.

Executing Kazam through the command line presents a warning about "Unable to find any audio devices" :

WARNING Kazam - Failed to correctly detect operating system.
/usr/lib/python3/dist-packages/kazam/app.py:145: Warning: value "((GtkIconSize) 32)" of type 'GtkIconSize' is invalid or out of range for property 'icon-size' of type 'GtkIconSize'
  self.builder.add_from_file(os.path.join(prefs.datadir, "ui", "kazam.ui"))

(kazam:29121): Gtk-WARNING **: 16:10:18.525: Can't set a parent on widget which has a parent

(kazam:29121): Gtk-WARNING **: 16:10:18.534: Can't set a parent on widget which has a parent
WARNING Prefs - Unable to find any audio devices.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/kazam/frontend/preferences.py", line 256, in cb_audio2_changed
    pa_audio2_idx = prefs.mic_sources[prefs.audio2_source][0]
IndexError: list index out of range
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/kazam/frontend/preferences.py", line 256, in cb_audio2_changed
    pa_audio2_idx = prefs.mic_sources[prefs.audio2_source][0]
IndexError: list index out of range

help would be appreciated... Thank you

Revision history for this message
SoundVM (soundvm) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in kazam (Ubuntu):
status: New → Confirmed
Revision history for this message
flavin (fcolavin) wrote :

attached the log of what I see when I open kazam preferences

Revision history for this message
flavin (fcolavin) wrote :

I did this patch and is working now in ubuntu 20.04 with python 3.8
I replaced time.clock() for time.perf_counter

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "kazam_pulse_audio_python_3_8.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Nhomar - Vauxoo (nhomar) wrote :

I confirm the patch from flavin is working.

POPOS 20.04

description: updated
Revision history for this message
Keith (keithrainz) wrote :

can someone explain the simple solution

Revision history for this message
flavin (fcolavin) wrote :

Hi @keith depend where is installed your kazam, this is one way you can apply the patch in default ubuntu 20.04 (to me is here /usr/lib/python3/dist-packages/kazam/):

1.-
download the patch from here:
https://bugs.launchpad.net/ubuntu/+source/kazam/+bug/1876322/comments/4

2.- then

cd /usr/lib/python3/dist-packages/kazam/
sudo patch < ~/Downloads/kazam_pulse_audio_python_3_8.patch

Revision history for this message
Chris Wilson (jakdaw) wrote :

The patch fixes it for me too!

Revision history for this message
mvsfrasson (mvsfrasson) wrote :

The patch works for me (Xubuntu 20.04). Thanks, @fcolavin!

From instructions on comment #8, I had to inform at prompt
```
pulseaudio/pulseaudio.py
```
Returning to kazam window, check back the options to record microphone.

Revision history for this message
Jesse Glick (jesse-glick) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kazam - 1.4.5-4

---------------
kazam (1.4.5-4) unstable; urgency=medium

  * Team upload.
  * Use time.perf_counter() instead of time.clock() to fix errors with
    Python 3.8 (closes: #955817, LP: #1876322).
  * Upload to unstable.

 -- Dmitry Shachnev <email address hidden> Sat, 15 Aug 2020 18:09:50 +0300

Changed in kazam (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
arakelov (nabadvin) wrote :

The patch worked as a charm for me!

The only thing I had to change was

cd /usr/lib/python3/dist-packages/kazam/pulseaudio/

(where the file to be patched, pulseaudio.py, is located) instead of

cd /usr/lib/python3/dist-packages/kazam/

After that,

sudo patch < ~/Downloads/kazam_pulse_audio_python_3_8.patch

Thank you @fcolavin!

description: updated
description: updated
Changed in kazam (Ubuntu Focal):
status: New → In Progress
assignee: nobody → Dmitry Shachnev (mitya57)
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello SoundVM, or anyone else affected,

Accepted kazam into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/kazam/1.4.5-3ubuntu0.1 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 on 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, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in kazam (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Paul Smith (pjsanfil) wrote :

The kazam 1.4.5-3ubuntu0.1 fixes this bug for me. Thanks!

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Paul, thanks for testing. Marking as verified accordingly.

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kazam - 1.4.5-3ubuntu0.1

---------------
kazam (1.4.5-3ubuntu0.1) focal; urgency=medium

  * Use time.perf_counter() instead of time.clock() to fix errors with
    Python 3.8 (LP: #1876322).

 -- Dmitry Shachnev <email address hidden> Sat, 22 Aug 2020 14:53:26 +0300

Changed in kazam (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for kazam has completed successfully and the package is now being 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 regressions.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.