0

Hello everyone I'm Use laptop + external monitors, and i need use monitor speaker and i can't see HDMI card in alsamixer, when reviewing command [ aplay -l ] result =

[void@base ~]$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: PCH [HDA Intel PCH], device 0: CX20757 Analog [CX20757 Analog] Subdevices: 0/1 Subdevice #0: subdevice #0 card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [BenQ EX2710] Subdevices: 1/1 Subdevice #0: subdevice #0 

and when reviewing command

[void@base ~]$ cat /proc/asound/modules 0 snd_hda_intel 

other thing : I'm using void-base system and some xorg services and dwm window manager

allright i need know how to set HDM card to defult audio card

1
  • Default - for what? My guess is that if you have a desktop environment with X, you just use pipewire, which will give you multiple audio streams and the ability to set a default sounds device for applications. Commented Dec 9, 2023 at 23:53

1 Answer 1

0

Note that in this case, there is just one audio card (card 0), with multiple output devices, one of which is the HDMI output.


PulseAudio/Pipewire

If you use PulseAudio or Pipewire, they should automatically remember the chosen output device for each audio-producing application if you choose it once, and for programs that have not produced audio before, they will use whichever output is marked the "fallback" with pavucontrol or similar PulseAudio configuration tool.

If you need to do this on the command line, first make sure the correct card profile is used. Use pactl list cards to find the card names and the available profiles for each:

pactl set-card-profile <card name> <profile name> 

For HD Audio integrated in an Intel chipset, it would probably be something like:

pactl set-card-profile alsa_card.pci-0000_00_1f.3 output:hdmi-stereo+input:analog-stereo 

Then run pactl list sinks and find the sink name and port names for your audio card. In the output, it will look like this:

Sink #<sink number> State: SUSPENDED Name: <here's the sink name you're looking for> [...some stuff indented at this level...] Properties: [...a lot of stuff indented at this level...] Ports: <here are the port names> Active Port: <something> Formats: [...] 

Since you apparently have the HD Audio integrated into Intel chipset, the sink name is most likely alsa_output.pci-0000_00_1f.3.hdmi-stereo. Then find the names of the ports available for that sink in the Ports: section for that sink. It might be something like hdmi-output-0.

Once you know the names, you can use them in a commands like this:

pactl set-sink-port <sink name or number> <port name> 

i.e. probably something like this:

pactl set-sink-port alsa_output.pci-0000_00_1f.3.hdmi-stereo hdmi-output-0 

For PulseAudio, you could make it a system-wide default by adding the set-sink-port command to /etc/pulse/default.pa:

set-card-profile alsa_card.pci-0000_00_1f.3 output:hdmi-stereo+input:analog-stereo set-sink-port alsa_output.pci-0000_00_1f.3.hdmi-stereo hdmi-output-0 

But note that any remembered per-user and per-application settings will normally override the system-wide PulseAudio defaults anyway.


Plain ALSA

If you use just plain ALSA, then you could place something like this in your ~/.asoundrc:

defaults.pcm.!card 0 defaults.ctl.!card 0 defaults.pcm.!device 3 defaults.ctl.!device 3 
3
  • thanks for that, but i have one problem void-linux don't use system-d, for that i can't use any command ended by ....ctl Commented Dec 13, 2023 at 23:08
  • PulseAudio pactl has nothing to do with systemd; it comes from pulseaudio-utils package. The fact that the name is similar to systemd tools is just a coincidence (or maybe shared freedesktop.org practices influencing both). pactl also works with Pipewire. Anyway, I also told you how to deal with plain ALSA; Void Linux documentation suggests ALSA, optionally combined with either Pipewire, Pulseaudio or sndio. I have no experience on sndio; I have covered all I could. Commented Dec 14, 2023 at 6:18
  • thanks for help me Commented Dec 15, 2023 at 9:22

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.