LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   HDMI loud and distorted. Any suggestions? (https://www.linuxquestions.org/questions/slackware-14/hdmi-loud-and-distorted-any-suggestions-4175536086/)

business_kid 03-08-2015 05:00 AM

HDMI loud and distorted. Any suggestions?
 
I have Slackware-Current (09/2014) on an I3 based Samsung NP350 with Panther Point chipset. Alsa is installed & configured for sound, although pulseaudio is installed (but not used) because I needed it for some compile and it seems like a major PITA to configure.

lspci & aplay-l are as follows
Code:

00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
bash-4.3$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC269VC Analog [ALC269VC Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Sound defaults to the speakers/earphone. As aplay shows, it's all card0, device 0 is speakers/earphone, device 3 is hdmi. My first attempt at this was simply use an ~/.asoundrc which made device 3 the default. HDMI was too loud and distorted horribly.
Second attempt was the enclosed ~/.asoundrc,
Code:

  pcm.hdmi_hw {
            type hw
            card 0
            device 3
    }
    ctl.!hdmi_hw {
            type hw
            card 0
            device 3
    }
    pcm.!default {
            type plug
            slave.pcm "softvol"
    }
    pcm.softvol {
            type softvol
            slave {
                    pcm "dmix"
            }
            control {
                    name "Pre-Amp"
                    card 0
            }
            min_dB -20.0
            max_dB 0.0
            resolution 11
    }

which google found for me and gives me a hdmi volume control in alsamixer, but still has the distortion. Here is a sample
https://onedrive.live.com/?cid=99361...4096FF2C07!208
You want the file: Voice\ 010.m4a
Sorry about the weird file type - it was recorded on a phone. mplayer handles it without issue.

Any ideas here? The sample has a low backing music and commentary. The sound reminds me of an over driven device - probably an input. I can get it down to reasonable levels at the output, but that's not good enough, it seems.

EDIT: Just noticed that muting the S/PDIF in alsamixer kills the sound in hdmi. If I could CONTROL that, then I might get somewhere. But alsamixer shows no control for that. Just some little mute box.

chemfire 03-08-2015 08:31 AM

You almost certainly need a rate convert to take everything to 48K and you probably need to change the buffering, that has been my experience. S/PDIF is an binary thing not sure what you mean by control that.

Try this:

Code:

pcm.hdmi_hw {
  type hw
  card 0    # <--- card number
  device 3  # <--- device number
}

pcm.dmixer {
        type dmix
        ipc_key 1024
        slave {
        pcm "hdmi_hw"
        buffer_size 32768
        rate 48000
        period_time 0
        period_size 1024
        buffer_time 0
        }}

pcm.rate_convert {
        type plug
        slave { pcm "dmixer"
              }
}

pcm.hdmi_complete {
  type softvol
  slave { pcm "rate_convert" }
  control.name "Master"
  control.card 0
}

pcm.null_capture {
  type null
}

pcm.!default {
  type asym
  playback.pcm {
    type plug
    slave { pcm "hdmi_complete" }
  }
  capture.pcm {
    type plug
    slave { pcm "null_capture" }
  }
}


a4z 03-08-2015 10:10 AM

do you really have to create a ~/.asoundrc to get the output via HDMI ?
is there no way to switch dynamically?

Nh3xus 03-08-2015 11:30 AM

Quote:

Originally Posted by a4z (Post 5328717)
is there no way to switch dynamically?

I've heard of some udev rules that would help you doing that with vanilla Alsa, but I can't find it right now. :(

Either way, dynamic sound switching is one of the reasons that led Lennart to create PulseAudio.

business_kid 03-08-2015 12:56 PM

@chemfire: That ~/.asoundrc looks a piece of genius. resampling makes sense. I will try that.

I think (repeat think) that the hdmi plug can be sensed, and so if I define it correctly, it doesn't see a hdmi output unless one is there. This whole area is so poorly defined that I'm prepared to fiddle with an asoundrc for the few times I want hdmi.

business_kid 03-08-2015 03:43 PM

/takes hat off

@chemfire: That ~/.asoundrc does the trick - I get clear loud but undistorted hdmi sound, and I think I have a volume control for it due to the bits in my asound.state.

The one thing I lack is plug-ability on the hdmi. If I pull the hdmi, the sound still goes to the hdmi until I remove the asoundrc. I can move it out of the way, because I use hdmi rarely.

Thanks for that


All times are GMT -5. The time now is 09:35 PM.