Audio sounds fine on Youtube but is distorted on Clementine and SMmplayer

Hello everyone.

In the last 6 months I am trying to make Manjaro Linux my default/main OS.
My daily driver sort of speak.
Now that Steam is so good and Bottles can handle my Diablo needs, I see no reason not to.

But last month I had the misfortune that my onboard sound card Failed/Died somehow and
I was forced to buy a new PCI-express sound card.

$ inxi -A
Audio:
Device-1: C-Media CMI8738/CMI8768 PCI Audio driver: snd_cmipci
Device-2: AMD Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]
driver: snd_hda_intel
Sound API: ALSA v: k6.0.0-1-MANJARO running: yes
Sound Server-1: PulseAudio v: 16.1 running: yes
Sound Server-2: PipeWire v: 0.3.58 running: yes


When I play a video on Youtube, it all sounds normal/OK.

But when I play an MP3 on Clementine or a video file on SMplayer, it sounds distorted.

In order to give you an exact idea/picture of what I am hearing, I recorded a small
10-second sample with my phone and I uploaded it as an unlisted video on Youtube on this link:

  • In my Windows 10 system, the audio card sounds fine on all scenarios,
    youtube, video player, audio player…etc

  • Has anyone encountered anything like this?

The fact that it sounds just fine in the browser/Youtube scenario,
makes me think that I might have misconfigured something.
Is there a way for me to do a TOTAL RECAL or RESET of my sound setup on Manjaro?

  • Any suggestion would be appreciated.

If you need more data from my side, please ask.

PS:
I have disabled the onboard Realtek Sound card via the BIOS,
since it was unusable anyway.

Hello @logan11 :wink:

Your sample sounds pretty much like slow motion audio… :face_with_peeking_eye:

So if in your browser everything works correct, then there must be an issue with smplayer/clementine or pipewire/pulseaudio.

Maybe the problem is just that both are running:

Disable one of them:

systemctl --user disable --now pulseaudio

Hi @megavolt

I tried both commands but the distortion remains:

$ sudo systemctl --user disable --now pipewire
Failed to connect to bus: No medium found

$ sudo systemctl --user disable --now pulseaudio
Failed to connect to bus: No medium found

$ inxi -A

Audio:
Device-1: C-Media CMI8738/CMI8768 PCI Audio driver: snd_cmipci
Device-2: AMD Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]
driver: snd_hda_intel
Sound API: ALSA v: k6.0.0-1-MANJARO running: yes
Sound Server-1: PulseAudio v: 16.1 running: yes
Sound Server-2: PipeWire v: 0.3.58 running: yes

It is a user service and not a system service, so without sudo…

Thank you for the tip megavolt

I got these messages:

[logan@loganman ~]$ systemctl --user disable --now pipewire
Warning: Stopping pipewire.service, but it can still be activated by:
pipewire.socket

[logan@loganman ~]$ systemctl --user disable --now pulseaudio
Warning: Stopping pulseaudio.service, but it can still be activated by:
pulseaudio.socket

[logan@loganman ~]$ inxi -A
Audio:
Device-1: C-Media CMI8738/CMI8768 PCI Audio driver: snd_cmipci
Device-2: AMD Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]
driver: snd_hda_intel
Sound API: ALSA v: k6.0.0-1-MANJARO running: yes
Sound Server-1: PulseAudio v: 16.1 running: yes

Clementine still sounds distorted though.

Aha!
Plot Twist / Update

If the Youtube video is playing in the background, and I play something simultaneously on Clementine and/or SMplayer, then they sound fine.
Even if I MUTE the youtube video but sill let it play in the background, the other two programs sound just fine.

How the heck is that happening?

The plot thickens!!!

Your sample sounds pretty much like slow motion audio

If audio seems to be playing at incorrect speed it would be either:

  • Failure to resample sink-input stream to sink output stream
  • A resampling error in either the audio player or PulseAudio
  • Audio playback speed has been changed in audio player

I suggest checking PulseAudio configuration settings for resampling and sample rates

pulseaudio --dump-conf | grep sampl

