LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-08-2015, 05:00 AM   #1
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,148

Rep: Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308
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.

Last edited by business_kid; 03-08-2015 at 05:52 AM.
 
Old 03-08-2015, 08:31 AM   #2
chemfire
Member
 
Registered: Sep 2012
Posts: 414

Rep: Reputation: Disabled
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" }
  }
}
 
1 members found this post helpful.
Old 03-08-2015, 10:10 AM   #3
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
do you really have to create a ~/.asoundrc to get the output via HDMI ?
is there no way to switch dynamically?
 
Old 03-08-2015, 11:30 AM   #4
Nh3xus
Member
 
Registered: Jan 2013
Location: France
Distribution: Slackware 14.1 32 bits
Posts: 211

Rep: Reputation: 57
Quote:
Originally Posted by a4z View Post
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.
 
Old 03-08-2015, 12:56 PM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,148

Original Poster
Rep: Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308
@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.
 
Old 03-08-2015, 03:43 PM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,148

Original Poster
Rep: Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308
/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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect computer hdmi outport to TV hdmi inport. ostene Linux - Software 2 07-04-2014 06:33 AM
Is it possible to play Blu Ray through a video card HDMI output to HDMI TV? SharpyWarpy Linux - Hardware 5 10-28-2012 01:01 AM
[ProLiant MicroServer, ATI R6xx HDMI, Digital Out, HDMI] No HDMI sound at all vnatius Linux - Hardware 15 08-16-2012 01:09 PM
HDMI Audio doesn't work - Debian Squeeze (Intel HDMI) felipefv Linux - Hardware 8 02-06-2012 09:47 AM
Distorted sound as though its too loud, even at low volume. neocookie Linux - General 2 10-18-2007 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration