You are not logged in.

#1 2020-05-12 15:48:03

crashman
Member
Registered: 2020-05-12
Posts: 1

Pulseaudio/Alsa Underflow Problem in vlc

Hey Guys,
for a few day I got some underflow errors in vlc using Pulseaudio/Alsa. This problem occours when fast forwarding music or videos, especially clicking fast on that bar (buffering problem?) I got NO PROBLEMS so far at watching videos on YouTube or playing games. Maybe my previously virtio configured virtual machine with qemu/kvm caused this problem because configs got messed up in alsa or pa?
I am using a Ryzen 3600 CPU on on MSI B450 which has Realtek ALC892 Soundchip.

With the following debug output of vlc without using jack sink:

...
main debug: Received first picture
main debug: Decoder wait done in 389 ms
pulse debug: cannot synchronize start
pulse debug: deferring start (33004 us)
pulse debug: deferring start (9977 us)
pulse warning: starting late (-13507 us)
pulse debug: changing sink 0: alsa_output.pci-0000_28_00.4.analog-stereo (Starship/Matisse HD Audio Controller Analog Stereo)
pulse debug: started
pulse debug: underflow
pulse debug: underflow
...

Besides this candidates I've installed jack2 (using with cadence - without any bridge), which jack sink works great like the debug output here with jack running:

...
main debug: Received first picture
main debug: Buffering 16%
main debug: Buffering 32%
main debug: end of audio preroll
pulse debug: changing sink 2: jack_out (Jack sink (PulseAudio JACK Sink))
main debug: Buffering 47%
main debug: Buffering 63%
main debug: Buffering 79%
main debug: Buffering 95%
main debug: Stream buffering done (1762 ms in 54 ms)
...

When starting 'pulseaudio' from terminal without using jack (which causes the problem I have) I got the errors below:

E: [alsa-sink-ALC892 Analog] alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write!
E: [alsa-sink-ALC892 Analog] alsa-sink.c: Most likely this is a bug in the ALSA driver 'snd_hda_intel'. Please report this issue to the ALSA developers.
E: [alsa-sink-ALC892 Analog] alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.

'cat /proc/asound/cards' gives me:

 0 [A900           ]: USB-Audio - Anua Mic CM 900
                      Anua Mic CM 900 Anua Mic CM 900 at usb-0000:03:00.0-9, full speed
 1 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xf7080000 irq 55
 2 [Generic        ]: HDA-Intel - HD-Audio Generic
                      HD-Audio Generic at 0xf7400000 irq 57

And I am using the following config placed in '/etc/pulse/daemon.conf':

; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; enable-memfd = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no

; high-priority = yes
; nice-level = -11

; realtime-scheduling = yes
; realtime-priority = 5
; exit-idle-time = 20
; scache-idle-time = 20

; dl-search-path = (depends on architecture)

; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa

; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0

; resample-method = src-sinc-best-quality
#resample-method = speex-float-3
; avoid-resampling = false
; enable-remixing = yes
; remixing-use-all-sink-channels = yes
; enable-lfe-remixing = no
; lfe-crossover-freq = 0

flat-volumes = no
; flat-volumes = yes

; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 200000

; default-sample-format = float32le
; default-sample-rate = 48000
; alternate-sample-rate = 48000
; default-sample-channels = 2
; default-channel-map = front-left,front-right

#; default-fragments = 4
#; default-fragment-size-msec = 25
; default-fragments = 3
; default-fragment-size-msec = 5

; enable-deferred-volume = yes
; deferred-volume-safety-margin-usec = 8000
; deferred-volume-extra-delay-usec = 0

and my '/etc/pulse/default.pa' is filled with:

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif
### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

### Load several protocols
load-module module-dbus-protocol
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif


### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

### Make some devices default
#set-default-sink output alsa_output.pci-0000_28_00.4.analog-stereo
#set-default-source input

Maybe you're also interested into looking at my 'aplay -l':

