OpenAL Software Silent/Freezes

Bug #1562208 reported by Lampros Liontos
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Following an update I made this week to the system, I have attempted to play a number of games, including "X Rebirth" from gog.com, "Minecraft," downloaded from Mojang. In those games making use of the OpenAL library, no sound is coming through PulseAudio; there is a stream listed in Pulse, but there is no sound, and the meter does not indicate that PulseAudio is even receiving any audio. I am also noticing the problem in Blender, but in this case, the issue seems to cause the VSE to stick to the frame it's at when set to "A/V Sync"

To make matters worse, once the stream shows in "pavucontrol," the program won't end. If the audio is integral to the software, such as the case of Blender, the software itself will freeze when I attempt to close it; I will have to kill the program to make it shut down completely. Other programs that use a sound server with OpenAL seem to close, but the stream is still showing in pavucontrol, and the process is still shown as running in "ps x". Killing the frozen app makes it go away; and so far, the normal kill command will work; there's no need to "-9" it.

Even openal-info freezes, after displaying the following:

-----------------------

Available playback devices:
    CM106 Like Sound Device Analog Stereo
Available capture devices:
    M-Audio Fast Track MKII Analog Stereo
    Monitor of CM106 Like Sound Device Analog Stereo
Default playback device: CM106 Like Sound Device Analog Stereo
Default capture device: CM106 Like Sound Device Analog Stereo
ALC version: 1.1

** Info for device "CM106 Like Sound Device Analog Stereo" **
ALC version: 1.1
ALC extensions:
    ALC_ENUMERATE_ALL_EXT, ALC_ENUMERATION_EXT, ALC_EXT_CAPTURE,
    ALC_EXT_DEDICATED, ALC_EXT_disconnect, ALC_EXT_EFX,
    ALC_EXT_thread_local_context, ALC_SOFTX_device_clock, ALC_SOFTX_HRTF,
    ALC_SOFT_loopback, ALC_SOFTX_midi_interface, ALC_SOFT_pause_device
OpenAL vendor string: OpenAL Community
OpenAL renderer string: OpenAL Soft
OpenAL version string: 1.1 ALSOFT 1.16.0
OpenAL extensions:
    AL_EXT_ALAW, AL_EXT_DOUBLE, AL_EXT_EXPONENT_DISTANCE, AL_EXT_FLOAT32,
    AL_EXT_IMA4, AL_EXT_LINEAR_DISTANCE, AL_EXT_MCFORMATS, AL_EXT_MULAW,
    AL_EXT_MULAW_MCFORMATS, AL_EXT_OFFSET, AL_EXT_source_distance_model,
    AL_LOKI_quadriphonic, AL_SOFT_block_alignment, AL_SOFT_buffer_samples,
    AL_SOFT_buffer_sub_data, AL_SOFT_deferred_updates, AL_SOFT_direct_channels,
    AL_SOFT_loop_points, AL_SOFT_MSADPCM, AL_SOFT_source_latency,
    AL_SOFT_source_length
EFX version: 1.0
Max auxiliary sends: 4
Supported filters:
    Low-pass, High-pass, Band-pass
Supported effects:
    EAX Reverb, Reverb, Chorus, Distortion, Echo, Flanger, Ring Modulator,
    Compressor, Equalizer, Dedicated Dialog, Dedicated LFE

-------------------

This problem persisted, even following a clean installation with no PPAs installed. I'm assuming the problem is in OpenAL, because programs not making use of that library (YouTube, VLC, etc.) don't seem to have the problem. The update that seemed to be the breaking point was an update to kernel 4.2.0-34 (I no longer have the original system, thinking a full restore would fix things), so there might be something in the new kernel that's interfering with OpenAL.

-------------------

The required information:

Description: Ubuntu 15.10
Release: 15.10

libopenal1:
  Installed: 1:1.16.0-3
  Candidate: 1:1.16.0-3
  Version table:
 *** 1:1.16.0-3 0
        500 http://us.archive.ubuntu.com/ubuntu/ wily/universe amd64 Packages
        100 /var/lib/dpkg/status

-------------------

Please let me know if there's any additional information that I will need to provide.

