Audio start delay

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
zerobyzero
Level 1
Level 1
Posts: 9
Joined: Sun Jul 31, 2022 4:55 pm

Audio start delay

Post by zerobyzero »

I've just installed Mint 20.3 Una in the machine below:

Code: Select all

H/W path              Device          Class          Description
================================================================
                                      system         UM350 (Default string)
/0                                    bus            UM350
/0/0                                  memory         64KiB BIOS
/0/a                                  memory         16GiB System Memory
/0/a/0                                memory         8GiB SODIMM DDR4 Synchronous Unbuffered (Unregistered) 2667 MHz (0.4 ns)
/0/a/1                                memory         8GiB SODIMM DDR4 Synchronous Unbuffered (Unregistered) 2667 MHz (0.4 ns)
/0/c                                  memory         384KiB L1 cache
/0/d                                  memory         2MiB L2 cache
/0/e                                  memory         4MiB L3 cache
/0/f                                  processor      AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx
/0/100                                bridge         Raven/Raven2 Root Complex
/0/100/0.2                            generic        Raven/Raven2 IOMMU
/0/100/1.1                            bridge         Raven/Raven2 PCIe GPP Bridge [6:0]
/0/100/1.1/0                          storage        Kingston Technology Company, Inc.
/0/100/1.1/0/0        /dev/nvme0      storage        KINGSTON SNVS500G
/0/100/1.1/0/0/1      /dev/nvme0n1    disk           500GB NVMe namespace
/0/100/1.1/0/0/1/1                    volume         512MiB Windows FAT volume
/0/100/1.1/0/0/1/2    /dev/nvme0n1p2  volume         465GiB Extended partition
/0/100/1.1/0/0/1/2/5  /dev/nvme0n1p5  volume         465GiB EXT4 volume
/0/100/1.2                            bridge         Raven/Raven2 PCIe GPP Bridge [6:0]
/0/100/1.2/0          wlp2s0          network        Wireless 7265
/0/100/1.4                            bridge         Raven/Raven2 PCIe GPP Bridge [6:0]
/0/100/1.4/0          enp3s0          network        Intel Corporation
/0/100/8.1                            bridge         Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus A
/0/100/8.1/0                          display        Picasso
/0/100/8.1/0.1                        multimedia     Raven/Raven2/Fenghuang HDMI/DP Audio Controller
/0/100/8.1/0.2                        generic        Family 17h (Models 10h-1fh) Platform Security Processor
/0/100/8.1/0.3                        bus            Raven USB 3.1
/0/100/8.1/0.3/0      usb1            bus            xHCI Host Controller
/0/100/8.1/0.3/0/2                    input          USB Receiver
/0/100/8.1/0.3/1      usb2            bus            xHCI Host Controller
/0/100/8.1/0.4                        bus            Raven USB 3.1
/0/100/8.1/0.4/0      usb3            bus            xHCI Host Controller
/0/100/8.1/0.4/0/2                    bus            USB 2.0 Hub
/0/100/8.1/0.4/0/2/1                  multimedia     USB Audio Device
/0/100/8.1/0.4/0/2/2                  communication  Bluetooth wireless interface
/0/100/8.1/0.4/1      usb4            bus            xHCI Host Controller
/0/100/8.1/0.5                        multimedia     Raven/Raven2/FireFlight/Renoir Audio Processor
/0/100/8.1/0.6                        multimedia     Family 17h (Models 10h-1fh) HD Audio Controller
/0/100/8.1/0.7                        generic        Raven/Raven2/Renoir Non-Sensor Fusion Hub KMDF driver
/0/100/8.2                            bridge         Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus B
/0/100/8.2/0                          storage        FCH SATA Controller [AHCI mode]
/0/100/14                             bus            FCH SMBus Controller
/0/100/14.3                           bridge         FCH LPC Bridge
/0/101                                bridge         Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge
/0/102                                bridge         Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge
/0/103                                bridge         Raven/Raven2 Device 24: Function 0
/0/104                                bridge         Raven/Raven2 Device 24: Function 1
/0/105                                bridge         Raven/Raven2 Device 24: Function 2
/0/106                                bridge         Raven/Raven2 Device 24: Function 3
/0/107                                bridge         Raven/Raven2 Device 24: Function 4
/0/108                                bridge         Raven/Raven2 Device 24: Function 5
/0/109                                bridge         Raven/Raven2 Device 24: Function 6
/0/10a                                bridge         Raven/Raven2 Device 24: Function 7
/0/1                                  system         PnP device PNP0c01
/0/2                                  system         PnP device PNP0b00
/0/3                                  system         PnP device PNP0c02
/0/4                                  system         PnP device PNP0c02
/0/5                  scsi1           storage        
/0/5/0.0.0            /dev/sda        disk           500GB Samsung SSD 860
/0/5/0.0.0/1          /dev/sda1       volume         465GiB EXT4 volume
I have a monitor connected through display port which is also used as the audio output. Sound works fine with one little exception, when a sound is played, audio starts 2-3 seconds later. That makes, for example, that system sounds don't work at all since most of them, if not all, are shorter than 2 seconds. I've been doing some digging and it seems the issue is the sound card is disable when there is no activity for a while. So when you first activate a sound, those 2-3 seconds are the time required for the device to awake.