Karte 1: NVidia [HDA NVidia], Gerät 3: HDMI 0 [HDMI 0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 7: HDMI 1 [HDMI 1]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 8: HDMI 2 [HDMI 2]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 9: HDMI 3 [HDMI 3]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 10: HDMI 4 [HDMI 4]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 11: HDMI 5 [HDMI 5]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 12: HDMI 6 [HDMI 6]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 2: Generic [HD-Audio Generic], Gerät 0: ALC892 Analog [ALC892 Analog]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0

and my 'arecord -l':

Karte 0: A900 [Anua Mic CM 900], Gerät 0: USB Audio [USB Audio]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 2: Generic [HD-Audio Generic], Gerät 0: ALC892 Analog [ALC892 Analog]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 2: Generic [HD-Audio Generic], Gerät 2: ALC892 Alt Analog [ALC892 Alt Analog]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0

My '/etc/asound.conf' should be default with:

# Use PulseAudio by default
pcm.!default {
  type pulse
  fallback "sysdefault"
  hint {
    show on
    description "Default ALSA Output (currently PulseAudio Sound Server)"
  }
}

ctl.!default {
  type pulse
  fallback "sysdefault"
}

# vim:set ft=alsaconf:

I've tried a lot like uninstalling jack2, cadence and all these jack based stuff, changing the pa config with sample and/or bit values but never got rid of this laggy sound on VLC Player. Also tried another mediaplayers but it did also not work properly. I also recognized this ALSA errors when switching volume on VLC. Does anyone of you have any idea why JACK sink works perfect but not the ALSA/PA setting? Sitting here for hours fixing it but now I am out..

Additionally I want to give you my '/etc/modprobe.d/sound.conf' filled with:

options snd-hda-intel vid=8086 pid=8ca0 snoop=0

'pacmd list-cards' says:

3 card(s) available.
    index: 0
        name: <alsa_card.usb-Anua_Mic_CM_900_Anua_Mic_CM_900-00>
        driver: <module-alsa-card.c>
        owner module: 6
        properties:
                alsa.card = "0"
                alsa.card_name = "Anua Mic CM 900"
                alsa.long_card_name = "Anua Mic CM 900 Anua Mic CM 900 at usb-0000:03:00.0-9, full speed"
                alsa.driver_name = "snd_usb_audio"
                device.bus_path = "pci-0000:03:00.0-usb-0:9:1.0"
                sysfs.path = "/devices/pci0000:00/0000:00:01.3/0000:03:00.0/usb1/1-9/1-9:1.0/sound/card0"
                udev.id = "usb-Anua_Mic_CM_900_Anua_Mic_CM_900-00"
                device.bus = "usb"
                device.vendor.id = "0d8c"
                device.vendor.name = "C-Media Electronics, Inc."
                device.product.id = "0134"
                device.product.name = "Anua Mic CM 900"
                device.serial = "Anua_Mic_CM_900_Anua_Mic_CM_900"
                device.string = "0"
                device.description = "Anua Mic CM 900"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-usb"
        profiles:
                input:mono-fallback: Mono-Eingabe (priority 1, available: unknown)
                input:multichannel-input: Mehrkanal-Eingabe (priority 1, available: unknown)
                off: Aus (priority 0, available: unknown)
        active profile: <input:mono-fallback>
        sources:
                alsa_input.usb-Anua_Mic_CM_900_Anua_Mic_CM_900-00.mono-fallback/#0: Anua Mic CM 900 Mono
        ports:
                analog-input-mic: Mikrofon (priority 8700, latency offset 0 usec, available: unknown)
                        properties:
                                device.icon_name = "audio-input-microphone"
                multichannel-input: Mehrkanaleingang (priority 0, latency offset 0 usec, available: unknown)
                        properties:

    index: 1
        name: <alsa_card.pci-0000_26_00.1>
        driver: <module-alsa-card.c>
        owner module: 7
        properties:
                alsa.card = "1"
                alsa.card_name = "HDA NVidia"
                alsa.long_card_name = "HDA NVidia at 0xf7080000 irq 55"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:26:00.1"
                sysfs.path = "/devices/pci0000:00/0000:00:03.1/0000:26:00.1/sound/card1"
                device.bus = "pci"
                device.vendor.id = "10de"
                device.vendor.name = "NVIDIA Corporation"
                device.product.id = "0e0a"
                device.product.name = "GK104 HDMI Audio Controller"
                device.string = "1"
                device.description = "GK104 HDMI Audio Controller"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        profiles:
                output:hdmi-stereo: Digital Stereo (HDMI)-Ausgabe (priority 5900, available: no)
                output:hdmi-surround: Digital Surround 5.1 (HDMI)-Ausgabe (priority 800, available: no)
                output:hdmi-surround71: Digital Surround 7.1 (HDMI)-Ausgabe (priority 800, available: no)
                output:hdmi-stereo-extra1: Digital Stereo (HDMI 2)-Ausgabe (priority 5700, available: no)
                output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2)-Ausgabe (priority 600, available: no)
                output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2)-Ausgabe (priority 600, available: no)
                output:hdmi-stereo-extra2: Digital Stereo (HDMI 3)-Ausgabe (priority 5700, available: no)
                output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3)-Ausgabe (priority 600, available: no)
                output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3)-Ausgabe (priority 600, available: no)
                output:hdmi-stereo-extra3: Digital Stereo (HDMI 4)-Ausgabe (priority 5700, available: no)
                output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4)-Ausgabe (priority 600, available: no)
                output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4)-Ausgabe (priority 600, available: no)
                output:hdmi-stereo-extra4: Digital Stereo (HDMI 5)-Ausgabe (priority 5700, available: no)
                output:hdmi-surround-extra4: Digital Surround 5.1 (HDMI 5)-Ausgabe (priority 600, available: no)
                output:hdmi-surround71-extra4: Digital Surround 7.1 (HDMI 5)-Ausgabe (priority 600, available: no)
                output:hdmi-stereo-extra5: Digital Stereo (HDMI 6)-Ausgabe (priority 5700, available: no)
                output:hdmi-surround-extra5: Digital Surround 5.1 (HDMI 6)-Ausgabe (priority 600, available: no)
                output:hdmi-surround71-extra5: Digital Surround 7.1 (HDMI 6)-Ausgabe (priority 600, available: no)
                output:hdmi-stereo-extra6: Digital Stereo (HDMI 7)-Ausgabe (priority 5700, available: no)
                output:hdmi-surround-extra6: Digital Surround 5.1 (HDMI 7)-Ausgabe (priority 600, available: no)
                output:hdmi-surround71-extra6: Digital Surround 7.1 (HDMI 7)-Ausgabe (priority 600, available: no)
                off: Aus (priority 0, available: unknown)
        active profile: <off>
        ports:
                hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)
                        properties:
                                device.icon_name = "video-display"
                hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: no)
                        properties:
                                device.icon_name = "video-display"
                hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: no)
                        properties:
                                device.icon_name = "video-display"
                hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: no)
                        properties:
                                device.icon_name = "video-display"
                hdmi-output-4: HDMI / DisplayPort 5 (priority 5500, latency offset 0 usec, available: no)
                        properties:
                                device.icon_name = "video-display"
                hdmi-output-5: HDMI / DisplayPort 6 (priority 5400, latency offset 0 usec, available: no)
                        properties:
                                device.icon_name = "video-display"
                hdmi-output-6: HDMI / DisplayPort 7 (priority 5300, latency offset 0 usec, available: no)
                        properties:
                                device.icon_name = "video-display"
    index: 2
        name: <alsa_card.pci-0000_28_00.4>
        driver: <module-alsa-card.c>
        owner module: 8
        properties:
                alsa.card = "2"
                alsa.card_name = "HD-Audio Generic"
                alsa.long_card_name = "HD-Audio Generic at 0xf7400000 irq 57"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:28:00.4"
                sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:28:00.4/sound/card2"
                device.bus = "pci"
                device.vendor.id = "1022"
                device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
                device.product.id = "1487"
                device.product.name = "Starship/Matisse HD Audio Controller"
                device.string = "2"
                device.description = "Starship/Matisse HD Audio Controller"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        profiles:
                input:analog-stereo: Analog Stereo-Eingabe (priority 65, available: no)
                output:analog-stereo: Analog Stereo-Ausgabe (priority 6500, available: unknown)
                output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6565, available: no)
                output:analog-surround-21: Analog Surround 2.1-Ausgabe (priority 1300, available: unknown)
                output:analog-surround-21+input:analog-stereo: Analog Surround 2.1-Ausgabe + Analog Stereo-Eingabe (priority 1365, available: no)
                output:analog-surround-40: Analog Surround 4.0-Ausgabe (priority 1200, available: unknown)
                output:analog-surround-40+input:analog-stereo: Analog Surround 4.0-Ausgabe + Analog Stereo-Eingabe (priority 1265, available: no)
                output:analog-surround-41: Analog Surround 4.1-Ausgabe (priority 1300, available: unknown)
                output:analog-surround-41+input:analog-stereo: Analog Surround 4.1-Ausgabe + Analog Stereo-Eingabe (priority 1365, available: no)
                output:analog-surround-50: Analog Surround 5.0-Ausgabe (priority 1200, available: unknown)
                output:analog-surround-50+input:analog-stereo: Analog Surround 5.0-Ausgabe + Analog Stereo-Eingabe (priority 1265, available: no)
                output:analog-surround-51: Analog Surround 5.1-Ausgabe (priority 1300, available: unknown)
                output:analog-surround-51+input:analog-stereo: Analog Surround 5.1-Ausgabe + Analog Stereo-Eingabe (priority 1365, available: no)
                output:analog-surround-71: Analog Surround 7.1-Ausgabe (priority 1200, available: unknown)
                output:analog-surround-71+input:analog-stereo: Analog Surround 7.1-Ausgabe + Analog Stereo-Eingabe (priority 1265, available: no)
                off: Aus (priority 0, available: unknown)
        active profile: <output:analog-stereo>
        sinks:
                alsa_output.pci-0000_28_00.4.analog-stereo/#0: Starship/Matisse HD Audio Controller Analog Stereo
        sources:
                alsa_output.pci-0000_28_00.4.analog-stereo.monitor/#1: Monitor of Starship/Matisse HD Audio Controller Analog Stereo
        ports:
                analog-input-front-mic: Vorderes Mikrofon (priority 8500, latency offset 0 usec, available: no)
                        properties:
                                device.icon_name = "audio-input-microphone"
                analog-input-rear-mic: Rückwärtiges Mikrofon (priority 8200, latency offset 0 usec, available: no)
                        properties:
                                device.icon_name = "audio-input-microphone"
                analog-input-linein: Line-Eingang (priority 8100, latency offset 0 usec, available: no)
                        properties:

                analog-output-lineout: Line-Ausgang (priority 9000, latency offset 0 usec, available: yes)
                        properties:

                analog-output-headphones: Kopfhörer (priority 9900, latency offset 0 usec, available: no)
                        properties:
                                device.icon_name = "audio-headphones"