tags: added: pulseaudio
Revision history for this message
Lampros Liontos (reteo-varala) wrote :
Revision history for this message
Lampros Liontos (reteo-varala) wrote :

I've added an attachment with a backtrace from the moment Blender locks when I try and shut it down.

Revision history for this message
Lampros Liontos (reteo-varala) wrote :

The program does shut down if I kill the PulseAudio server, so it might be in Pulse.

Revision history for this message
Lampros Liontos (reteo-varala) wrote :

I figured out how to get a debug log for PulseAudio, so I've added it here.

Revision history for this message
Lampros Liontos (reteo-varala) wrote :
Revision history for this message
Raymond (superquad-vortex2) wrote :

( 5.156| 0.000) I: [pulseaudio] alsa-util.c: Disabling tsched mode since BATCH flag is set
( 5.156| 0.000) D: [pulseaudio] alsa-util.c: Maximum hw buffer size is 1981 ms
( 5.158| 0.001) I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_PREPARE failed (-32)

Revision history for this message
Raymond (superquad-vortex2) wrote :

You have to post output of alsa-info.sh

Which card is your default sink?

Seem fail with surround21 but does your card suppport multichannel?

Changed in pulseaudio (Ubuntu):
status: New → Incomplete
Revision history for this message
Lampros Liontos (reteo-varala) wrote :

Here's the alsa-info.sh output.

Revision history for this message
Lampros Liontos (reteo-varala) wrote :

The speaker device, "CM106 Like Sound Device," supports 7.1 surround audio, while the "Clear Chat Comfort USB Headset" is stereo. I will change between the two of these depending on which output I want (using the headset when recording a screencast). I only use the M Audio fast track as a microphone source. All the other inputs and outputs are turned off in the configuration, as I don't use them, except for the M-Audio, which I use with Jack.

Revision history for this message
Lampros Liontos (reteo-varala) wrote :

For clarification, the issue persists with both devices.

Revision history for this message
Raymond (superquad-vortex2) wrote :

Check your system log, seem kernel oops

- [26825.955291] WARNING: CPU: 0 PID: 16771 at /build/linux-_Kv5oI/linux-4.2.0/fs/block_dev.c:57 __blkdev_put+0xbd/0x280()
[26825.955293] Modules linked in: nls_iso8859_1 uas usb_storage binfmt_misc ax88179_178a usbnet uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common snd_hda_codec_via snd_hda_codec_hdmi snd_hda_codec_generic snd_usb_audio snd_hda_intel snd_hda_codec videodev joydev media snd_usbmidi_lib snd_hda_core snd_hwdep snd_pcm input_leds snd_seq_midi snd_seq_midi_event kvm_amd snd_rawmidi kvm nvidia(POE) edac_core snd_seq snd_seq_device snd_timer edac_mce_amd snd drm serio_raw k10temp asus_atk0110 soundcore 8250_fintek shpchp i2c_piix4 wmi mac_hid parport_pc ppdev lp parport autofs4 hid_generic usbhid hid pata_acpi psmouse pata_atiixp ahci r8169 libahci mii
[26825.955347] CPU: 0 PID: 16771 Comm: pool Tainted: P OE 4.2.0-34-lowlatency #39-Ubuntu

Revision history for this message
Raymond (superquad-vortex2) wrote :

| 0.000) W: [pulseaudio] alsa-mixer.c: Volume element Speaker has 8 channels. That's too much! I can't handle that! ( 5.131| 0.000) D: [pulseaudio] alsa-mixer.c: Probe of element 'Speaker' failed.

Pulseaudio not support volume control with more than two channels

Card hw:4 'Device'/'USB Sound Device at usb-0000:00:12.2-3.3.3, full speed' Mixer name : 'USB Mixer' Components : 'USB0d8c:0102' Controls : 16 Simple ctrls : 6 Simple mixer control 'Speaker',0 Capabilities: pvolume pswitch pswitch-joined Playback channels: Front Left - Front Right - Rear Left - Rear Right - Front Center - Woofer - Side Left - Side Right Limits: Playback 0 - 197 Mono: Front Left: Playback 197 [100%] [0.00dB] [on] Front Right: Playback 197 [100%] [0.00dB] [on] Rear Left: Playback 197 [100%] [0.00dB] [on] Rear Right: Playback 197 [100%] [0.00dB] [on] Front Center: Playback 197 [100%] [0.00dB] [on] Woofer: Playback 197 [100%] [0.00dB] [on] Side Left: Playback 197 [100%] [0.00dB] [on] Side Right: Playback 197 [100%] [0.00dB] [on]

Revision history for this message
Raymond (superquad-vortex2) wrote :

5.039| 0.000) D: [pulseaudio] alsa-util.c: Managed to open hw:5 ( 5.039| 0.000) I: [pulseaudio] alsa-util.c: Disabling tsched mode since BATCH flag is set ( 5.039| 0.000) D: [pulseaudio] alsa-util.c: Maximum hw buffer size is 11888 ms ( 5.041| 0.001) D: [pulseaudio] alsa-util.c: Set buffer size first (to 4408 samples), period size second (to 1102 samples). ( 5.042| 0.000) D: [pulseaudio] alsa-mixer.c: Profile output:analog-stereo+input:analog-mono supported. ( 5.042| 0.000) D: [pulseaudio] alsa-mixer.c: Skipping profile output:analog-stereo+input:analog-stereo - will not be able to open input:analog-stereo ( 5.042| 0.000) D: [pulseaudio] alsa-mixer.c: Skipping profile output:analog-stereo+input:iec958-stereo - will not be able to open input:iec958-stereo ( 5.059| 0.016) D: [pulseaudio] alsa-mixer.c: Looking at profile output:analog-surround-21 ( 5.059| 0.000) D: [pulseaudio] alsa-mixer.c: Checking for playback on Analog Surround 2.1 (analog-surround-21) ( 5.059| 0.000) D: [pulseaudio] alsa-util.c: Trying surround21:5 with SND_PCM_NO_AUTO_FORMAT ... ( 5.060| 0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c: Invalid PCM state for chmap_get: OPEN

Different error on your different usb audio device, seem no channel map

Revision history for this message
Raymond (superquad-vortex2) wrote :

If your card 2 only support stereo, it is strange that surround21 can be opened

155| 0.000) D: [pulseaudio] alsa-mixer.c: Checking for playback on Analog Surround 2.1 (analog-surround-21) ( 5.155| 0.000) D: [pulseaudio] alsa-util.c: Trying surround21:2 with SND_PCM_NO_AUTO_FORMAT ... ( 5.156| 0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c: Invalid PCM state for chmap_get: OPEN ( 5.156| 0.000) D: [pulseaudio] alsa-util.c: Managed to open surround21:2 ( 5.156| 0.000) I: [pulseaudio] alsa-util.c: Disabling tsched mode since BATCH flag is set ( 5.156| 0.000) D: [pulseaudio] alsa-util.c: Maximum hw buffer size is 1981 ms ( 5.158| 0.001) I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_PREPARE failed (-32

Revision history for this message
Raymond (superquad-vortex2) wrote :

The major problem is why you override pcm.default with dmix whenn you running pulseaudio

!!User specific config file (~/.asoundrc)

 pcm.!default { type plug slave { pcm "dmix:Device" } }

Revision history for this message
Lampros Liontos (reteo-varala) wrote :

"If your card 2 only support stereo, it is strange that surround21 can be opened"

Maybe, maybe not; the assertion that the device is stereo is based on the fact that it's a headset and has two obvious speakers. Whether it has some kind of subwoofer-style audio channel is not something I'm certain about.

For clarification on the devices being referenced:
* Details on the headset can be found here: http://support.logitech.com/en_us/product/stereo-headset-h390
* Details on the desktop audio device (specifically named "Device")can be found here: https://www.sabrent.com/category/audio/USB-SND8/

"The major problem is why you override pcm.default with dmix whenn you running pulseaudio"

I'm not sure if this is a question or not, but I'll assume it is.

The .asoundrc was originally set to use the pulse plug, rather than dmix. However, when the problem first began, I had to turn off PulseAudio in order to get sound at all for most of the programs I'm running. However, the audio device used by default in ALSA is the built-in audio in the desktop, which I do not use; the USB devices listed above are cleaner and clearer. I also didn't want to have programs lock up while waiting for access to the audio device. Therefore, I changed the audio default, first to Jack (hence the stanzas with Jack on them), and then I decided it would just be better to use the dmix device until the problem could be solved. This way, I can still make use of everything on the system, even if screencasts remain impossible.

Revision history for this message
Lampros Liontos (reteo-varala) wrote :

More information about the issue can be found here: https://github.com/kcat/openal-soft/issues/34

I don't know what can affect the prebuf value, but hopefully, something can be figured out. And the log above was using 1.16; I tried 1.17.2 after submitting this report.

Revision history for this message
Raymond (superquad-vortex2) wrote :
Revision history for this message
Raymond (superquad-vortex2) wrote :
Revision history for this message
Raymond (superquad-vortex2) wrote :
Download full text (3.2 KiB)

Your usb audio are using about 25ms period time with 4 periods

) I: [pulseaudio] source.c: device.vendor.id = "0d8c" ( 5.364| 0.000) I: [pulseaudio] source.c: device.vendor.name = "C-Media Electronics, Inc." ( 5.364| 0.000) I: [pulseaudio] source.c: device.product.id = "0102" ( 5.364| 0.000) I: [pulseaudio] source.c: device.product.name = "CM106 Like Sound Device" ( 5.364| 0.000) I: [pulseaudio] source.c: device.serial = "0d8c_USB_Sound_Device" ( 5.364| 0.000) I: [pulseaudio] source.c: device.string = "2" ( 5.364| 0.000) I: [pulseaudio] source.c: module-udev-detect.discovered = "1" ( 5.364| 0.000) I: [pulseaudio] source.c: device.icon_name = "audio-card-usb" ( 5.364| 0.000) I: [pulseaudio] alsa-sink.c: Using 4.0 fragments of size 4408 bytes (24.99ms), buffer size is 17632 bytes (99.95ms) ( 5.364| 0.000) D: [pulseaudio] alsa-sink.c: hwbuf_unused=0 ( 5.364| 0.000) D: [pulseaudio] alsa-sink.c: setting avail_min=1 ( 5.364| 0.000) D: [pulseaudio] alsa-mixer.c: Activating path analog-output ( 5.364| 0.000) D: [pulseaudio] alsa-mixer.c: Path analog-output (Analog Output), direction=1, priority=99, probed=yes, supported=yes, has_mute=no, has_volume=no, has_dB=no, min_volume=0, max_volume=0, min_dB=inf, max_dB=-inf ( 5.364| 0.000) I: [pulseaudio] alsa-sink.c: Driver does not support hardware volume control, falling back to software volume control. ( 5.364| 0.000) I: [pulseaudio] alsa-sink.c: Driver does not support hardware mute control, falling back to software mute control. ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: snd_pcm_dump(): ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: Hardware PCM card 2 'USB Sound Device' device 0 subdevice 0 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: Its setup is: ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: stream : PLAYBACK ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: access : MMAP_INTERLEAVED ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: format : S16_LE ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: subformat : STD ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: channels : 2 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: rate : 44100 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: exact rate : 44100 (44100/1) ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: msbits : 16 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: buffer_size : 4408 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: period_size : 1102 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: period_time : 24988 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: tstamp_mode : ENABLE ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: tstamp_type : MONOTONIC ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: period_step : 1 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: avail_min : 1102 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: period_event : 1 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: start_threshold : -1 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: stop_threshold : 4962966789362286592 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: silence_threshold: 0 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: silence_size : 0 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: boundary : 4962966789362286592 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: appl_ptr : 0 ( 5.364| 0.000) D: [pulseaudio] alsa-util.c: hw_ptr : 0 ...

Read more...

Revision history for this message
Raymond (superquad-vortex2) wrote :

Try specify period time to multiple of 10ms since you are using 44100Hz

Revision history for this message
Raymond (superquad-vortex2) wrote :

Blender request 15ms but your usb use period time 24.998 ms

0) I: [pulseaudio] sink-input.c: application.process.binary = "blender" ( 6.034| 0.000) I: [pulseaudio] sink-input.c: application.language = "C" ( 6.034| 0.000) I: [pulseaudio] sink-input.c: window.x11.display = ":0.0" ( 6.034| 0.000) I: [pulseaudio] sink-input.c: application.process.machine_id = "135d836b29434d8cbea95fc6909f7fcc" ( 6.034| 0.000) I: [pulseaudio] sink-input.c: application.process.session_id = "c2" ( 6.034| 0.000) I: [pulseaudio] sink-input.c: application.icon_name = "blender" ( 6.034| 0.000) I: [pulseaudio] sink-input.c: module-stream-restore.id = "sink-input-by-application-name:Blender" ( 6.035| 0.000) I: [pulseaudio] protocol-native.c: Requested tlength=60.00 ms, minreq=14.99 ms ( 6.035| 0.000) D: [pulseaudio] protocol-native.c: Adjust latency mode enabled, configuring sink latency to half of overall latency. ( 6.035| 0.000) D: [pulseaudio] protocol-native.c: Requested latency=15.01 ms, Received latency=99.95 ms ( 6.035| 0.000) D: [pulseaudio] memblockq.c: memblockq requested: maxlength=4194304, tlength=45840, base=8, prebuf=40560, minreq=5288 maxrewind=0 ( 6.035| 0.000) D: [pulseaudio] memblockq.c: memblockq sanitized: maxlength=4194304, tlength=45840, base=8, prebuf=40560, minreq=5288 maxrewind=0 ( 6.035| 0.000) I: [pulseaudio] protocol-native.c: Final latency 229.88 ms = 99.95 ms + 2*14.99 ms + 99.95

