0

I followed this solution and set up my pulseaudio system to work on multiple audio channels. But a problem I was facing was that the changes in /etc/pulse/default.pa were not taking effect on pulseaudio restart. So I added a script file with those changes and ran that.

pactl set-card-profile 0 output:hdmi-stereo 
pactl set-default-sink alsa_output.pci-0000_00_0e.0.hdmi-stereo

the above steps are necessary for some reason to get audio out of hw:0,3 (hdmi-stereo) & hw:0,0 (analog-stereo). without them i only get audio from hw:0,0.

tested with the following

#aplay -D plughw:0,3 /usr/share/sounds/alsa/Front_Right.wav #aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Right.wav

pactl load-module module-alsa-sink device=hw:0,0 sink_name=analog pactl load-module module-alsa-sink device=hw:0,3 sink_name=hdmi pactl load-module module-alsa-sink device=hw:1,0 sink_name=usb pactl load-module module-combine-sink sink_name=combined slaves=analog,hdmi,usb pactl set-default-sink combined

I have 3 sinks defined but only 2 have audio simultaneously. But I think that has to with modifying default-sample-channels to the correct number. But the real problem is how poor the audio quality is. When there was only 1 sink the audio was a lot clearer. No problems. But after this change the audio is barely recognizable when it plays. I can't switch between different channels without restarting the whole system. Any ideas or docs to help improve these would be greatly appreciated.

Editing this to mention what the 3 audio channels are. I have HDMI ports, USB and a 3.5mm jack. I need the audio to go through all these at the same time.

Update: I realised that I'm running my pulseaudio in system mode, the exact file to be modified was system.pa and not the default.pa. That was why the earlier changes had no effect. I tried adding those lines to system.pa and restarting pulseaudio but the that also kept failing with the following message

Stopped PulseAudio system server.
Starting PulseAudio system server...
Running in system mode, but --disallow-exit not set.
Running in system mode, but --disallow-module-loading not set.
Running in system mode, forcibly disabling SHM mode.
Running in system mode, forcibly disabling exit idle time.

OK, so you are running PA in system mode. Please make sure that you actually do want to do that. Please read http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/ for an explanation why system mode is usually a bad idea. Failed to load module "module-alsa-sink" (argument: "device=hw:0,0 sink_name=analog"): initialization failed. pulseaudio.service: Main process exited, code=exited, status=1/FAILURE Failed to start PulseAudio system server. pulseaudio.service: Unit entered failed state. pulseaudio.service: Failed with result 'exit-code'.

:~$ pactl list cards
Card #0
    Name: alsa_card.pci-0000_00_0e.0
    Driver: module-alsa-card.c
    Owner Module: 1
    Properties:
        alsa.card = "0"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0x82510000 irq 130"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:0e.0"
        sysfs.path = "/devices/pci0000:00/0000:00:0e.0/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        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)
        output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (sinks: 1, sources: 0, priority: 5200, available: no)
        output:hdmi-stereo-extra1+input:analog-stereo: Digital Stereo (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5260, available: yes)
        output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 100, available: no)
        output:hdmi-surround-extra1+input:analog-stereo: Digital Surround 5.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes)
        output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 100, available: no)
        output:hdmi-surround71-extra1+input:analog-stereo: Digital Surround 7.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes)
        output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (sinks: 1, sources: 0, priority: 5200, available: no)
        output:hdmi-stereo-extra2+input:analog-stereo: Digital Stereo (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5260, available: yes)
        output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 100, available: no)
        output:hdmi-surround-extra2+input:analog-stereo: Digital Surround 5.1 (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes)
        output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 100, available: no)
        output:hdmi-surround71-extra2+input:analog-stereo: Digital Surround 7.1 (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes)
        off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
    Active Profile: output:analog-stereo+input: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, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1+input:analog-stereo, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2+input:analog-stereo
        analog-input-headphone-mic: Microphone (priority: 8700, 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, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1+input:analog-stereo, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2+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
        hdmi-output-0: HDMI / DisplayPort (priority: 5900, latency offset: 0 usec, available)
            Properties:
                device.icon_name = "video-display"
                device.product.name = "MSI MP243"
            Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:analog-stereo
        hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, not available)
            Properties:
                device.icon_name = "video-display"
            Part of profile(s): output:hdmi-stereo-extra1, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1, output:hdmi-surround71-extra1+input:analog-stereo
        hdmi-output-2: HDMI / DisplayPort 3 (priority: 5700, latency offset: 0 usec, not available)
            Properties:
                device.icon_name = "video-display"
            Part of profile(s): output:hdmi-stereo-extra2, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2, output:hdmi-surround71-extra2+input:analog-stereo

Card #1
    Name: alsa_card.usb-BurrBrown_from_Texas_Instruments_USB_AUDIO_DAC-00
    Driver: module-alsa-card.c
    Owner Module: 2
    Properties:
        alsa.card = "1"
        alsa.card_name = "USB AUDIO    DAC"
        alsa.long_card_name = "BurrBrown from Texas Instruments USB AUDIO    DAC at usb-0000:00:15.0-5, full s"
        alsa.driver_name = "snd_usb_audio"
        device.bus_path = "pci-0000:00:15.0-usb-0:5:1.0"
        sysfs.path = "/devices/pci0000:00/0000:00:15.0/usb1/1-5/1-5:1.0/sound/card1"
        udev.id = "usb-BurrBrown_from_Texas_Instruments_USB_AUDIO_DAC-00"
        device.bus = "usb"
        device.vendor.id = "08bb"
        device.vendor.name = "Texas Instruments"
        device.product.id = "27c7"
        device.product.name = "USB AUDIO    DAC"
        device.serial = "BurrBrown_from_Texas_Instruments_USB_AUDIO_DAC"
        device.string = "1"
        device.description = "USB AUDIO    DAC"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-usb"
    Profiles:
        output:analog-mono: Analog Mono Output (sinks: 1, sources: 0, priority: 200, available: yes)
        output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6000, available: yes)
        output:iec958-stereo: Digital Stereo (IEC958) Output (sinks: 1, sources: 0, priority: 5500, available: yes)
        off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
    Active Profile: output:analog-stereo
    Ports:
        analog-output: Analog Output (priority: 9900, latency offset: 0 usec)
            Part of profile(s): output:analog-mono, output:analog-stereo
        iec958-stereo-output: Digital Output (S/PDIF) (priority: 0, latency offset: 0 usec)
            Part of profile(s): output:iec958-stereo
~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC662 rev3 Analog [ALC662 rev3 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
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: DAC [USB AUDIO    DAC], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I use hw:0,0, hw:0,3, hw:1,0

So my problem is 2 fold

  1. The load-module lines work on the terminal and the script file. Not sure what's going wrong with the system.pa file.
  2. The audio quality is terrible when I have combined sinks.
Zephyr
  • 101

0 Answers0