You are not logged in.

#1 2020-11-04 09:59:26

krnlpk
Member
Registered: 2010-01-03
Posts: 21

Sound cards randomly disappearing/switching

Hi everyone,
In the last few days the analog outputs on my system started disappearing for no reason (only S/PDIF is shown in PulseAudio usually) from my integrated soundcard on my motherboard (Realtek ALC887-based). The journal shows logs like this:

Nov 03 12:18:36 Canis pulseaudio[4501]: ^[[0;1;39mALSA woke us up to write new data to the device, but there was actually nothing to write.
Nov 03 12:18:36 Canis pulseaudio[4501]: ^[[0;1;39mMost likely this is a bug in the ALSA driver 'snd_hda_intel'. Please report this issue to the ALSA developers.
Nov 03 12:18:36 Canis pulseaudio[4501]: ^[[0;1;39mWe were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.

Afterwards, the following happens:
- any program that I already have open is still able to play audio on the correct soundcard;
- new processes start playing audio on the DisplayPort audio on my main display, even though it's not selected in Pulseaudio.

This morning I also noticed that the analog outputs on the DisplayPort soundcard (AMD RX 580) started randomly disappearing from pulseaudio, with audio still switching to DisplayPort card; what I see is that the analog output of the internal card either disappears (but the audio comes out of the display speakers) or DisplayPort audio replaces the internal one in pulseaudio, even though removing the green jack is sensed and stops playback. Rebooting generally fixes this behaviour.

I also noticed that pipewire was starting randomly so I masked it, and this seems to have partially fixed Pulseaudio not restarting correctly. I also downgraded all ALSA-related packages to 1.2.3 (from 1.2.4) and installed linux-lts, without any significant change.

Windows is fine and audio works correctly both from DisplayPort and the integrated soundcard.

Offline

#2 2020-11-04 12:04:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 11,138

Re: Sound cards randomly disappearing/switching

There was a change in how the jack logic works in the bump to pulse 13.99.3, does downgrading to 13.99.2+22+ga9c6d43b7-1 work?  See https://gitlab.freedesktop.org/pulseaud … ssues/1028 for reference.

Offline

#3 2020-11-04 14:13:37

krnlpk
Member
Registered: 2010-01-03
Posts: 21

Re: Sound cards randomly disappearing/switching

I created /etc/asound.conf in order to force ALSA to default to the integrated soundcard with the following:

defaults.pcm.card 1
defaults.pcm.device 0

The switching issue hasn't showed up yet, but still this is less than ideal (the AMD card still keeps randomly appearing and disappearing from PulseAudio sinks).

Offline

#4 2020-11-04 14:42:37

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 11,138

Re: Sound cards randomly disappearing/switching

That's not a good idea if you intend to use pulseaudio. And it likely explains your general issues. Remove that file and install pulseaudio-alsa so that ALSA using applications are redirected to pulse without blocking access to your card

Offline

#5 2020-11-04 15:54:40

krnlpk
Member
Registered: 2010-01-03
Posts: 21

Re: Sound cards randomly disappearing/switching

V1del wrote:

That's not a good idea if you intend to use pulseaudio. And it likely explains your general issues. Remove that file and install pulseaudio-alsa so that ALSA using applications are redirected to pulse without blocking access to your card

I always used pulseaudio until when it or ALSA started misbehaving (since the last week I believe), I still have it running and I have had pulseaudio-alsa installed for years, without any significant issue.

I created asound.conf as a workaround for my issue this morning and it basically fixed it - the audio does not switch randomly to the DisplayPort output anymore.

Last edited by krnlpk (2020-11-04 15:55:17)

Offline

#6 2020-11-04 15:57:20

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 11,138

Re: Sound cards randomly disappearing/switching

That config should not have any inference, unless you are using an ALSA only application that gets forced to the card and isn't used via pulseaudio because of it. What's your

sudo fuser -v /dev/snd/*
pacmd list-cards
pacmd list-sinks

in this situation?

Last edited by V1del (2020-11-04 16:14:26)

Offline

#7 2020-11-05 08:41:59

krnlpk
Member
Registered: 2010-01-03
Posts: 21

Re: Sound cards randomly disappearing/switching

V1del wrote:

That config should not have any inference, unless you are using an ALSA only application that gets forced to the card and isn't used via pulseaudio because of it. What's your

sudo fuser -v /dev/snd/*
pacmd list-cards
pacmd list-sinks

in this situation?

$  sudo fuser -v /dev/snd/*
                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  marco     22711 F.... pulseaudio
/dev/snd/controlC1:  marco     22711 F.... pulseaudio
/dev/snd/pcmC1D0p:   marco     22711 F...m pulseaudio
/dev/snd/timer:      marco     22711 f.... pulseaudio
$  pacmd list-cards
2 card(s) available.
    index: 0
    name: <alsa_card.pci-0000_09_00.1>
    driver: <module-alsa-card.c>
    owner module: 6
    properties:
        alsa.card = "0"
        alsa.card_name = "HDA ATI HDMI"
        alsa.long_card_name = "HDA ATI HDMI at 0xfce60000 irq 61"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:09:00.1"
        sysfs.path = "/devices/pci0000:00/0000:00:03.1/0000:09:00.1/sound/card0"
        device.bus = "pci"
        device.vendor.id = "1002"
        device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
        device.product.id = "aaf0"
        device.product.name = "Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]"
        device.string = "0"
        device.description = "Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    profiles:
        output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5900, available: no)
        output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (priority 800, available: no)
        output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (priority 800, available: no)
        output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 5700, available: no)
        output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (priority 600, available: no)
        output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (priority 600, available: no)
        output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (priority 5700, available: no)
        output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (priority 600, available: no)
        output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (priority 600, available: no)
        output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (priority 5700, available: no)
        output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (priority 600, available: no)
        output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) Output (priority 600, available: no)
        output:hdmi-stereo-extra4: Digital Stereo (HDMI 5) Output (priority 5700, available: no)
        output:hdmi-surround-extra4: Digital Surround 5.1 (HDMI 5) Output (priority 600, available: no)
        output:hdmi-surround71-extra4: Digital Surround 7.1 (HDMI 5) Output (priority 600, available: no)
        output:hdmi-stereo-extra5: Digital Stereo (HDMI 6) Output (priority 5700, available: unknown)
        off: Off (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: yes)
            properties:
                device.icon_name = "video-display"
                device.product.name = "2460G5"
    index: 1
    name: <alsa_card.pci-0000_0b_00.3>
    driver: <module-alsa-card.c>
    owner module: 7
    properties:
        alsa.card = "1"
        alsa.card_name = "HD-Audio Generic"
        alsa.long_card_name = "HD-Audio Generic at 0xfcd00000 irq 63"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:0b:00.3"
        sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:0b:00.3/sound/card1"
        device.bus = "pci"
        device.vendor.id = "1022"
        device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
        device.product.id = "1457"
        device.product.name = "Family 17h (Models 00h-0fh) HD Audio Controller"
        device.string = "1"
        device.description = "Family 17h (Models 00h-0fh) HD Audio Controller"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    profiles:
        input:analog-stereo: Analog Stereo Input (priority 65, available: unknown)
        output:analog-stereo: Analog Stereo Output (priority 6500, available: unknown)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6565, available: unknown)
        output:iec958-stereo: Digital Stereo (IEC958) Output (priority 5500, available: unknown)
        output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (priority 5565, available: unknown)
        off: Off (priority 0, available: unknown)
    active profile: <output:analog-stereo+input:analog-stereo>
    sinks:
        alsa_output.pci-0000_0b_00.3.analog-stereo/#0: Family 17h (Models 00h-0fh) HD Audio Controller Analog Stereo
    sources:
        alsa_output.pci-0000_0b_00.3.analog-stereo.monitor/#0: Monitor of Family 17h (Models 00h-0fh) HD Audio Controller Analog Stereo
        alsa_input.pci-0000_0b_00.3.analog-stereo/#1: Family 17h (Models 00h-0fh) HD Audio Controller Analog Stereo
    ports:
        analog-input-front-mic: Front Microphone (priority 8500, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-input-microphone"
        analog-input-rear-mic: Rear Microphone (priority 8200, latency offset 0 usec, available: yes)
            properties:
                device.icon_name = "audio-input-microphone"
        analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
            properties:
                
        analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: yes)
            properties:
                
        analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-headphones"
        iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
            properties:
                
$ pacmd list-sinks
1 sink(s) available.
  * index: 0
    name: <alsa_output.pci-0000_0b_00.3.analog-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
    state: RUNNING
    suspend cause: (none)
    priority: 9039
    volume: front-left: 26090 /  40% / -24.00 dB,   front-right: 26090 /  40% / -24.00 dB
            balance 0.00
    base volume: 65536 / 100% / 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 100.13 ms
    max request: 17 KiB
    max rewind: 17 KiB
    monitor source: 0
    sample spec: s16le 2ch 44100Hz
    channel map: front-left,front-right
                 Stereo
    used by: 1
    linked by: 1
    fixed latency: 100.14 ms
    card: 1 <alsa_card.pci-0000_0b_00.3>
    module: 7
    properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "ALC887-VD Analog"
        alsa.id = "ALC887-VD Analog"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "1"
        alsa.card_name = "HD-Audio Generic"
        alsa.long_card_name = "HD-Audio Generic at 0xfcd00000 irq 63"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:0b:00.3"
        sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:0b:00.3/sound/card1"
        device.bus = "pci"
        device.vendor.id = "1022"
        device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
        device.product.id = "1457"
        device.product.name = "Family 17h (Models 00h-0fh) HD Audio Controller"
        device.string = "front:1"
        device.buffering.buffer_size = "17664"
        device.buffering.fragment_size = "2944"
        device.access_mode = "mmap"
        device.profile.name = "analog-stereo"
        device.profile.description = "Analog Stereo"
        device.description = "Family 17h (Models 00h-0fh) HD Audio Controller Analog Stereo"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    ports:
        analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: yes)
            properties:
                
        analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-headphones"
    active port: <analog-output-lineout>

DisplayPort output doesn't show up in Plasma's sound widget / pavucontrol anymore; only in pavucontrol -> Configuration there's an "Ellesmere HDMI Audio" profile set to "Off" (I never touched it, and until a few days ago both internal and DisplayPort audio worked fine); before I created that file it always showed the GPU as a valid sound output in the outputs and switching always worked fine.

Last edited by krnlpk (2020-11-05 08:42:24)

Offline

Board footer

Powered by FluxBB