Revision history for this message
Lampros Liontos (reteo-varala) wrote :

It's probably something basic, but I'm not sure... how do I change period sizes?

Revision history for this message
Raymond (superquad-vortex2) wrote :
Revision history for this message
Lampros Liontos (reteo-varala) wrote :

Okay, looks like that fixed. the problem. Thanks for your help!

Just out of curiosity, what was happening that was causing that problem in the first place? Was it adding 24ms fragments to the buffer to reach a multiple of 10? And why did 44100 HMz need 10ms multiples? What would it need to be for 48000 (the device connected to the microphone)?

Revision history for this message
Raymond (superquad-vortex2) wrote :

Which values do you use to fix the problem?

Blender require 60ms but your usb are configured at 100ms

Revision history for this message
Lampros Liontos (reteo-varala) wrote :

I changed the following:

default-fragment-size-msec = 10

Revision history for this message
Lampros Liontos (reteo-varala) wrote :

Was there something else I needed to clarify? According to the developer of OpenAL (from what I understand), the PulseAudio stream keeps its existing buffer, even though OpenAL sets it to 0 for manual starting control. I was just wondering what might have been causing this.

Revision history for this message
Bret Curtis (psi29a) wrote :

Not an OpenAL-Soft issue, but a Pulseaudio one.

