[SOLVED] Audio Setup through HDMI

New to Debian (Or Linux in general)? Ask your questions here!

[SOLVED] Audio Setup through HDMI

Postby czeekaj » 2018-01-16 01:07

Hello, I was having bit of trouble on debian 9 getting my audio going.
Couldn't figure it out spent a few hours trying to config ALSA.
Btw I am a rookie but Alsa has documentation

Code: Select all
 apt-get purge pulseaudio

I figured how to write my asound.conf So for the newbies out there like me here are the steps.
1. find audio devices.
aplay -l
Code: Select all
Card 0 PCH [HDA Intel PCH], Device 0 and 1 ALC 892 Analog and digital
Card 1  HDA NVidia Device 3 ,7 ,8 , 9 HDMI  0 , 1 ,2 ,3 

You will see a list like above what's importent is the card number and device number. in my case I had two cards and several Nvidea devices for all the ports. Easy to script.
2. set up default device
this will be your config file. It is in /home/'user'
mine looks like this
Code: Select all
pcm.!defualt {
       type hw
       card 1
       device 7
 }
ctl.!default {
       type hw
       card 1
       device 7
}

In my case that's what I needed you can find out with a simple test with Alsa. In my case it told me device 7 was in use but still no audio with pulse must be a bug or something all other devices played but no audio.
Heres the Test to find out what your default should be.
Code: Select all
aplay -D plughw:1,7 /usr/share/sounds/alsa/test.wav
Replace 1,7 with yours as per the first step.
3.like the second step if the file isn't there just create it as Root or Su.
/home/!yourusername!/.asoundrc
mine looks like this
Code: Select all
pcm.dmixer {
   type dmix
   ipc_key 1024
   ipc_key_add_uid false
   ipc_perm 0660
   slave {
      pcm "hw:1,7"
      rate 48000
      channels 2
      format S32_LE
      period_time 0
      period_size 1024
      buffer_time 0
      buffer_size 4096
      }
   }

pcm.!defualt {
      type plug
      slave.pcm "dmixer"
   }

:) Hope it works for you guys too. I read some guys making auto switch scripts. If it was bit easier it'd still be the go to audio, best of all you can read the scripts :).
Edit: Just a /home/user/.asoundrc if you put a file in /etc it will by system wide. It will break alsa mixer and the alsa mixer with ui.If I knew more I'd build a gui for alsa to switch loopbacks.
czeekaj
 
Posts: 16
Joined: 2018-01-09 10:18

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable