LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Sound on hdmi & earphone jack (https://www.linuxquestions.org/questions/slackware-14/sound-on-hdmi-and-earphone-jack-4175600289/)

business_kid 02-21-2017 10:13 AM

Sound on hdmi & earphone jack
 
Back in early 2015 I had a problem with getting a sound setup for a projector in a hall. Usually, I needed to stream to hdmi, but to accommodate translation, I needed video on hdmi and sound on the earphone jack. Some kind soul sent me an alsa config piece on resampling the hdmi, (mine had digital going to audio giving fierce noise) and gave me an explanation (digital --> analogue) and I had an ~/.asoundrc which I put in via a script that switched from jack to hdmi.

Now I have updated, deleted the resampling config not realising what it was, and only this morning cleared the backup. It's intel hda. Does anyone have the resampling config magic for alsa, or pulseaudio. I think I found the .asoundrc with a thread searchhttp://www.linuxquestions.org/questi...io-4175533450/

frushiyama 02-22-2017 06:07 AM

Are you using 14.1 from 2015, 14.2 or current? You could use apulse to manage sound interfaces instead of .config files from alsa.

business_kid 02-23-2017 04:55 AM

I have 14.2 installed, with no sound on hdmp at the moment, nor does it show in pavucontrol. I don't run pulseaudio, and have been relying on alsa, but that can change. The soundcard shows this way:
Code:

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

ATM, everything goes to speakers. When I open vlc, it mutes headphones and S/PDIF (Whatever that is). In the past, HDMI sounded absolutely congenitally deformed until I resampled it. It's a bottom quality sound chip, but I'm not stressed as long as I can get some control of it again. Despite rc.pulseaudio not being executable, something is starting it :-o. To put it mildly, it's not set up :-P.
Can it be done with pulse audio? I'll drag my sound system into the 21st century if necessary.

EDIT: My ideal would be to have hdmi take the sound when plugged in unless I did something to send it to speakers/earphones.

I set up a luser back in 2015 for use in the hall, in case others had to use my pc. As it turned out, they did because people couldn't configure m$ windows or MacOS as well as LQ helped me to configure linux. I played a video as that user. I lost X immediately, froze the pc, nobbled keyboards, but the audio worked perfectly in speakers - earphones. I presume vlc was running that. That means vlc's oddities are related to my user config.

business_kid 02-23-2017 05:37 AM

Solved this. A copy of the resampling config turned out to be buried in the extra luser's directory, and I attach it here. The rest of this is basic housekeeping, and if I have an issue I'll post.
Code:

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

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" }
  }
}

This is switched in to give sound on hdmi. It is switched out to give sound on speakers. No autodetect, but great for the distortion issue I was having.


All times are GMT -5. The time now is 11:50 AM.