and the Sample Specification for PulseAudio sink outputs

pactl list sinks

And check sink-inputs for all audio players in different audio states

pactl list sink-inputs

I expect the optimal and sub-optimal sink-inputs will have differences in Sample Specification

You are right on the money nikgnomic.

The first command shoes this:

$ pulseaudio --dump-conf | grep sampl
resample-method = auto
avoid-resampling = no
default-sample-format = s16le
default-sample-rate = 44100
alternate-sample-rate = 48000
default-sample-channels = 2

When the sound is problematic I see this output:

$ pactl list sinks | grep “Sample Specification”
Sample Specification: s16le 2ch 48000Hz
Sample Specification: s16le 2ch 48000Hz

$ pactl list sink-inputs | grep “Sample Specification”
Sample Specification: s16le 2ch 48000Hz
Sample Specification: s16le 2ch 48000Hz

When I start playing the Youtube video simultaneously and the sound is normal,
the output changes to this:

$ pactl list sinks | grep “Sample Specification”
Sample Specification: s16le 2ch 48000Hz
Sample Specification: s16le 2ch 48000Hz

$ pactl list sink-inputs | grep “Sample Specification”
Sample Specification: s16le 2ch 44100Hz
Sample Specification: float32le 2ch 48000Hz

How can I TELL to the audio card “you will use 44100Hz and you will LIKE it…”?

CMI8738 is an old audio codec (1990s) but should be able to play s16le 48000Hz if it is Legacy audio SB16™ compatible
Brief Notes on C-Media 8338/8738/8768/8770 Driver — The Linux Kernel documentation

How can I TELL to the audio card “you will use 44100Hz

reconfigure the alternate-sample-rate from 48000Hz to 44100Hz

tee ~/.config/pulse/daemon.conf <<< 'alternate-sample-rate = 44100'

I also suggest changing resample-method to use speex resampler (to maintain audio quality if audio is downmixed from 48000Hz)

tee --append ~/.config/pulse/daemon.conf <<< 'resample-method = speex-float-3'

Reboot system or restart PulseAudio to load user reconfigurations

systemctl --user restart pulseaudio

I would like to thank you @nikgnomic and @megavolt for your time and efforts.
Your tips helped me to learn a little bit more about how the audio system works in Linux.

Unfortunately I was not able to fix the issue. I tried to implement the solution but no luck.
I even tried different Live CDs to test the audio.

  • Manjaro KDE Live CD
  • Kubuntu Live CD
  • Current Linux Mint Live CD
  • Older Linux Mint Live CD (released on 2017-2018)

In all the cases the Audio playback issue was as problematic as described in the original post.

I was thrown back to the fist “dates” I had with Linux, in the early 2000s
when I was trying distros like Mandrake, Suse…etc.
It was the time of software-assisted 56 kbps modems and software-assisted onboard audio cards.
Which naturally did not have any drivers so the experience was like a silent movie of the 1920s.


So I decommissioned my problematic motherboard (Asus PRIME-X570-P)
which I will reuse as a home NAS or something.

I bought a new motherboard (MSI MAG B550 TOMAHAWK) which seems to work OK.

I think they even both have the same Audio Codec / Chip.

Anyway now my Audio device setup looks like in the screenshot, and it plays audio and video fine.
I guess the new audio chip is named “AMD Starship/Matisse HD Audio” now,
and not Realtek… or something like it was on the old one.

I will leave it as is now for fear that if I cough or even look at it a funny way,
it may commit suicide just to spite me.

Thank you again for your time.

PS:
I don’t know if this counts as a “Resolved” type of conclusion.
I guess not because the CMedia card was working fine on Windows 10.
I just could not get it to work on Linux.

I am marking your comment as the solution because a modern onboard audio device is capable of much better quality and reliability than the CMI card on any OS

MSI specifications show that under the generic AMD Starship/Matisse name this motherboard has a Realtek ALC1200 codec, that can support studio quality audio up to 24bits/192kHz
But for real world use, it can run HD audio (24bits/48kHz) easily with minimal additional load on the rest of the system

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.