affects: openal-soft (Ubuntu) → ubuntu
Revision history for this message
Lampros Liontos (reteo-varala) wrote :

Looks like it is a PulseAudio issue; the problem was resolved when I reverted PulseAudio to interrupt-driven scheduling (tsched=0). Since this isn't the default state of Pulseaudio on new systems, however, this is more likely a workaround than a solution.

Whether the problem is that a new scheduling system requires new interfaces, or if the problem is entirely in PulseAudio's implementation, I honestly don't know.

Revision history for this message
Lampros Liontos (reteo-varala) wrote :

Scratch that; an unrelated issue was resolved, but not this one. Programs making use of OpenAL are still not making any sound, and still freezing upon close.

Revision history for this message
Lampros Liontos (reteo-varala) wrote :

Nope. Apparently, the issue is with either with PulseAudio or SDL... or possibly both. SDL 1.2 does the locking thing when using timer-driven scheduling, while SDL 2.0 does it when using interrupt-driven scheduling. I've already submitted a ticket for SDL, so this should probably focus on the PulseAudio side of the issue, in case it's specifically a bug in PA.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thank you for reporting this bug to Ubuntu.
Ubuntu 15.10 (wily) reached end-of-life on July 28, 2016.

See this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

We appreciate that this bug may be old and you might not be interested in discussing it any more. But if you are then please upgrade to the latest Ubuntu version and re-test.

no longer affects: ubuntu
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for pulseaudio (Ubuntu) because there has been no activity for 60 days.]

Changed in pulseaudio (Ubuntu):
status: Incomplete → Expired
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.