How to change the default output device?

Hi guys, I’m using Open Suse 13.1. I connect my monitor into my notebook using a HDMI connector (the monitor has no sound output) and I connect my speakers using a standard P2 connector. The problem is that everytime I boot my system, I have to manually change the input device from “HDMI / DisplayPort” to “Analog Output”. Here is a printscreen:

http://s7.postimg.org/iiorj3zzv/Screenshot_from_2014_03_27_17_16_37.png

How do I set the option “Analog Output” as default, so I don’t have to change it in everyboot?

Create an executable script, located in ~/.config/autostart/, and use xrandr to set the default display output.

Are you sure I can set sound properties with xrandr? I read the manual and I only found settings about chosing the monitor, screen size and rotation, but nothing related to sound.

Here are some additional information:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC282 Analog [ALC282 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

(card 0 device 3 is the problematic HDMI)

$ cat /proc/asound/cards
 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xf7910000 irq 48

And this is my YaST audio config:
http://s23.postimg.org/5ufbhbfqz/Screenshot_from_2014_03_28_11_22_42.png
http://s18.postimg.org/r3jgq201l/Screenshot_from_2014_03_28_11_22_50.png

Please help :frowning:

Sorry, I thought you were referring to display outputs, not sound I/O. Forget the previous advice.

Are you using PulseAudio? If so, you can view your current default devices with

pactl stat

and list all available with

pactl list

You may want to consider installing ‘pavucontrol’ to graphically check/set the default audio output.

How do I know if I’m using Pulse Audio? Is it better than Alsa? Here is the output of the commands you posted:

$ pactl statCurrently in use: 167 blocks containing 452.5 KiB bytes total.
Allocated during whole lifetime: 13360444 blocks containing 1.6 GiB bytes total.
Sample cache size: 24.0 KiB
Server String: unix:/run/user/1000/pulse/native
Library Protocol Version: 29
Server Protocol Version: 29
Is Local: yes
Client Index: 130
Tile Size: 65472
User Name: renatov
Host Name: hellnote.nymphetamine
Server Name: pulseaudio
Server Version: 4.0-270-g9490a-rebootstrapped
Default Sample Specification: s16le 2ch 44100Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.pci-0000_00_1b.0.hdmi-stereo
Default Source: alsa_input.pci-0000_00_1b.0.analog-stereo
Cookie: fd08:e4a8
$ pactl list

(... the output is too big, this is the part that probably says about the priorities ...)

Card #0
    Name: alsa_card.pci-0000_00_1b.0
    Driver: module-alsa-card.c
    Owner Module: 6
    Properties:
        alsa.card = "0"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0xf7910000 irq 48"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1b.0"
        sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "1e20"
        device.product.name = "7 Series/C210 Series Chipset Family High Definition Audio Controller"
        device.form_factor = "internal"
        device.string = "0"
        device.description = "Built-in Audio"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    Profiles:
        input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 60, available: yes)
        output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6000, available: yes)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6060, available: yes)
        output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5400, available: yes)
        output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5460, available: yes)
        off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
    Active Profile: output:analog-stereo
    Ports:
        analog-input-internal-mic: Internal Microphone (priority: 8900, latency offset: 0 usec)
            Properties:
                device.icon_name = "audio-input-microphone"
            Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:hdmi-stereo+input:analog-stereo
        analog-input-mic: Microphone (priority: 8700, latency offset: 0 usec, not available)
            Properties:
                device.icon_name = "audio-input-microphone"
            Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:hdmi-stereo+input:analog-stereo
        analog-output: Analog Output (priority: 9900, latency offset: 0 usec)
            Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo
        analog-output-speaker: Speakers (priority: 10000, latency offset: 0 usec, not available)
            Properties:
                device.icon_name = "audio-speakers"
            Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo
        analog-output-headphones: Headphones (priority: 9000, latency offset: 0 usec, available)
            Properties:
                device.icon_name = "audio-headphones"
            Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo
        hdmi-output-0: HDMI / DisplayPort (priority: 5900, latency offset: 0 usec, available)
            Properties:
                device.icon_name = "video-display"
                device.product.name = "W2353"
            Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:analog-stereo

