Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm looking for a way to configure HDMI audio output via the command line using pulseaudio. I was able to get it running by using pavucontrol and changing it in the configuration tab, but I need a way to automate the process. I haven't been able to find any documentation at all so far. The system is a lucid install.

Edit: From what I've found, I can use pacmd set-card-profile to do this. However, whenever I try, I get an error like the following (using the default profiles as defined in /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf)

# pacmd set-card-profile 0 hdmi-stereo
Welcome to PulseAudio! Use "help" for usage information.
>>> Failed to set card profile to 'hdmi-stereo'.

# pacmd set-card-profile 0 analog-stereo
Welcome to PulseAudio! Use "help" for usage information.
>>> Failed to set card profile to 'analog-stereo'.

Why can't I change these from command line when pavucontrol works to change them?

share|improve this question
1  
This answer may help you. –  Takkat Sep 29 '11 at 19:43
1  
@Takkat, thanks –  Daenyth Sep 29 '11 at 20:21

3 Answers 3

up vote 9 down vote accepted

I was using the tool wrong. The correct way to do it was pactl set-card-profile 0 output:hdmi-audio. You can get a list of avilable profile names by running pacmd list-cards.

share|improve this answer
    
the 2nd argument (0) is the index of the card (>>> 1 card(s) available. index: 0). the 3rd argument (output:hdmi-audio) is the part before the second semicolon under "profiles:" (e.g. it's "output:hdmi-stereo" from the line output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5400)) –  Elvis Nov 4 '12 at 2:31
    
it's pactl list cards at least in pulseaudio-utils 1:4.0-0ubuntu22 –  int_ua Nov 7 at 9:31

Open a terminal and type:

sudo apt-get install alsamixergui

Then run it (Alt+F2 or press super key):

alsamixergui

A window will open for sound cofiguration...

share|improve this answer
    
I'm not looking to edit mixer levels, I'm looking to configure the audio to use HDMI. I also said I'm not looking for a GUI tool, I need something that I can automate. –  Daenyth Sep 30 '11 at 16:51
    
alsamixergui solution by @decent worked for me on Nvidia ION with 10.04 and now with 12.04, I just launched the command and unmute the channel IEC 958 1 now I have audio... –  user69005 Jun 7 '12 at 8:54

I found a simpler way to do this - on the Hardware tab of the System Settings Sound control, right-click on the profile drop down and select Digital Stereo (HDMI) Output + Analog Stereo input from the list.

share|improve this answer
1  
It needs to be from the command line. –  Daenyth Dec 17 '11 at 20:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.