[Realtek ALC1220 ASUS PRIME X370] Recording is very slow and plays 10x faster

Bug #1764965 reported by Jacopo
120
This bug affects 23 people
Affects Status Importance Assigned to Milestone
PipeWire
New
Undecided
Unassigned
PulseAudio
New
Undecided
Unassigned
sound-2.6 (alsa-kernel)
New
Undecided
Unassigned
alsa-driver (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Recording applications (audacity, arecord, gnome-sound-recorder) record extremely slowly (at what seems to be 0,1x speed), which means that at playback the sound is played at a very high pitch and much faster than the original.

To help you understand the issue, I've attached an archive containing two files recorded at the same time, one with arecord -f cd and the other with a stand-alone Olympus recorder.
A video of Audacity's behavior when trying to record is also available: https://youtu.be/Fe20eQNvZVA
Look at the seconds hand of the xclock and how much it is moving before Audacity is done recording one second of audio.

Things I've already tried:
* Purging and reinstalling Audacity
* Purging and reinstalling Pulseaudio following the guide on the Ubuntu Wiki
* Running audacity with this command: Exec=env PULSE_LATENCY_MSEC=30 audacity as suggested on AskUbuntu
* Reinstalling Ubuntu on a new hard disk
* Running audacity on a live CD (in Ubuntu version 16.04.3, 17.10.1, 18.04 daily and Xubuntu 17.10.1, 18.04)

The machine is a Ryzen 5 1600 with an ASUS X370 Prime motherboard.

The problem can be reproduced as follows:

* Boot a live DVD of Ubuntu/Xubuntu 16.04.3, 17.10.1, 18.04 (versions I've tested with)
* Install audacity via the terminal
* Start recording, microphone is connected to the rear microphone jack.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: alsa-base 1.0.25+dfsg-0ubuntu5
ProcVersionSignature: Ubuntu 4.13.0-38.43~16.04.1-generic 4.13.16
Uname: Linux 4.13.0-38-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.16
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: jacopo 2417 F.... pulseaudio
 /dev/snd/controlC0: jacopo 2417 F.... pulseaudio
CurrentDesktop: Unity
Date: Wed Apr 18 09:35:50 2018
InstallationDate: Installed on 2018-03-03 (45 days ago)
InstallationMedia: Ubuntu 16.04.3 LTS "Xenial Xerus" - Release amd64 (20170801)
PackageArchitecture: all
SourcePackage: alsa-driver
Symptom: audio
Symptom_AlsaRecordingTest: ALSA recording test through plughw:Generic failed
Symptom_Card: HD-Audio Generic - HD-Audio Generic
Symptom_Jack: Pink Mic, Rear
Symptom_Type: None of the above
Title: [System Product Name, Realtek ALC1220, Pink Mic, Rear] Recording problem
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 03/06/2018
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 3805
dmi.board.asset.tag: Default string
dmi.board.name: PRIME X370-PRO
dmi.board.vendor: ASUSTeK COMPUTER INC.
dmi.board.version: Rev X.0x
dmi.chassis.asset.tag: Default string
dmi.chassis.type: 3
dmi.chassis.vendor: Default string
dmi.chassis.version: Default string
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr3805:bd03/06/2018:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKCOMPUTERINC.:rnPRIMEX370-PRO:rvrRevX.0x:cvnDefaultstring:ct3:cvrDefaultstring:
dmi.product.family: To be filled by O.E.M.
dmi.product.name: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer

Revision history for this message
Jacopo (rad750) wrote :
Revision history for this message
Fabian (fabianhu) wrote :

Same setup and problem here, except it is a ASRock Mainboard, same Realtek ALC1220 Chipset.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in alsa-driver (Ubuntu):
status: New → Confirmed
Jacopo (rad750)
description: updated
Revision history for this message
Jacopo (rad750) wrote :

I'm glad somebody else is affected by this bug...

As of today, the bug is still present in a fully updated Xubuntu 18.04 system.

Revision history for this message
Markus (mhessler) wrote :

Here the same issue with Kubuntu 18.04. on a Asus Prime Z370-A. I hope for fixing this problem.

Revision history for this message
Jacopo (rad750) wrote :

@Markus could you please click on the "Affects mee too" link above the bug report, just under the title? Thanks :)

tags: added: alsa-driver artful audacity bionic
Revision history for this message
Dan Loehr (82abn34) wrote :

I can get the record function to work properly by disabling Pulse and letting ALSA take over but as Pulse is required for so many basic functions, this is only a temporary solution. I'm also running a MOBO with the Realtek ALC1220 codec.

Revision history for this message
Andrii (amnevar) wrote :

I have the same problem and my board is MSI X370 Pro Carbon, (same ALC1220 Chipset). Tried Kubuntu 18.04 and Ubuntu 18.04. Recording with audacity also slow to the extreme. I changed sample rate in audacity to 510000 or 520000 Hz as a temporary workaround, but the sound is very noisy.

Revision history for this message
Andrii (amnevar) wrote :

I've also tried command line tool for sound recording - arecord. And it works, somehow, but sound is very noisy and staticky.

Revision history for this message
Andrii (amnevar) wrote :

Nope, tried again with arecord and it's recording slowly again. The same situation with audacity, sometimes it works and sometimes not.

Revision history for this message
Jacopo (rad750) wrote :

@Andrii I've experienced the same behavior topo... and rebooting seldom fixes the problem.

Revision history for this message
Andrii (amnevar) wrote :

@Jacopo Yes, sometimes. Even restarting audacity or arecord does the trick. What really annoying is the noise level. And, yes I've tried everything under Windows 10 and sound records perfectly. The problem is that I hate too use Windows :)
Oh, I've updated linux kernel to 4.18 and the problem is still there.

Revision history for this message
Dan Loehr (82abn34) wrote :

@Jacopo, I think this problem may be an incompatibility issue between the PulseAudio driver (if driver is the correct term) and the ALC1220 chipset/codec. I used this procedure to disable PulseAudio and found that I could record normally (link follows):

https://kodi.wiki/view/PulseAudio/HOW-TO:_Disable_PulseAudio_and_use_ALSA_(without_removing_PulseAudio)_for_Ubuntu

Disabling PulseAudio will also disable HDMI out. I use the affected machine for home theater so I must enable PulseAudio for that. The linked procedure is simple but requires some time and a reboot. Ultimately, it would be nice for a computer coder (perhaps associated with PulseAudio) to get PulseAudio to work with the ALC1220 chipset/codec.

Revision history for this message
José Miguel Sarasola (alosarjos) wrote :

Hi!

Asus Crosshair VI Hero here with Linux 4.15.0-33-generic on Pop!_OS 18.04 (Ubuntu based). This problem is also affecting me, but I could fix it more or less. I'm using alsa for this specific device, so the audio control center for gnome is still usable and the DisplayPort audio (AMDGPU) is still working.

In my case all I needed to do was loading the module this way:

pacmd load-module module-alsa-source device=hw:1,2

I found the corresponding device using the instructions from this web-page:

https://frdmtoplay.com/gigabyte-front-panel-audio-with-linux/

It will make a duplicate entry on the audio input list of Gnome audio settings, but now recording is working for me.

Once you try the command above and you verify it works, you can add it to the default.pa file of pulse settings (/etc/pulse/default.pa or ~/.config/pulse/default.pa) and add it after the hardware detection (In my case, line 58)

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

load-module module-alsa-source device=hw:1,2 <---- Add this line

Now with pulseaudio -k or restarting everything should be working without needing to do anything

Revision history for this message
Henk717 (henk717) wrote :
Download full text (3.3 KiB)

This bug is potentially the same one as 1716654 and also effects me as a single ALC1220 user (The gigabyte board has a second one which is not the case on the MSI X370 Pro Carbon).

--- Copy from my comment at 1716654 ---
Having the same issue on the MSI X370 Gaming Pro Carbon, audio is fine but the microphone is having weird behavior that differs depending on configuration.

When audacity is launched it will trigger the bug that increases the recording speed to be insanely high pitched and fast. Prior to using audacity i will hear a robotic noise while speaking that is also present as a robotic echo.

Making use of the tsched=0 the robotic distortion is gone but replaced with severe crackling that over time becomes less severe but still very notable.

The following is an export of the alsa source.

    index: 1
 name: <alsa_input.pci-0000_21_00.3.analog-stereo>
 driver: <module-alsa-card.c>
 flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
 state: RUNNING
 suspend cause:
 priority: 9039
 volume: front-left: 32768 / 50% / -18,06 dB, front-right: 32768 / 50% / -18,06 dB
         balance 0,00
 base volume: 6554 / 10% / -60,00 dB
 volume steps: 65537
 muted: no
 current latency: 0,22 ms
 max rewind: 0 KiB
 sample spec: s16le 2ch 48000Hz
 channel map: front-left,front-right
              Stereo
 used by: 1
 linked by: 1
 configured latency: 2,50 ms; range is 0,50 .. 1837,33 ms
 card: 1 <alsa_card.pci-0000_21_00.3>
 module: 8
 properties:
  alsa.resolution_bits = "16"
  device.api = "alsa"
  device.class = "sound"
  alsa.class = "generic"
  alsa.subclass = "generic-mix"
  alsa.name = "ALC1220 Analog"
  alsa.id = "ALC1220 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 0xfe900000 irq 64"
  alsa.driver_name = "snd_hda_intel"
  device.bus_path = "pci-0000:21:00.3"
  sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:21: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 = "352768"
  device.buffering.fragment_size = "176384"
  device.access_mode = "mmap+timer"
  device.profile.name = "analog-stereo"
  device.profile.description = "Analog Stereo"
  device.description = "Family 17h (Models 00h-0fh) HD Audio Controller Analog Stereo"
  alsa.mixer_name = "Realtek ALC1220"
  alsa.components = "HDA:10ec1220,1462da32,00100003"
  module-udev-detect.discovered = "1"
  device.icon_name = "audio-card-pci"
 ports:
  analog-input-front-mic: Front Microphone (priority 8500, latency offset 0 usec, available: yes)
   properties:
    device.icon_name = "audio-input-microphone"
  analog-input-rear-mic: Rear Microphone (priority 8200, latency offset 0 usec, available: no)
   properties:
    device.icon_name = "audio-input-microphone"
  analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
   properties:

Very notable here is the buffe...

Read more...

tags: removed: artful
Revision history for this message
José Miguel Sarasola (alosarjos) wrote :

Coming back from Pop!_OS 18.10 (Based on Ubuntu 18.10, 4.18.0-10-generic)

Still haven't tried with Audacity, but gnome-sound-recorded and Telegram Desktop have been fixed in my case.

All I did this time was setting

default-sample-rate = 48000

on /etc/pulse/daemon.conf and restarting (Probably restarting pulseaudio is enough).

before this, trying to send an audio recording through Telegram would end in an "muted" audio. Now it's working perfectly.

You can try with arecord

arecord -f cd -d 10 test.wav -> For recording
aplay test.wav -> For playing (Probably gonna end up in noise)

arecord -f cd -d 10 -r 48000 test-mic.wav -> recording with the 48000 sample rate should provide good results

PD: Remember to increase a bit the mic volume from the sound settings

Revision history for this message
Don Bowman (donbowman) wrote :

Observing on Focal 20.04 on ROG STRIX X470-I, same ALC1220 audio device.

Its intermittent, sometimes audacity will record properly. Sometimes it will record slow and playback fast.

its not just audacity, e.g. chrome observes same affect (https://mictests.com/)

bumped kernel to 5.7.6-050706-generic from mainline, same affect
alsa-base 1.0.25+dfsg-0ubuntu5, pulseaudio 1:13.99.1-1ubuntu3.3

Revision history for this message
S (seymourtoa) wrote :

This is also problematic for me. Has anyone had actual success with a fix? please Thanks.

pulseAudio x ALC1220 = Unusable Condenser Microphone

Operating System: Manjaro Linux
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.2
Kernel Version: 5.10.68-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 2600X Six-Core Processor
Memory: 15.6 GiB of RAM
Graphics Processor: AMD Radeon ™ RX 470 Graphics
ASUS x370 Crosshair Hero VI wifiac

Revision history for this message
Thomas-Thomas (thomas-thomas) wrote :

I could fix it by executing the following workaround:
pacmd load-module module-alsa-source device=hw:2,2

The actual hw numbers might vary, depending on your specific board and how many other audio devices you have connected.

Now I have switched to pipewire and that doesn't work anymore.
I even tried by replacing pacmd by pw-cli, but I get:

pw-cli load-module module-alsa-source device=hw:2,2
Error: "Could not load module"

Any hints?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.