A suggested solution seems to be editting pulseaudio default configuration and disable audio idle mode by commenting:

Code: Select all

# load-module module-suspend-on-idle
And also adding tsched=0 to the lines below:

Code: Select all

load-module module-udev-detect tsched=0
load-module module-detect tsched=0
After those changes, executing "pulseaudio -k" or rebooting the operating system should apply the changes and, in theory, the delay problem should be gone. But it's not the case for me.

A second, harsher I'd say, method to tackle the problem is to reproduce an empty sound so the sound device never gets idle. This can be easily tested by opening a terminal and run:

Code: Select all

/usr/bin/aplay -c2 -r8000 -fS16_LE /dev/zero
Effectively, leaving this terminal running, the problem is completely gone and the process just takes 0.0-0.3% of one of my CPUs. So, in theory, happy days. In order to apply this solution in a nicer way, an "audio_non_stop" systemd service can be created with the following content.

Code: Select all

#audio_non_stop.service
[Unit]
Description="Create a silent sound to keep the audio HDMI digital output running"
After=sound.target
 
[Service]
ExecStart=/usr/bin/aplay -c2 -r48000 -fS16_LE /dev/zero
#Restart=on-failure
ExecStop=/bin/kill -INT $MAINPID
KillSignal=SIGINT
#TimeoutStopSec=10
 
[Install]
WantedBy=graphical.target
Then the service can be started with:

Code: Select all

sudo service audio_non_stop start
Problem is, the system fails to start. Below you can see the output of "sudo service audi_non_stop status":

Code: Select all

