[Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
The Bright Side
Level 3
Level 3
Posts: 172
Joined: Thu Jul 12, 2018 3:09 pm

[Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by The Bright Side »

Hello, Mint team!

I am hoping you can give me some advice on a bug that I've been experiencing in Ubuntu for over 8 years, and that finally went away when I switched to Mint last year.

Yesterday, it started happening here, too.

Unfortunately, I am about to move to Germany and my home theater system will be on the Atlantic Ocean for the next 1-2 months, so I won't be able to play back multichannel music for a while. I will definitely keep reading this thread and updating with new info as I get it.

Any help will be greatly appreciated.

===========================================

Steps to Reproduce:
1. Start up Linux Mint 19
2. Launch e.g. VLC, SMPlayer, Parole or similar
3. Listen to multichannel music (e.g. 4.0, 5.1, 7.1 surround) until issue occurs

Current Results:
While listening to multichannel music (e.g. in FLAC format, or .mka, .mkv, .ac3, .dts, .iso...), there are occasional audio dropouts.

Expected Results:
All music should play back without issue.


Notes:
  • Repro rate: unpredictable. Sometimes no issue for days, sometimes 3-4 dropouts in just 5-6 consecutive songs
  • Issue never occurs at the same point in a song twice
  • Issue used to occur in Ubuntu when I was using it between March 2009 and November 2017
  • Issue stopped occurring when I switched to Mint in November 2017
  • Issue first encountered in Mint on September 8, 2018
  • Issue occurs on both my desktop and laptop PC (encountered on Sep 8th and 9th, 2018, respectively)
  • Issue never encountered in stereo music in MP3, OGG or FLAC format.

Resources:
Hardware specs - my desktop PC:
Sound device: NVidia GeForce GTX 1080Ti (HDMI out)
Playback hardware: Yamaha RX-V661 7.1 surround receiver (HDMI in)
RAM: 32 GB
CPU: Intel Core i7-4970K (4.00GHz x4)

Hardware specs - my laptop PC:
Sound device: NVidia GeForce GTX 980M (HDMI out)
Playback hardware: Yamaha RX-V661 7.1 surround receiver (HDMI in)
RAM: 32 GB
CPU: Intel Core i7-4710HQ (2.5GHz x4)
User avatar
MrEen
Level 23
Level 23
Posts: 18345
Joined: Mon Jun 12, 2017 8:39 pm

Re: [Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by MrEen »

Hello The Bright Side.

Based on your description I would strongly suspect an update you applied has caused this. I'm on 18.3 and see a couple of audio updates waiting to be applied in my Update Manager

ffmpeg changelog shows:

Code: Select all

  * SECURITY UPDATE: New upstream bugfix release.
    - Fixes CVE-2018-7557, CVE-2018-12458 and CVE-2018-13302.
mpg123 changelog shows:

Code: Select all

  * SECURITY UPDATE: Memory overread
    - debian/patches/CVE-2016-1000247.patch: fix DoS with crafted ID3v2
      tags.
    - CVE-2016-1000247
  * SECURITY UPDATE: Memory overread
    - debian/patches/CVE-2017-10683.patch: fix in id3.c
    - CVE-2017-10683
Both being security fixes, I wouldn't be surprised that you had those as well.

I'm not familiar with downgrading packages so we'll have to wait for someone else to offer advice if you want to try going that route.

Just in case it's only a configuration issue, try deleting the files in ~/.config/pulse/ and issue pulseaudio -k in the terminal. Wait 10 seconds then test your sound.

Hope that helps.
The Bright Side
Level 3
Level 3
Posts: 172
Joined: Thu Jul 12, 2018 3:09 pm

Re: [Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by The Bright Side »

Hi MrEen! Thanks for that. I was strongly suspecting recent updates as well, since I haven't changed anything about my configuration settings lately. I will delete the files in the config folder you mentioned and keep an .... ear on this in the upcoming weeks.

I wouldn't consider downgrading, since this is not a show-stopping issue, and since a downgrade would not constitute a solution.

Would you happen to know how to reach whoever works on the affected packages? Are they seeing this bug report?
User avatar
MrEen
Level 23
Level 23
Posts: 18345
Joined: Mon Jun 12, 2017 8:39 pm

Re: [Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by MrEen »

Hi again The Bright Side.

Regarding the dowgrading comment, I was specifically referring to the updated packages, not your whole system.

As far as anyone seeing this that matters, that answer is, more or less, no. We're not even sure yet where any bug may lie.

After re-reading your initial post, I have another suggestion. Check the Driver Manager if there's any recommendations not applied for your nvidia card. As you're using HDMI for sound, maybe that could help. Alternatively, if you recently applied an update for your video card, that might be where the problem originated.

Hope that gets us closer to solving this.
The Bright Side
Level 3
Level 3
Posts: 172
Joined: Thu Jul 12, 2018 3:09 pm

Re: [Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by The Bright Side »

Cool. I will look at NVidia drivers for sure. Since I'll be using headphones / my built-in speakers for the next few months, I don't expect to even encounter this bug for a while. Here's hoping it just disappears :-)

One more question.

I was a bit surprised to find that the codecs listed in SMPlayer's codecs list used to be called "lavc:" back in January, and now I see the same "ffm~" codecs that Ubuntu has (screenshots from January here). Has there been any change in the audio codecs Mint uses in the past months?
User avatar
MrEen
Level 23
Level 23
Posts: 18345
Joined: Mon Jun 12, 2017 8:39 pm

Re: [Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by MrEen »

As far as I know, everything sound in Mint comes from Ubuntu/Debian and of course the kernel.

After a very quick search, lavc appears to be part of ffmpeg.
The Bright Side
Level 3
Level 3
Posts: 172
Joined: Thu Jul 12, 2018 3:09 pm

Re: [Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by The Bright Side »

Hello, Mint team!

I have set up my new 7.1 system in my new home in Germany. It's a new receiver and subwoofer, plus all-new HDMI cables. Same 7 speakers.

The issue still occurs as described in my original post. The NVIDIA driver I have in use is 396.54. I also experienced this with 390.87 back in September.

Is there any other suggestion or idea you might have regarding this?
User avatar
MrEen
Level 23
Level 23
Posts: 18345
Joined: Mon Jun 12, 2017 8:39 pm

Re: [Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by MrEen »

Hi again, The Bright Side.

As a test, to rule out the NVidia driver, I think you should try testing with the nouveau driver for a little bit. If the problem doesn't return, then the driver was the issue.

There was an Arch user that had a similar issue that was solved this way. See here.

If the issue returns while running the nouveau driver, then we know it's probably an alsa or pulseaudio problem.

Good luck.
The Bright Side
Level 3
Level 3
Posts: 172
Joined: Thu Jul 12, 2018 3:09 pm

Re: [Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by The Bright Side »

Hey MrEen! Thanks for your reply and your suggestion.

I used Driver Manager to switch to Nouveau and restarted. I found my desktop exactly the same, with NVidia-settings still installed and according to it, nvidia-396 still in use. In the Driver Manager, all available options were greyed out and I was stuck on "Continue using manually installed driver".

I then purged all nvidia* packages and rebooted again. Now I'm in 1024x768 2D-only mode and no HDMI option is available anymore in the sound settings, only the motherboard's stereo out. Also, my second screen stays black and doesn't appear as an option in the display settings.

The options in Driver Manager are now available again and it says I'm running Nouveau atm.

It seems like nouveau doesn't support many of the features that my NVIDIA card has, e.g. resolutions above 1024x768, HDMI audio, multi-screen or 3D acceleration?
The Bright Side
Level 3
Level 3
Posts: 172
Joined: Thu Jul 12, 2018 3:09 pm

Re: [Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by The Bright Side »

Quick update: installed 390, restarted, then switched back to nouveau and purged nvidia* packages *before* restarting.

Ended up in low-res software mode again with broken HDMI and multi-screen support.

Installed 390, rebooted, put on some music and had an audio dropout after 1 second of playback.

I posted in the NVIDIA forums about this issue as well.:
https://devtalk.nvidia.com/default/topi ... -playback/
User avatar
MrEen
Level 23
Level 23
Posts: 18345
Joined: Mon Jun 12, 2017 8:39 pm

Re: [Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by MrEen »

Had another thought. If your sound is using a shared IRQ that might cause this issue. It's probably somewhat doubtful, but at least we can check if it's even a possibility.

Get the HDMI IRQ with this: pacmd list-sinks | grep irq (should be the last thing on the line before the double quote.)

If, for example, the IRQ is 16, then use this: cat /proc/interrupts | grep 16

Here's the important line that returns for me:

Code: Select all

 16:        205       1724        989       1024  IR-IO-APIC  16-fasteoi   snd_hda_intel:card2
If yours looks more like the following, then maybe it could be the cause of your trouble:

Code: Select all

 16:        205       1724        989       1024  IR-IO-APIC  16-fasteoi   [b]usb2[/b], snd_hda_intel:card2
I also have some other ideas but will wait to see if this leads anywhere. If we end up going to the other ideas, I'll need the output of inxi -Fxz as well as aplay -l and pacmd list-sinks

P.S. Sucks that nouveau driver can't do HDMI!
User avatar
MrEen
Level 23
Level 23
Posts: 18345
Joined: Mon Jun 12, 2017 8:39 pm

Re: [Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by MrEen »

Now that I think about, nouveau should be able to do HDMI I'm pretty sure. Skip everything in the previous post for a bit while we try a new tack.

Maybe you should install and run PulseAudio Volume Control. Go to the Configuration tab and make sure the HDMI Profile is set correctly, and any other Profiles are set to Off.

If no luck using nvidia this way, try nouveau one more time, this time using pavucontrol to make sure the config is correct.

Good luck.
The Bright Side
Level 3
Level 3
Posts: 172
Joined: Thu Jul 12, 2018 3:09 pm

Re: [Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by The Bright Side »

Pavucontrol has been a mainstay on my PC ever since I first started using multichannel sound. Such a great tool! I have the profile settings correct for sure.

It didn't show any HDMI while I was on nouveau though. I'm thinking perhaps something is off about my nouveau driver because I'd expect it to do 3D acceleration and high res as well. At least I seem to recall it did at one point.

NVIDIA dev Generix posted a suggestion in the NVIDIA thread I made and I applied it yesterday. I'll have time today to listen to 5.1 music for a few hours while I work and I'll keep checking for dropouts.

Will also check the IRQ.
User avatar
MrEen
Level 23
Level 23
Posts: 18345
Joined: Mon Jun 12, 2017 8:39 pm

Re: [Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by MrEen »

The Bright Side wrote: Thu Nov 22, 2018 1:42 am NVIDIA dev Generix posted a suggestion in the NVIDIA thread I made and I applied it yesterday. I'll have time today to listen to 5.1 music for a few hours while I work and I'll keep checking for dropouts.
If it ends up solving the issue, please post the instructions so other can do the same.

Hoping it works for you.
The Bright Side
Level 3
Level 3
Posts: 172
Joined: Thu Jul 12, 2018 3:09 pm

Re: [Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by The Bright Side »

For sure! I was going to give it a few days. I implemented the suggestion two days ago and I haven't been home much, but for the times I've listened since then, I only had one dropout. It's early to tell whether the issue is fixed, just improved or I'm just on a lucky streak. The instructions are:

Use
grep snd /etc/modprobe.d/*
grep snd /lib/modprobe.d/*
to see what kind of module options are already set. Then you might try the options

power_save=0
and
enable_msi=on

e.g. create a file /etc/modprobe.d/99-snd-hdmi.conf containing
options snd-hda-intel power_save=0
options snd-hda-intel enable_msi=on

and run
sudo update-initramfs -u
afterwards, then reboot.
DrCWO
Level 1
Level 1
Posts: 1
Joined: Tue May 25, 2021 4:02 am

Re: [Mint 19] Irregular Audio Dropouts during Multichannel/Surround Music Playback

Post by DrCWO »

Hello,
I also encountered dropouts in my Linux audio. I worked on that and present a hopefully final solution here.

In my scenario I ran a Motu M4 audiointerface on a Raspberry Pi 4. I wanted to stream audio from a virtual audio input (ALSA loopback driver) to the M4 with 192kHz sample rate and four channels. In this scenario I got drop outs here and there. With the linux command "watch -n0.1 --no-title cat /proc/interrupts" I could increase the number of droputs radically so this was my test case.

The process "alsaloop" runs by default in Realtime Scheduling (RT) with max priority of 99 so there is nothing that could be done here.

The reason for the dropouts is, that "alsaloop" will be scheduled too late (despite RT 99) so the ALSA buffer could not be filled right in time.

The solution:
The idea was to give one of the four cores in Pi4 exclusively to the "alsaloop" process. This means: I first select a random core (in my case core 3, but don't use 0!) and disabled it from being used by the kernel scheduler. This can be done via the commandline of the kernel. In Raspbian add the parameter "isolcpus=3" to the string you find in /boot/cmdline.txt and reboot. On other Linux distros you might find the kernel command line in grub.conf. After that core 3 will no more be used by the scheduler. This can be verified with the command "cat /sys/devices/system/cpu/isolated" that now shows 3.

When I now start my "alsaloop" process it will first use one of the cores 0-2 as three is blocked. With the command "taskset -cp 3 <pid of alsaloop>" you assign "alsaloop" to core 3. This means on core 3 ONLY alsaloop will run and stay there. It will never be interruped and can be immediately scheduled if needed. Here <pid of alsaloop> stands for the process ID of "alsaloop" that you can find out issuing "ps -ef"

You can test now with the command "watch -n0.1 --no-title cat /proc/interrupts" if still dropouts occur and they will not!

My example with "alsaloop" is only an example. Each other process writing to the ALSA souncard (e.g. jack or others) that show dropouts can be handled that way. Sure, you loose one core but you win perfect audio playback.

Best DrCWO (May 2021)
Locked

Return to “Sound”