Bug 1163926 - severe underruns with usb audio, works with pa 3.0 - buffer setup seems wrong
Summary: severe underruns with usb audio, works with pa 3.0 - buffer setup seems wrong
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pulseaudio
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-13 17:24 UTC by David Mansfield
Modified: 2016-05-12 07:29 UTC (History)
5 users (show)

Fixed In Version: pulseaudio-7.1-1.fc23.1
Clone Of:
Environment:
Last Closed: 2016-05-12 07:29:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
log of running with PA 3.0 version from Centos 7 (457.91 KB, text/plain)
2014-11-13 17:24 UTC, David Mansfield
no flags Details
log of running with PA 5.0 version from Fedora 20 (372.68 KB, text/plain)
2014-11-13 17:25 UTC, David Mansfield
no flags Details


Links
System ID Private Priority Status Summary Last Updated
FreeDesktop.org 86262 0 None None None Never

Description David Mansfield 2014-11-13 17:24:49 UTC
Created attachment 957234 [details]
log of running with PA 3.0 version from Centos 7

Description of problem:
Constant and severe audio underruns when using Jitsi (voip softphone).  When using the pulseaudio 3.0 version from Centos 7 (rhel) audio is perfectly smooth.


Version-Release number of selected component (if applicable):
pulseaudio-5.0-7.fc20.x86_64

How reproducible:
100%

Steps to Reproduce:
1. install jitsi, set up a sip account, use USB audio headset (e.g. plantronics)
2. make a call
3. audio (playback) is choppy and jitsi reports "discarded packets"

Actual results:
choppy audio, tons of underruns reported by PA


Expected results:
smooth audio

Additional info:
Installing the pulseaudio rpms from centos 7 "cures" the problem.

I have run PA in debug mode and captured the log from the startup of PA through hanging up the call both with the 3.0 PA version (current C7) and 5.0 PA version (current F20).

I'll attach the logs.

Diffing the two logs (old (-) = 3.0, new (+) = 5.0), it looks like the significant difference in tho logs has to do with buffering setup (as expected):

 I: [pulseaudio] card.c: Created 1 "alsa_card.usb-Plantronics_Plantronics_.Audio_648_USB-00-USB"
+I: [pulseaudio] module-card-restore.c: Storing profile and port latency offsets for card alsa_card.usb-Plantronics_Plantronics_.Audio_648_USB-00-USB.
+D: [pulseaudio] module-alsa-card.c: Found 0 jacks.
 D: [pulseaudio] reserve-wrap.c: Successfully create reservation lock monitor for device 'Audio3'
 D: [pulseaudio] alsa-util.c: Trying front:3 with SND_PCM_NO_AUTO_FORMAT ...
 D: [pulseaudio] alsa-util.c: Managed to open front:3
-I: [pulseaudio] alsa-util.c: cannot disable ALSA period wakeups
+I: [pulseaudio] alsa-util.c: Disabling tsched mode since BATCH flag is set
 D: [pulseaudio] alsa-util.c: Maximum hw buffer size is 5944 ms
-D: [pulseaudio] alsa-util.c: Set buffer size first (to 88200 samples), period size second (to 88200 samples).
-I: [pulseaudio] alsa-util.c: ALSA period wakeups were not disabled
+D: [pulseaudio] alsa-util.c: Set buffer size first (to 4408 samples), period size second (to 1102 samples).
 I: [pulseaudio] alsa-sink.c: Successfully opened device front:3.
 I: [pulseaudio] alsa-sink.c: Selected mapping 'Analog Stereo' (analog-stereo).
+I: [pulseaudio] alsa-sink.c: Cannot enable timer-based scheduling, falling back to sound IRQ scheduling.
 I: [pulseaudio] alsa-sink.c: Successfully enabled mmap() mode.
-I: [pulseaudio] alsa-sink.c: Successfully enabled timer-based scheduling mode.
 I: [pulseaudio] (alsa-lib)control.c: Invalid CTL front:3
 I: [pulseaudio] alsa-util.c: Unable to attach to mixer front:3: No such file or directory
 I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:3'
@@ -1055,9 +1173,9 @@
 I: [pulseaudio] sink.c:     device.product.name = "Plantronics .Audio 648 USB"
 I: [pulseaudio] sink.c:     device.serial = "Plantronics_Plantronics_.Audio_648_USB"
 I: [pulseaudio] sink.c:     device.string = "front:3"
-I: [pulseaudio] sink.c:     device.buffering.buffer_size = "352800"
-I: [pulseaudio] sink.c:     device.buffering.fragment_size = "176400"
-I: [pulseaudio] sink.c:     device.access_mode = "mmap+timer"
+I: [pulseaudio] sink.c:     device.buffering.buffer_size = "17632"
+I: [pulseaudio] sink.c:     device.buffering.fragment_size = "4408"
+I: [pulseaudio] sink.c:     device.access_mode = "mmap"
 I: [pulseaudio] sink.c:     device.profile.name = "analog-stereo"
 I: [pulseaudio] sink.c:     device.profile.description = "Analog Stereo"
 I: [pulseaudio] sink.c:     device.description = "Plantronics .Audio 648 USB Analog Stereo"
@@ -1085,16 +1203,16 @@
 I: [pulseaudio] source.c:     device.string = "3"
 I: [pulseaudio] source.c:     module-udev-detect.discovered = "1"
 I: [pulseaudio] source.c:     device.icon_name = "audio-card-usb"
-I: [pulseaudio] alsa-sink.c: Using 2.0 fragments of size 176400 bytes (1000.00ms), buffer size is 352800 bytes (2000.00ms)
-I: [pulseaudio] alsa-sink.c: Time scheduling watermark is 20.00ms
+I: [pulseaudio] alsa-sink.c: Using 4.0 fragments of size 4408 bytes (24.99ms), buffer size is 17632 bytes (99.95ms)
 D: [pulseaudio] alsa-sink.c: hwbuf_unused=0
-D: [pulseaudio] alsa-sink.c: setting avail_min=87319
+D: [pulseaudio] alsa-sink.c: setting avail_min=1



Also, theres this difference in realtime prio:

-D: [alsa-sink] alsa-sink.c: Thread starting up
-I: [alsa-sink] core-util.c: Failed to acquire real-time scheduling: Permission denied
-I: [alsa-sink] alsa-sink.c: Starting playback.
-D: [alsa-sink] alsa-sink.c: Cutting sleep time for the initial iterations by half.
-D: [alsa-sink] alsa-sink.c: Cutting sleep time for the initial iterations by half.
+D: [pulseaudio] alsa-sink.c: Read hardware volume: front-left: 34131 /  52% / -17.00 dB,   front-right: 34131 /  52% / -17.00 dB
+D: [alsa-sink-USB Audio] alsa-sink.c: Thread starting up
+D: [alsa-sink-USB Audio] core-util.c: RealtimeKit worked.
+I: [alsa-sink-USB Audio] core-util.c: Successfully enabled SCHED_RR scheduling for thread, with priority 5.
+I: [alsa-sink-USB Audio] alsa-sink.c: Starting playback.

Comment 1 David Mansfield 2014-11-13 17:25:22 UTC
Created attachment 957235 [details]
log of running with PA 5.0 version from Fedora 20

Comment 2 Rex Dieter 2014-11-13 17:43:29 UTC
Probably best if you reported this upstream to bugzilla.freedesktop.org against pulseaudio component there.

Comment 3 Fedora End Of Life 2015-05-29 13:17:45 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Jan Kurik 2015-07-15 14:36:40 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23

Comment 5 Fedora Update System 2016-05-06 15:50:26 UTC
pulseaudio-7.1-1.fc23.1 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-66b78d4812

Comment 6 Fedora Update System 2016-05-07 16:55:46 UTC
pulseaudio-7.1-1.fc23.1 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-66b78d4812

Comment 7 Fedora Update System 2016-05-12 07:29:06 UTC
pulseaudio-7.1-1.fc23.1 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.