The package pavucontrol is already installed, here is a screenshot. Do I have to change something?

Here’s some reading for you.

http://tuxradar.com/content/how-it-works-linux-audio-explained

http://en.opensuse.org/SDB:Sound_concepts

The package pavucontrol is already installed, here is a screenshot. Do I have to change something?

Can you not set the desired profile under ‘Configuration’?

See the following:

http://askubuntu.com/questions/166953/how-to-make-pavucontrol-changes-permanent

If this isn’t of help, hopefully someone more knowledgeable can assist further.

Unfortunately it’s different on OpenSUSE, but for my luck, after reading your suggestions and some other links, I was able to kind of solve this problem by blacklisting the module snd_hda_codec_hdmi. I added this line to /etc/modprobe.d/50-blacklist.conf

blacklist snd_hda_codec_hdmi

To be honest, this isn’t what I was looking for, I didn’t want to disable HDMI audio completly, I would rather set it as a low priority audio output and define my built in audio as default. BUT, I got this going for now… thanks for the help!

Hi,

I have the same issue - using v13.1, and the system keeps on defaulting to HDMI sound.

I change to built in analog stereo - but this changes after a PC reboot.

What is the solution - how do i change permanently the default to the analog built in output - which configuration file is not being written to by the KDE desktop utility ?. Thanks.

Regards,

Shadders.

What is the order of the drivers in Yast-sound??

Hi,

Thanks for the reply - not sure how to check this - Yast-Sound

Is this a GUI operation or command line ?. Thanks.

Regards,

Shadders.

Start YaST, then select ‘Hardware’, then ‘Sound’. You should be able to see the card order. (Alternatively, examine /etc/modprobe.d/50-sound.conf for card order.)

Hi,

Thanks - i can only see the Intel HDA driver - snd-hda-intel.

Hence not sure why HDMI is being selected in Configure Desktop -> Multimedia -> Audio and Video Settings - which seems to override all others. Thanks.

Regards,

Shadders.

Do you have pavucontrol installed? If not, install it. Then check default configuration from there.

Hi Deano,

Thanks - i installed the pavucontrol - and it uses the KDE system defaults - hence reverts to HDMI audio - so is the next step to specify the Intel HD audio only in a configuration file - if so, which is the best approach ?.

Thanks and regards,

Shadders.

In the pavucontrol ‘Configuration’ menu, it should be possible to see various profiles listed, and turn off any unwanted profiles from there. Important configuration files affecting the default output (sink) are /etc/pulse/default.pa (system-wide) and ~/.config/pulse/ contains user PA configuration files.

The advice in these threads may be helpful:

https://bbs.archlinux.org/viewtopic.php?id=164868

  • In particular, post#5 for changing system-wide PA settgins

http://askubuntu.com/questions/15497/how-to-remove-nvidia-hdmi-audio-output-in-pulseaudio

Hi Deano,

Apologies for the late reply.

I made the changes today - this has worked for the Config Desktop -> Audio and Video Settings -> Hardware - now defaults to Analog Stereo.

The Device Configuration is still defaulting to the HDMI.

I have not added the “set-default-sink 1” yet - so is this the issue ?. Thanks.

Regards,

Shadders.

Hi Deano,

I added the change - and it still does not make the change permanent.

I apply the setting for Device Configuration - go back to the System Settings panel - then back again to the Multimedia -> Audio and Video Settings LH Pane selection -> Audio Hardware Setup Tab - and it has reverted to HDMI.

This action seems to indicate that it is not writing to the configuration file- and will not if it is root writeable only.

Is it possible to run the System Settings as root when logged in as a normal user .

Thanks and Regards,

Shadders.