And my sink devices with 'pacmd list-sinks':

1 sink(s) available.
  * index: 0
        name: <alsa_output.pci-0000_28_00.4.analog-stereo>
        driver: <module-alsa-card.c>
        flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY FLAT_VOLUME 
        state: SUSPENDED
        suspend cause: IDLE
        priority: 9039
        volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB
                balance 0,00
        base volume: 65536 / 100% / 0,00 dB
        volume steps: 65537
        muted: no
        current latency: 0,00 ms
        max request: 0 KiB
        max rewind: 0 KiB
        monitor source: 1
        sample spec: s32le 2ch 44100Hz
        channel map: front-left,front-right
                     Stereo
        used by: 0
        linked by: 0
        fixed latency: 100,14 ms
        card: 2 <alsa_card.pci-0000_28_00.4>
        module: 8
        properties:
                alsa.resolution_bits = "32"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "ALC892 Analog"
                alsa.id = "ALC892 Analog"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "2"
                alsa.card_name = "HD-Audio Generic"
                alsa.long_card_name = "HD-Audio Generic at 0xf7400000 irq 57"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:28:00.4"
                sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:28:00.4/sound/card2"
                device.bus = "pci"
                device.vendor.id = "1022"
                device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
                device.product.id = "1487"
                device.product.name = "Starship/Matisse HD Audio Controller"
                device.string = "front:2"
                device.buffering.buffer_size = "35328"
                device.buffering.fragment_size = "8832"
                device.access_mode = "mmap"
                device.profile.name = "analog-stereo"
                device.profile.description = "Analog Stereo"
                device.description = "Starship/Matisse HD Audio Controller Analog Stereo"
                alsa.mixer_name = "Realtek ALC892"
                alsa.components = "HDA:10ec0892,1462ec02,00100302"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        ports:
                analog-output-lineout: Line-Ausgang (priority 9000, latency offset 0 usec, available: yes)
                        properties:

                analog-output-headphones: Kopfhörer (priority 9900, latency offset 0 usec, available: no)
                        properties:
                                device.icon_name = "audio-headphones"
        active port: <analog-output-lineout>

Tell me, if you need any other information!

Thanks in advance and have a great day!

crashman

Last edited by crashman (2020-05-13 13:43:01)

Offline

Board footer

Powered by FluxBB