(In reply to Ernst Sjöstrand from comment #240)
> (In reply to Takashi Iwai from comment #237)
> > What if you remove azx_get_delay_from_fifo assignment to get_delay[0/1],
> > together with dropping SNDRV_PCM_INFO_BATCH flag?  Still getting the same
> > problem?
> 
> I getting the crackling mic input if I do that yes.

And you didn't get the same crackling mic input with patch no.2?
If so, there are still two differences:
- The patch2 calculates the delay from the register
- The patch2 applies the delay also for the playback

But the second point shouldn't influence on the recording quality.  Then
it's about the first point, and it can be changed like:

--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -866,8 +866,8 @@ static unsigned int azx_get_pos_fifo(struct azx *chip, 
struct azx_dev *azx_dev)
        if (!runtime)
                return pos;
 
-       runtime->delay = AMD_FIFO_SIZE;
-       delay = frames_to_bytes(runtime, AMD_FIFO_SIZE);
+       delay = snd_hdac_stream_readw(azx_stream(azx_dev), SD_FIFOSIZE) + 1;
+       runtime->delay = bytes_to_frames(runtime, delay);
        if (azx_dev->insufficient) {
                if (pos < delay) {
                        delay = pos;


FWIW, the second point can be changed even more simply.

--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -878,7 +878,7 @@ static unsigned int azx_get_pos_fifo(struct azx *chip, 
struct azx_dev *azx_dev)
        }
 
        /* correct the DMA position for capture stream */
-       if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
+       if (1 /*substream->stream == SNDRV_PCM_STREAM_CAPTURE*/) {
                if (pos < delay)
                        pos += azx_dev->core.bufsize;
                pos -= delay;


Let us know if any of these (with/without the get_delay disablement) makes 
improvement.

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1801540

Title:
  Microphone distorted sound on ALC892/1220 on AMD chipsets

Status in Linux:
  Confirmed
Status in linux package in Ubuntu:
  Won't Fix
Status in pulseaudio package in Ubuntu:
  Won't Fix

Bug description:
  Not sure if I'll report this upstream but there is definitely an issue
  with microphone recording on my desktop, this is not happening on my
  laptop which has a different codec.

  Already tried all workarounds possible, no luck. Only with my desktop
  with this particular motherboard. No issues in Windows, the sound
  recorded in there is distorted and has some static and robotic tone on
  high-pitch.

  alsa-info on the attachments

To manage notifications about this bug go to:
https://bugs.launchpad.net/linux/+bug/1801540/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to