Warning: The unit file, source configuration file or drop-ins of audio_non_stop.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● audio_non_stop.service - "Create a silent sound to keep the audio HDMI digital output running"
     Loaded: loaded (/etc/systemd/system/audio_non_stop.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2022-07-31 22:16:49 BST; 53s ago
    Process: 6417 ExecStartPre=/bin/sleep 30 (code=exited, status=0/SUCCESS)
    Process: 6433 ExecStart=/usr/bin/aplay -c1 -r8000 -fS16_LE /dev/zero (code=exited, status=1/FAILURE)
   Main PID: 6433 (code=exited, status=1/FAILURE)

Jul 31 22:16:19 minisforum systemd[1]: Starting "Create a silent sound to keep the audio HDMI digital output running"...
Jul 31 22:16:49 minisforum systemd[1]: Started "Create a silent sound to keep the audio HDMI digital output running".
Jul 31 22:16:49 minisforum aplay[6433]: ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave
Jul 31 22:16:49 minisforum aplay[6433]: aplay: main:852: audio open error: No such file or directory
Jul 31 22:16:49 minisforum systemd[1]: audio_non_stop.service: Main process exited, code=exited, status=1/FAILURE
Jul 31 22:16:49 minisforum systemd[1]: audio_non_stop.service: Failed with result 'exit-code'.
Do you happen to know what's the problem? how's possible the command works from the terminal but fails when trying to launch it as a service?

Regards and many thanks in advance.
Last edited by LockBot on Tue Jan 31, 2023 11:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
SMG
Level 25
Level 25
Posts: 31776
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Audio start delay

Post by SMG »

zerobyzero wrote: Sun Jul 31, 2022 5:19 pm I've just installed Mint 20.3 Una in the machine below:
Welcome to the forum, zerobyzero.

Please give us information about your install by entering this command in a terminal:

Code: Select all

inxi -Fxxxrz
Click </> from the mini toolbar above the textbox where you type your reply and then place your cursor between the code tags and paste the results of the command between the code tags [code]Results[/code]. This will let us know how Mint sees your hardware. A Ryzen 3000 series needs to be using the 5.15 kernel, but we have no idea of what you installed.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
zerobyzero
Level 1
Level 1
Posts: 9
Joined: Sun Jul 31, 2022 4:55 pm

Re: Audio start delay

Post by zerobyzero »

There it goes...

Code: Select all

System:    Kernel: 5.4.0-122-generic x86_64 bits: 64 compiler: gcc v: 9.4.0 Desktop: Cinnamon 5.2.7 wm: muffin 5.2.1 
           dm: LightDM 1.30.0 Distro: Linux Mint 20.3 Una base: Ubuntu 20.04 focal 
Machine:   Type: Desktop System: BESSTAR TECH LIMITED product: UM350 v: N/A serial: <filter> 
           Mobo: BESSTAR TECH LIMITED model: UM350 serial: <filter> UEFI [Legacy]: American Megatrends v: 5.14 
           date: 01/04/2022 
Battery:   Device-1: hid-00:18:00:3c:c7:ad-battery model: Majestouch Convertible 2 serial: N/A charge: N/A status: Discharging 
           Device-2: hidpp_battery_0 model: Logitech M585/M590 Multi-Device Mouse serial: <filter> 
           charge: 55% (should be ignored) rechargeable: yes status: Discharging 
CPU:       Topology: Quad Core model: AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx bits: 64 type: MT MCP arch: Zen+ rev: 1 
           L2 cache: 2048 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 33536 
           Speed: 1664 MHz min/max: 1400/2100 MHz boost: enabled Core speeds (MHz): 1: 1694 2: 1695 3: 1131 4: 1130 5: 1131 
           6: 1131 7: 1131 8: 1131 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Picasso driver: amdgpu v: kernel bus ID: 04:00.0 chip ID: 1002:15d8 
           Display: x11 server: X.Org 1.20.13 driver: amdgpu,ati unloaded: fbdev,modesetting,vesa tty: N/A 
           OpenGL: renderer: AMD Radeon Vega 8 Graphics (RAVEN DRM 3.35.0 5.4.0-122-generic LLVM 12.0.0) v: 4.6 Mesa 21.2.6 
           direct render: Yes 
Audio:     Device-1: Advanced Micro Devices [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio driver: snd_hda_intel v: kernel 
           bus ID: 04:00.1 chip ID: 1002:15de 
           Device-2: Advanced Micro Devices [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor driver: N/A bus ID: 04:00.5 
           chip ID: 1022:15e2 
           Device-3: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: Realtek driver: snd_hda_intel v: kernel 
           bus ID: 04:00.6 chip ID: 1022:15e3 
           Device-4: C-Media Audio Adapter (Unitek Y-247A) type: USB driver: hid-generic,snd-usb-audio,usbhid bus ID: 3-2.1:3 
           chip ID: 0d8c:0014 
           Sound Server: ALSA v: k5.4.0-122-generic 
Network:   Device-1: Intel Wireless 7265 driver: iwlwifi v: kernel bus ID: 02:00.0 chip ID: 8086:095a 
           IF: wlp2s0 state: up mac: <filter> 
           Device-2: Intel driver: igc v: 0.0.1-k port: N/A bus ID: 03:00.0 chip ID: 8086:15f3 
           IF: enp3s0 state: down mac: <filter> 
Drives:    Local Storage: total: 931.52 GiB used: 180.05 GiB (19.3%) 
           ID-1: /dev/nvme0n1 vendor: Kingston model: SNVS500G size: 465.76 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> 
           rev: S8H40104 scheme: MBR 
           ID-2: /dev/sda vendor: Samsung model: SSD 860 EVO 500GB size: 465.76 GiB speed: 6.0 Gb/s serial: <filter> rev: 2B6Q 
           scheme: GPT 
Partition: ID-1: / size: 456.88 GiB used: 51.61 GiB (11.3%) fs: ext4 dev: /dev/nvme0n1p5 
Sensors:   System Temperatures: cpu: 57.9 C mobo: N/A gpu: amdgpu temp: 57 C 
           Fan Speeds (RPM): N/A 
Repos:     No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/nicotine-team-stable-focal.list 
           1: deb http://ppa.launchpad.net/nicotine-team/stable/ubuntu focal main
           Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
           1: deb https://www.mirrorservice.org/sites/packages.linuxmint.com/packages una main upstream import backport
           2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
           3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
           4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
           5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
           6: deb http://archive.canonical.com/ubuntu/ focal partner
           Active apt repos in: /etc/apt/sources.list.d/steam.list 
           1: deb [arch=amd64,i386] https://repo.steampowered.com/steam/ stable steam
           2: deb-src [arch=amd64,i386] https://repo.steampowered.com/steam/ stable steam
Info:      Processes: 328 Uptime: 1h 02m Memory: 13.68 GiB used: 3.42 GiB (25.0%) Init: systemd v: 245 runlevel: 5 Compilers: 
           gcc: 9.4.0 alt: 9 Shell: bash v: 5.0.17 running in: gnome-terminal inxi: 3.0.38 

User avatar
SMG
Level 25
Level 25
Posts: 31776
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Audio start delay

Post by SMG »

Instructions for upgrading to the 5.15 kernel:
  • Open Update Manager.
  • Select View > Linux Kernels and click Continue.
  • Make sure 5.15 is selected on the left panel and then click the top-most option on the right panel. An "Install" button will appear.
  • Install the kernel and then reboot for it to become active.
Let us know if that helps this situation.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
zerobyzero
Level 1
Level 1
Posts: 9
Joined: Sun Jul 31, 2022 4:55 pm

Re: Audio start delay

Post by zerobyzero »

Thanks, SMG, but the problem is not gone.

I upgraded the kernel to 5.15.0-41, and after rebooting and using the default pulseaudio configuration (I'll put it below just in case I messed it up when going back and forth), the audio start delay problem was still present.

Code: Select all

#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.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

### Use hot-plugged devices like Bluetooth or USB automatically (LP: #1702794)
.ifexists module-switch-on-connect.so
load-module module-switch-on-connect
.endif

### 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
.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

### 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

### Block audio recording for snap confined packages unless they have
### the "pulseaudio" or "audio-record" interfaces plugged.
.ifexists module-snap-policy.so
load-module module-snap-policy
.endif

### 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 combined
#set-default-source input
Then I introduced the quick modifications (comment on "load-module module-suspend-on-idle", adding the "tsched=0" on module-udev-detect and module-detect) but still no luck, same delay problem.

Regards
User avatar
trytip
Level 14
Level 14
Posts: 5366
Joined: Tue Jul 05, 2016 1:20 pm

Re: Audio start delay

Post by trytip »

linux mint 21 is out today, i suggest since it's new installation you download linux mint 21 and start there. don't do any mods you have not backed up first, the simplest way is compress the file before you start modifying. not always work some directories won't allow it without errors. create timeshift before you mod
https://linuxmint.com/download.php
Image
zerobyzero
Level 1
Level 1
Posts: 9
Joined: Sun Jul 31, 2022 4:55 pm

Re: Audio start delay

Post by zerobyzero »

Thanks, trytip.

Fresh install of Mint 21, same problem, then I updated the system, which includes Kernel 5.15.0-43 and same problem. Then I copied the default pulseaudio to my home directory (cp /etc/pulse/default.pa ~/.config/pulse/) where I tried commenting "# load-module module-suspend-on-idle" and same result.

Now I have a Timeshift snapshot after installation just in case.

Regards
User avatar
SMG
Level 25
Level 25
Posts: 31776
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Audio start delay

Post by SMG »

zerobyzero wrote: Sun Jul 31, 2022 5:19 pmAfter those changes, executing "pulseaudio -k" or rebooting the operating system should apply the changes and, in theory, the delay problem should be gone. But it's not the case for me.

A second, harsher I'd say, method to tackle the problem is to reproduce an empty sound so the sound device never gets idle.
When I read your description my first thought is what is different about your hardware that this is happening. Everyone's system goes idle yet everyone does not have this issue. What are you using to hear the sound (wired speakers, bluetooth headphones, etc.)?

What is the output of aplay -l?
Image
A woman typing on a laptop with LM20.3 Cinnamon.
zerobyzero
Level 1
Level 1
Posts: 9
Joined: Sun Jul 31, 2022 4:55 pm

Re: Audio start delay

Post by zerobyzero »

The output of "aplay -l" is:

Code: Select all

**** List of PLAYBACK Hardware Devices ****
card 0: Generic_1 [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: Generic_1 [HD-Audio Generic], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Generic_1 [HD-Audio Generic], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Generic_1 [HD-Audio Generic], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
My sound configuration is quite simple, two BenQ EX2780Q monitors connected to the computer, one through HDMI, and the other through display port (the PC only has one HDMI and one display port, that's the reason for the different connections).

I have around usb and minijack headphones, I'll check if the dealy also happens with them and post the results later.

Regards

EDIT: I can confirm that using USB headphones or minijack ones, the sound starts immediately. I also found this reddit thread: https://www.reddit.com/r/BenQ/comments/ ... und_delay/
User avatar
SMG
Level 25
Level 25
Posts: 31776
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Audio start delay

Post by SMG »

zerobyzero wrote: Mon Aug 01, 2022 2:45 pmEDIT: I can confirm that using USB headphones or minijack ones, the sound starts immediately. I also found this reddit thread: https://www.reddit.com/r/BenQ/comments/ ... und_delay/
So it's a bug with the monitor and the only way to get the updated firmware is to have a BenQ tech install it. :shock:

It's getting late for me, but I'll take a look tomorrow at the workaround you found to see if I have any ideas.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
zerobyzero
Level 1
Level 1
Posts: 9
Joined: Sun Jul 31, 2022 4:55 pm

Re: Audio start delay

Post by zerobyzero »

I've been just contacted by customer support and they confirm it's an issue with the sound card of the monitor and the need to collect the monitors to fix them. I hope it's not taking too long.

Thanks for all your support and sorry for all the inconveniences caused. I wouldn't have figured out withour your help. Can you please keep the thread open so I can add more information once I have the monitors back?
User avatar
SMG
Level 25
Level 25
Posts: 31776
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Audio start delay

Post by SMG »

zerobyzero wrote: Tue Aug 02, 2022 2:52 amThanks for all your support and sorry for all the inconveniences caused. I wouldn't have figured out withour your help. Can you please keep the thread open so I can add more information once I have the monitors back?
You're welcome.

Threads on this forum do not automatically close. You, as the topic creator, are the one to edit the title of the first post to mark the topic solved, if and when you feel it has been resolved.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
zerobyzero
Level 1
Level 1
Posts: 9
Joined: Sun Jul 31, 2022 4:55 pm

Re: Audio start delay

Post by zerobyzero »

Monitors are back from service and this is a summary of the current situation.
  1. [pulseaudio config customizations ON] Everything seems to work almost perfect. Audio doesn´t disconnect as quickly as before. I can leave the computer for 10-20 minutes and the audio is responding immediately when I'm back. For longer inactivity periods (let's say hours), audio sometimes start almost immediately, maybe it takes a bit longer than usual (placebo effect?), sometimes it takes ~2 seconds to come back. I wish I didn't have those delays, but in general I'm happy with it.
  2. [pulseaudio config customizations ON] I created a sink to send audio to both monitors at the same time, everything OK. From time to time, maybe once or twice per day, audio disconnects and connects again. Annoying part if I have to click again on play if I was listening to music because the audio stops when the audio disconnects.
  3. [pulseaudio config customizations OFF] Audio is quite un-stable and only works for some minutes (maybe 5-10), and then all sound devices dissapear from pulseaudio control panel. Not just the monitor sound cards (and sink), but also the internal analog microphone and sound card from the computer. Pulseaudio configuration shows no sound card at all. Killing and restarting pulseaudio doesn't solve the issue. I have to completely reboot the computer and everything appears back and works fine... for 5-10 minutes.
So, I'll leave the pulseaudio customizations active (configuration 2) (commenting "# load-module module-suspend-on-idle" and adding "tsched=0" to "load-module module-udev-detect tsched=0" and "load-module module-detect tsched=0") because it's the most robust configuration for me, but I suspect there is some incompatibility between Mint/Kernel and my hardware configuration. I'll come back to this post if anything changes.
User avatar
SMG
Level 25
Level 25
Posts: 31776
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Audio start delay

Post by SMG »

They were really quick about getting the monitors fixed and back to you.

You might want to keep tabs on the reddit thread because you might be able to compare with other users what differences they have seen after getting the new firmware and if all their issues are fixed.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
zerobyzero
Level 1
Level 1
Posts: 9
Joined: Sun Jul 31, 2022 4:55 pm

Re: Audio start delay

Post by zerobyzero »

Yes, they've been really quick. I'm following the thread but I don't expect much output, not many linux users out there.

For completeness, I'll continue posting my findings in this thread if you don't mind. I've been trying to debug the problem so I deactivated pulseaudio service with:

Code: Select all

systemctl --user stop pulseaudio.socket
systemctl --user stop pulseaudio.service
Then, I manually open it in verbose mode with:

Code: Select all

pulseaudio -v
And to finish I played some music through Firefox until it failed. Below is the error message I got.

Code: Select all

...
I: [pulseaudio] protocol-native.c: Requested tlength=49.98 ms, minreq=6.24 ms
I: [pulseaudio] protocol-native.c: Final latency 49.98 ms = 18.75 ms + 2*6.24 ms + 18.75 ms
I: [pulseaudio] sink-input.c: Freeing input 997 "AudioCallbackDriver"
E: [alsa-sink-HDMI 0] memblockq.c: Assertion 'bq->n_blocks == 0' failed at ../src/pulsecore/memblockq.c:1006, function pa_memblockq_silence(). Aborting.
Aborted (core dumped)
At the moment, the pulseaudio version included in Mint 21 is "pulseaudio 15.99.1". Googling the error message I found https://www.reddit.com/r/openSUSE/comme ... umbleweed/ which suggests there is a problem in 16.0 that'll be fixed in 16.1.

I check my sinks with "pacmd list-sinks" and I get:

Code: Select all

3 sink(s) available.
  * index: 0
	name: <monitor_1>
	driver: <module-alsa-sink.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: RUNNING
	suspend cause: (none)
	priority: 9030
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 31457 /  48% / -19.13 dB
	        balance -0.52
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 18.30 ms
	max request: 3 KiB
	max rewind: 3 KiB
	monitor source: 0
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 3
	linked by: 3
	configured latency: 18.75 ms; range is 0.50 .. 1999.82 ms
	module: 6
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "HDMI 1"
		alsa.id = "HDMI 1"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "7"
		alsa.card = "0"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HD-Audio Generic at 0xfc9c8000 irq 73"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:04:00.1"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:04:00.1/sound/card0"
		device.bus = "pci"
		device.vendor.id = "1002"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
		device.product.id = "15de"
		device.product.name = "Raven/Raven2/Fenghuang HDMI/DP Audio Controller"
		device.string = "hw:0,7"
		device.buffering.buffer_size = "352768"
		device.buffering.fragment_size = "176384"
		device.access_mode = "mmap+timer"
		device.description = "Monitor 1"
		device.icon_name = "audio-card"
    index: 1
	name: <monitor_2>
	driver: <module-alsa-sink.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: RUNNING
	suspend cause: (none)
	priority: 9030
	volume: front-left: 29229 /  45% / -21.04 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.55
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 144.79 ms
	max request: 34 KiB
	max rewind: 34 KiB
	monitor source: 1
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 1
	linked by: 1
	configured latency: 200.00 ms; range is 0.50 .. 1999.82 ms
	module: 7
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "HDMI 0"
		alsa.id = "HDMI 0"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "3"
		alsa.card = "0"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HD-Audio Generic at 0xfc9c8000 irq 73"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:04:00.1"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:04:00.1/sound/card0"
		device.bus = "pci"
		device.vendor.id = "1002"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
		device.product.id = "15de"
		device.product.name = "Raven/Raven2/Fenghuang HDMI/DP Audio Controller"
		device.string = "hw:0,3"
		device.buffering.buffer_size = "352768"
		device.buffering.fragment_size = "176384"
		device.access_mode = "mmap+timer"
		device.description = "Monitor 2"
		device.icon_name = "audio-card"
    index: 2
	name: <combined_output>
	driver: <module-combine-sink.c>
	flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: IDLE
	suspend cause: (none)
	priority: 1000
	volume: front-left: 39312 /  60% / -13.32 dB,   front-right: 39312 /  60% / -13.32 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 13.42 ms
	max request: 34 KiB
	max rewind: 0 KiB
	monitor source: 2
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	configured latency: 200.00 ms; range is 0.50 .. 200.00 ms
	module: 8
	properties:
		device.class = "filter"
		combine.slaves = "monitor_1,monitor_2"
		device.description = "Monitor 1+2"
		device.icon_name = "audio-card"
(after 15 minutes, audio started crackling; restarting "pulseaudio -v" solved the issue)

I'll leave the computer playing audio through just "Monitor 1" and this evening I'll check "pulseaudio -v" output...
User avatar
SMG
Level 25
Level 25
Posts: 31776
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Audio start delay

Post by SMG »

zerobyzero wrote: Mon Aug 15, 2022 4:49 am Yes, they've been really quick. I'm following the thread but I don't expect much output, not many linux users out there.

For completeness, I'll continue posting my findings in this thread if you don't mind.
It sounds like the issue is not completely resolved (which is why I suggested keeping up with the reddit thread), so no problems continuing this topic.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
dwasifark
Level 1
Level 1
Posts: 28
Joined: Sun Apr 08, 2018 8:38 pm

Re: Audio start delay

Post by dwasifark »

I've experienced this through multiple versions of Mint. It's an upstream issue from Ubuntu, and I used an Ubuntu howto https://lesterlo.wordpress.com/2020/04/ ... y-problem/ to solve it. Basically this page presents the same options as OP has already discovered (disable the audio idle module, or kludge it with a silent sound to keep the sound module up). But that page is two and a half years old, so this problem has been with us for a while.

Really I don't know why Ubuntu doesn't get rid of the audio idle module in its default config, or if Ubuntu won't, why Clem doesn't. It's a five minute fix but it's annoying to have to keep doing it.
zerobyzero
Level 1
Level 1
Posts: 9
Joined: Sun Jul 31, 2022 4:55 pm

Re: Audio start delay

Post by zerobyzero »

Just a quick update:

Monitors swapped by two Dell ones + default pulseaudio configuration => Sound issues solved: No delay, sound not stopping.

If I create an audio sink to play audio through both monitors at the same time with:

Code: Select all

load-module module-alsa-sink device="hw:0,7" sink_name=monitor_l sink_properties="device.description='Monitor Left' device.icon_name='audio-card'"
load-module module-alsa-sink device="hw:0,3" sink_name=monitor_r sink_properties="device.description='Monitor Right' device.icon_name='audio-card'"
load-module module-combine-sink sink_name=monitor_lr slaves=monitor_l,monitor_r sink_properties="device.description='Monitors Left+Right' device.icon_name='audio-card'"


### 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

[...]

set-default-sink monitor_lr
...audio works some times for several hours, but others I get random audio stop. Funny enough, it never happens when I watch youtube but quite oftenly when I'm playing music through Plex or Jellyfin.

So, in conclusion, system fully stable and functional with audio through one of the audio outputs, but some random audio interruptions when using an output audio sink.

Regards
Locked

Return to “Sound”