Asus Essence STX II and ALSA/Pulse Audio crashing

Questions about hardware,drivers and peripherals
Forum rules
Before you post please read how to get help
Post Reply
anotheri
Level 1
Level 1
Posts: 12
Joined: Mon Jan 22, 2018 11:34 pm

Asus Essence STX II and ALSA/Pulse Audio crashing

Post by anotheri » Tue Jan 23, 2018 12:59 am

Hello, I'm a relatively new Linux users, 2 months in now. Got started off an 18.2 Sonya 64bit CD I bought off Amazon and installed into the new PC I built. I can list further specs if they become relevant but it's an AMD build, Ryzen 5 1600, running on an X370 chipset Asus PrimeA board, with an nVidia GTX950, 16gb DDR4 @2133 and 120gbSSD.

Surprisingly everything ran very well out of the box, rock solid stability with pretty much everything. I heard that certain new high end PC components can cause issues, especially when using AMD/ATI so care should be taken when choosing components. Didn't know that when I installed yet everything worked perfectly. The system auto detected my nVidia card and installed a driver as well as the "amd-64 microcode" whatever that is.

The issue I am having is with ALSAMIXER and Pulse audio crashing when using them both at the same time and trying to use ALL the features of my sound card/controlling it through ALSAMIXER.
My sound card is the Asus Essence STX II powering Sennheiser HD650 headphones.

Note I am a complete beginner, so don't let any of the bellow terms make you think I'm experienced at all. Only reason I know half this stuff is I had an experienced user on another computer (not Linux dedicated forum) attempt to help me out, and while we made some progress I couldn't get the issue solved.

So by default audio did and does work to some extent. Pulse audio "grabs" the device correctly. I disabled the on board sound in my BIOS and I have no issues with Pulse "grabbing" the nVidia card as the sound card which seems to be a common issue with other users. In laymans terms, the headphones are plugged into the sound card via 6.5mm jack and I can hear audio, it's good clean audio you'd expect out of a working sound card. Same thing if I plug into the front pannel 3.5mm which is plugged into the sound card as well, it works.

When it comes to controlling the card itself, I can control things like volume, if I want the rear jack, rear RCA out, rear SP/DIF out or front panel out and input, etc for sound through the pulse audio applet in the system tray bottom right corner.

I also have the Pulse Audio volume control application (palvucontrol or something) and this works. I can set my STX II sound card as the primary/first device and disable the nvidia card completely for sound by turning it "OFF".
Palvucontrol also allows me to set the output on my sound card to headphone analog, stereo duplex, OFF, etc...

However to control things like the headphone AMP on the card, I need to use ALSAMIXER run through the terminal. Pulse audio cannot do this for me. I can do a few other things in there, like play with the DAC filter, adjust volume as well, etc.

So ALSAMIXER through the terminal works as well but I have to adjust settings quickly, if I stay long enough in it, the system will completely crash/force reboot. Sometimes just opening up Alsamixer and touching any setting will cause a crash instantly. Sometimes I can play music for a good 10-15 minutes playing in both Alsamixer and Pulse audio at the same time before a crash happens, but the end result is always the same, the computer just crashes, it's like Alsamixer and Pulse can't get along with each other.


If I turn pulse audio off, by going to /etc/pulse and editing the client.conf file from the default

; autospawn = yes

by uncommenting and making it

autospawn = no

the system will launch without the pulse audio applet in the system tray, and Palvucontrol will not be able to connect if I launch the application.

In this scenario I can only control audio through alsamixer, and playing with alsamixer will not cause the system to crash, problem is I can't hear any sound when I do this, it's like audio is not being "routed" to alsa when Pulse is turned off.

The issue with the crashing I am having was described in the arch linux wiki, and the experienced Linux user that was helping me out on another forum suggested that I need to configure Pulse to use the settings from Alsa. Instead of having Pulse grab the device on boot and then trying to control it through Alsa.


To do this I created a .asoundrc file in /home/matt which I belive is what Linux users refer to as their "home directory". I can post the code in .asoundrc file I used if somebody wants to check if it's good.

I edited the /etc/pulse/client.conf file to

Code: Select all

default-sink = dmix
; default-source =
; default-server =
; default-dbus-server =

autospawn = no
; daemon-binary = /usr/bin/pulseaudio
; extra-arguments = --log-target=syslog

; cookie-file =

; enable-shm = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB

; auto-connect-localhost = no
; auto-connect-display = no
I also edited the /etc/pulse/default.pa to

Code: Select all

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
load-module module-alsa-sink device=dmix
load-module module-alsa-source device=dsnoop
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink
I also edited /etc/default/grub and then ran sudo update-grub
I don't know if I set the device order right. aplay -l to show my devices order bellow.

Code: Select all

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash snd-hda-intel.index=1,0"
GRUB_CMDLINE_LINUX=""
Here is what my aplay -l looks like. The STX is what device 0, card 0 or device 0 card 1?
Not quite sure how to set my grub file so it always picks up the Xonar STX II as the sound card. Yet even with this possibly wrong, with Pulse audio enabled it always "grabs" the Xonar STX II correctly.

Code: Select all

matt@matt-System-Product-Name ~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: II [Xonar STX II], device 0: Multichannel [Multichannel]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: II [Xonar STX II], device 1: Digital [Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
Sorry if this is confusing. Long story short, I want to be able to use ALSA mixer to control my sound card without it crashing my computer when Pulse audio is also running/used OR if that fails just control audio through Alsamixer only.
I did note above that I tried disabling Pulse and while it solved my crashing problem I couldn't get any audio to play with Pulse audio turned off and using Alsamixer only.

I think (but could be wrong) that the issue is from trying to use the card through Alsamixer after it was "grabbed" by Pulse audio. I am trying to get pulse audio to "grab" my "virtual sound card" as it was explained to me that I created when making the .asoundrc file so that Pulse talks to my card through Alsa first.

User avatar
TeaSwigger
Level 3
Level 3
Posts: 109
Joined: Mon Feb 06, 2012 6:42 am
Location: CA

Re: Asus Essence STX II and ALSA/Pulse Audio crashing

Post by TeaSwigger » Tue Jan 23, 2018 3:38 am

Hello and welcome. You're doing amazingly well for having just started using linux 2 months ago. A useful way to gather system info, such as for troubleshooting on the forums here, is to enter into a terminal:

Code: Select all

inxi -Fxzd
then copy and post the output here in the code tags.

I have an ASUS Xonar Essence ST (PCI vers., either using RCA outs or powering Sennheiser HD600 headphones) on my AMD PC, so our systems may be similar enough. fwiw, I'd suggest undoing your mods to /etc/pulse/default.pa and /etc/default/grub configs (remember to run 'sudo update-grub' in a terminal after editing the grub file to apply changes; always be careful editing grub configs as a mistake can result in errors or failure to boot).

As I've no need for pulseaudio features and the resampling etc isn't wanted, I've removed it. Doing so may limit your choices of apps or cause other issues, so you may not want to, or at least not for the time being. To (hopefully) offer some help via examples, let's assume you chose to leave pulseaudio installed for now but not have it running. It seems you've sorted how to avoid pulseaudio starting up (by editing the /etc/pulse/client.conf file as you detailed, and not having the DE autostart it as a service, if applicable; you didn't say what desktop you're using, but as I run xfce, I can just add that in xfce the latter involves going to menu > system settings > session and startup > application autostart and de-selecting 'PulseAudio Sound System' and 'XFCE Volume Daemon'). One way to check if a pulseaudio process is running is to search in the task manager. Without pulseaudio running, let's assume we will now just be using ALSA and will use it without a GUI mixer app/applet.

If you have more than one audio device (which you do, and which can also include audio output via an HDMI video output, such as is built-in on my motherboard) you may need/want to specify a default output. We can find info on our systems by entering aplay -l in a terminal as you detail above and aplay -L (upper case L) for more info. In example, here's the output of those for my system:

Code: Select all

me@mybox ~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ST [Xonar ST], device 0: Multichannel [Multichannel]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: ST [Xonar ST], device 1: Digital [Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Code: Select all

me@mybox ~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default
sysdefault:CARD=ST
    Xonar ST, Multichannel
    Default Audio Device
front:CARD=ST,DEV=0
    Xonar ST, Multichannel
    Front speakers
surround21:CARD=ST,DEV=0
    Xonar ST, Multichannel
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=ST,DEV=0
    Xonar ST, Multichannel
    4.0 Surround output to Front and Rear speakers
surround41:CARD=ST,DEV=0
    Xonar ST, Multichannel
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=ST,DEV=0
    Xonar ST, Multichannel
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=ST,DEV=0
    Xonar ST, Multichannel
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=ST,DEV=0
    Xonar ST, Multichannel
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=ST,DEV=0
    Xonar ST, Multichannel
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=ST,DEV=0
    Xonar ST, Multichannel
    Direct sample mixing device
dmix:CARD=ST,DEV=1
    Xonar ST, Digital
    Direct sample mixing device
dsnoop:CARD=ST,DEV=0
    Xonar ST, Multichannel
    Direct sample snooping device
dsnoop:CARD=ST,DEV=1
    Xonar ST, Digital
    Direct sample snooping device
hw:CARD=ST,DEV=0
    Xonar ST, Multichannel
    Direct hardware device without any conversions
hw:CARD=ST,DEV=1
    Xonar ST, Digital
    Direct hardware device without any conversions
plughw:CARD=ST,DEV=0
    Xonar ST, Multichannel
    Hardware device with all software conversions
plughw:CARD=ST,DEV=1
    Xonar ST, Digital
    Hardware device with all software conversions
hdmi:CARD=HDMI,DEV=0
    HDA ATI HDMI, HDMI 0
    HDMI Audio Output
dmix:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Direct sample mixing device
dsnoop:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Direct sample snooping device
hw:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Direct hardware device without any conversions
plughw:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Hardware device with all software conversions
The "hw:CARD=ST,DEV=0 Xonar ST, Multichannel Direct hardware device without any conversions" bit is the desired output in my case.

You may need/want to configure the output of whatever app(s) you use to play your media. Currently I'm using Audacious for music and mpv for video. In Audacious: File > settings > audio: output plugin: ALSA Output, settings: PCM device: "hw:CARD=ST,DEV=0 Xonar ST, Multichannel Direct hardware device without any conversions" - mixer device: "hw:CARD=ST - Xonar ST direct control device" - mixer element: Master. Bit depth: auto. Other options unchecked. For mpv, one can set the default audio output in the config file (/home/you/.config/mpv/mpv.conf); in this example, my config file contains the option: "audio-device='alsa/hw:CARD=ST,DEV=0'"

Let's assume we're using alsamixer in a terminal to control the audio (just enter alsamixer in the terminal). 'taint pretty, but it works. You can select which card is being controlled, output level, which output ('phones' or 'speakers'), inputs and even in this case headphone impedence for best sound. Here's what it looks like in this example:
Screenshot_2018-01-22_23-35-12.png
One might best control headphone volume by adjusting the MASTER item in that example.

A couple footnotes. One can check what's actually playing, in my case with the command "cat /proc/asound/card*/pcm*p/sub0/hw_params" in a terminal while playing a track. For example, if playing a 24/192 file:

Code: Select all

me@mybox ~ $ cat /proc/asound/card*/pcm*p/sub0/hw_params
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 192000 (192000/1)
period_size: 11904
buffer_size: 48000
closed
where the key bit here is rate, which reports 192000. If playing a 44.1 file, it'd report 44100 instead and so forth.

Also I've made the HDMI default, system-wide, so the audio stream from the players (which are configured as above to use the Xonar card) isn't mixed with system sounds and other stuff (which are piped off to the HDMI). So I created a file /etc/asound.conf with the following:

Code: Select all

pcm.!default {
	type hw
	card HDMI
}

ctl.!default {
	type hw           
	card HDMI
}
To make the Xonar default for everything, in this example, one would just replace HDMI with ST if I recall rightly... there are probably other/better ways to go at it; ALSA config stuff can make my poor head spin. One can take the card name from the output of aplay -l as above.

Hope at least some of that helps. Good luck!
Mint 18.3 xfce w/nemo - AMD Quad Core - lovely ASUS Xonar ST sound - Radeon R7 Graphics - 1920x1200 Dell U2415
some favs: Zim - Audacious - kid3 - calibre - gimp - artha - deluge - handbrake - k3b - ClickRepair - mc
Folding@Home Mint Team Contributor

anotheri
Level 1
Level 1
Posts: 12
Joined: Mon Jan 22, 2018 11:34 pm

Re: Asus Essence STX II and ALSA/Pulse Audio crashing

Post by anotheri » Thu Jan 25, 2018 4:30 am

I'm not really following...

I need to know how I can get audio to route through so it works without pulse audio, only alsa/alsamixer Because I belive pulse and alsamixer are causing the system crashes. If I disable pulse audio through editing the client.conf file under /etc/pulse I get no sound.

You spoke about configuring how my apps output audio.
For audio play back I use VLC media player and as usuall watch stuff through my Firefox web browser.

How do I go about doing that?

Everywhere I go there's all these commands and instructions. The problem is I don't even know if I'm doing it right, I don't even know if I'm understanding. I'm not even 100% sure what my so called home directory is, I believe it is in this case it is /home/matt but I'm not completely sure, never been confirmed everywhere I ask, for all I know that's the issue. Every tutorial about setting up ALSA talks about using a .asoundrc file in your home directory, yet I'm not even sure what that is.

Is there some way I can just post all the information, from all the commands that list hardware/config and somebody can just show me what file I need to edit, or what I'm missing here that's making this not work. Maybe I made a mistake in the .asoundrc file, or any other file I edited.

Here is what my inxi -Fxzd looks like.

Code: Select all

matt@matt-System-Product-Name ~ $ inxi -Fxzd
System:    Host: matt-System-Product-Name Kernel: 4.13.0-31-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: Cinnamon 3.4.6 (Gtk 3.18.9-1ubuntu3.3)
           Distro: Linux Mint 18.2 Sonya
Machine:   Mobo: ASUSTeK model: PRIME X370-A v: Rev X.0x
           Bios: American Megatrends v: 0404 date: 05/12/2017
CPU:       Hexa core AMD Ryzen 5 1600 Six-Core (-HT-MCP-) cache: 3072 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm) bmips: 38328
           clock speeds: max: 3200 MHz 1: 1550 MHz 2: 1550 MHz 3: 1550 MHz
           4: 1550 MHz 5: 1550 MHz 6: 1550 MHz 7: 1550 MHz 8: 1550 MHz
           9: 1550 MHz 10: 1550 MHz 11: 1550 MHz 12: 1550 MHz
Graphics:  Card: NVIDIA GM206 [GeForce GTX 950] bus-ID: 2b:00.0
           Display Server: X.Org 1.18.4 drivers: nvidia (unloaded: fbdev,vesa,nouveau)
           Resolution: 1920x1080@60.00hz
           GLX Renderer: GeForce GTX 950/PCIe/SSE2
           GLX Version: 4.5.0 NVIDIA 384.111 Direct Rendering: Yes
Audio:     Card-1 NVIDIA Device 0fba driver: snd_hda_intel bus-ID: 2b:00.1
           Card-2 C-Media CMI8788 [Oxygen HD Audio]
           driver: snd_virtuoso port: d000 bus-ID: 2a:04.0
           Sound: Advanced Linux Sound Architecture v: k4.13.0-31-generic
Network:   Card-1: Qualcomm Atheros AR2417 Wireless Network Adapter [AR5007G 802.11bg]
           driver: ath5k bus-ID: 27:01.0
           IF: wlp39s1 state: down mac: <filter>
           Card-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: e000 bus-ID: 28:00.0
           IF: enp40s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:    HDD Total Size: 120.0GB (63.3% used)
           ID-1: /dev/sda model: Corsair_Force_LS size: 120.0GB
           Optical: /dev/sr0 model: N/A
           rev: N/A dev-links: cdrom,cdrw,dvd,dvdrw
           Features: speed: 48x multisession: yes
           audio: yes dvd: yes rw: cd-r,cd-rw,dvd-r state: N/A
Partition: ID-1: / size: 95G used: 56G (63%) fs: ext4 dev: /dev/sda1
           ID-2: swap-1 size: 17.11GB used: 0.00GB (0%) fs: swap dev: /dev/sda5
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: N/A mobo: N/A gpu: 0.0:26C
           Fan Speeds (in rpm): cpu: 0
Info:      Processes: 261 Uptime: 1:14 Memory: 1149.0/16036.0MB
           Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.481) inxi: 2.2.35 

Here is what my aplay -l looks like.

This is where a lot of confusion comes, I don't understand this. I believe this means my Xonar STX II is card 0 sub device 1 but I am not sure. What does this mean my hardware is?

The reason is because every single config file asks you to specify the output device has hw something,something

so hw1,0
or hw1,1
hw2,0
hw2,1
hw0,2

you get the idea.

It's like I'm seeing new colors I've never seen before, I know their new but I don't know their actual names. I can't setup the config files when they ask for example "output" device if I can't even read properly a command that supposedly lists which device is identified as what.

This is my aplay -l, what is the STX?

Code: Select all

matt@matt-System-Product-Name ~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: II [Xonar STX II], device 0: Multichannel [Multichannel]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: II [Xonar STX II], device 1: Digital [Digital]card 0 sub device 1
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0card 0 sub device 1
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
This is my .asoundrc file in /home/matt/
It's rather long, the second part of code in it is a graphics equal, which surprisingly works in the terminal yet dosen't actually control anything when you play with the settings.

Code: Select all

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

pcm.dmixer {
        type dmix
        ipc_key 1024
        slave {
                pcm "hw:STX,0"
                period_time 0
                period_size 1024
                buffer_size 24576
                rate 44100 # 
                # rate 96000 
                # rate 192000 # 
        }
        bindings {
                0 0
                1 1
        }
}

ctl.dmixer {
        type hw
        card STX
        device 0
}

pcm.dsp {
        type plug
        slave.pcm "dmixer" # use our new PCM here
}

ctl.mixer {
        type hw
        card STX
}

pcm.dmixer {
    type dmix
    ipc_key 2048
    slave {
        pcm "hw:STX,0"
        buffer_size 16384
    }
}

ctl.equal {
    type equal;
}

pcm.equalizer {
    type equal
    slave.pcm "plug:dmixer"
}

pcm.!default {
    type plug
    slave.pcm equalizer
}

User avatar
TeaSwigger
Level 3
Level 3
Posts: 109
Joined: Mon Feb 06, 2012 6:42 am
Location: CA

Re: Asus Essence STX II and ALSA/Pulse Audio crashing

Post by TeaSwigger » Sat Jan 27, 2018 12:30 am

anotheri wrote:I'm not really following...
That's ok, as the saying goes, "all I know about this place is that it took me a long time to get here." So many things are like a college course unto iteself, are poorly documented, obscure in documentation, are undocumented or some combination of the above and of course, constantly changing. I'd say that was the ad hoc nature of the beast, but commercial 'solutions' are as bad or worse - often deliberately so. We can but try to sort out something that will work for our wants/needs.

First, be sure you need or want to change the default setup. To make it as simple as possible for most users, Mint has tried to arrange for ALSA with PulseAudio to auto-configure itself in a way that will work for most hardware and apps, perhaps with just a little GUI app in your taskbar to control volume or set output device. It should "just work." If the sound worked when you first installed Mint, I'd suggest undoing any changes you've made and using it as it was until you can take the time to do more research into what to change and how.

To clarify, then: certain features of your card were only available in alsamixer if pulseaudio was disabled; using alsamixer with pulseaudio would result in a crash; you get no sound with pulseaudio disabled? I don't know why it would crash. What I can try to do is help you avoid pulseaudio and access alsa directly. While I do this to get the best sound from my system and not to work around a crash situation, our systems may be similar enough that the example may be adaptable for yours.

Note there's a recent big caveat for ditching pulseaudio: Firefox now requires pulseaudio to play audio from in the browser. (EDIT: there may be a way around that: apulse. See this thread: viewtopic.php?f=48&p=1425799#p1425799)

Some general stuff first:
Everywhere I go there's all these commands and instructions. The problem is I don't even know if I'm doing it right, I don't even know if I'm understanding.

We have that in common too...
I'm not even 100% sure what my so called home directory is, I believe it is in this case it is /home/matt but I'm not completely sure, never been confirmed everywhere I ask, for all I know that's the issue.

I see by the start of the aplay -l you posted that you're identified in the terminal as matt@matt-System-Product-Name. 'matt-System-Product-Name' is the name of the system and your user name is 'matt', thus your 'home directory' should by default be /home/matt.

Your 'home directory' (directory = folder) is like My Documents plus your part of Users and Settings (or whatever that was called) in Windows put together. Your files (files = documents) go in your 'home directory'. Other stuff specific to you and not shared with any other users on the computer, like your own app settings, bookmarks and such, are there in your 'home directory', stored in files that start with a dot or in directories that start with a dot. Starting with a dot makes the file or directory 'hidden' in the default view of the file manager (there should be an option in the file manager to hide or display such files and directories). In a file path, like in the terminal, it is /home/matt (can be abbreviated as ~/). By default, you have permissions to create and edit everything inside of your home directory, and for security, to create or change anything outside of your home directory, one needs admin permissions.

Now, you know how to set pulseaudio so it doesn't start or re-start (the bit about putting 'autospawn=no' in /etc/pulse/client.conf). You may also have to de-select any pulseaudio entries in the system services / autostart part of system settings so Cinnamon doesn't start it as it loads. With pulseaudio not started and not 'autospawning', everything should just use ALSA without having custom ALSA configuration settings. You should then be able to control the sound from alsamixer in the terminal. I think there is a GUI app for alsamixer, which does handle whatever card options alsamixer does - 'gnome-alsamixer', may be available in the repositories, so easily installed from the software manager. There may also be an applet for controlling ALSA sound from the taskbar in Cinnamon (I use xfce so I'm not sure on that point).
You spoke about configuring how my apps output audio.
For audio play back I use VLC media player and as usuall watch stuff through my Firefox web browser.
One can configure many apps to use a specific device a specific way - for example, to have VLC send audio direct to the device without additional processing. In VLC: tools > preferences > audio; find 'audio output module', select 'ALSA audio output'; 'device' should be below and you can select your card, preferably the 'direct hardware device' option. Here's what it looks like:
Screenshot_2018-01-26_16-17-59.png
Every tutorial about setting up ALSA talks about using a .asoundrc file in your home directory, yet I'm not even sure what that is.
To manually specify ALSA settings, if one needs or wants to, one edits the settings in ALSA's configuration file. To make setting for all users, one edits /etc/asound.conf. One needs to use admin permissions (sudo). To just set it up for your own user, one edits /home/[you]/.asound. You do not need admin permissions (sudo) for that, because it is in your home directory. /home/[you]/.asound over-rules /etc/asound.conf.
This is my aplay -l, what is the STX?
Assuming you mean the analog output, it's this part:

Code: Select all

card 0: II [Xonar STX II], device 0: Multichannel [Multichannel]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
so:
hw:0,0
Can be referred to in some ALSA configs as II

Caveat: if anything changes, the system may reconfigure itself and swap card numbers, so hw:0,0 can become hw:1,0 without notice. Sigh. Where names are used, like II above, that method may be preferable, since the names don't change even if the card numbers do.

For example, if one wanted to specify it as default device in /etc/asound.conf (or for just your user, /home/matt/.asound) one broad way (others more advanced may have other, maybe better ideas) could be:

Code: Select all

pcm.!default {
	type hw
	card II
}

ctl.!default {
	type hw           
	card II
}
The .asound you posted is beyond me without researching some more; it does seem overly complex for your needs (for example, it seems to be specifying sample rate as 44.1, which probably isn't needed or desired with your card). I can only suggest trying to avoid using it until you've determined you need to get into the ALSA config and then looked into what that all does. You could just save that aside for the time being.
Last edited by TeaSwigger on Sun Feb 04, 2018 12:23 am, edited 1 time in total.
Mint 18.3 xfce w/nemo - AMD Quad Core - lovely ASUS Xonar ST sound - Radeon R7 Graphics - 1920x1200 Dell U2415
some favs: Zim - Audacious - kid3 - calibre - gimp - artha - deluge - handbrake - k3b - ClickRepair - mc
Folding@Home Mint Team Contributor

anotheri
Level 1
Level 1
Posts: 12
Joined: Mon Jan 22, 2018 11:34 pm

Re: Asus Essence STX II and ALSA/Pulse Audio crashing

Post by anotheri » Wed Jan 31, 2018 4:26 am

To clarify, then: certain features of your card were only available in alsamixer if pulseaudio was disabled; using alsamixer with pulseaudio would result in a crash; you get no sound with pulseaudio disabled? I don't know why it would crash. What I can try to do is help you avoid pulseaudio and access alsa directly. While I do this to get the best sound from my system and not to work around a crash situation, our systems may be similar enough that the example may be adaptable for yours.

Note there's a recent big caveat for ditching pulseaudio: Firefox now requires pulseaudio to play audio from in the browser. Don't know of a way around it.


To manually specify ALSA settings, if one needs or wants to, one edits the settings in ALSA's configuration file. To make setting for all users, one edits /etc/asound.conf. One needs to use admin permissions (sudo). To just set it up for your own user, one edits /home/[you]/.asound. You do not need admin permissions (sudo) for that, because it is in your home directory. /home/[you]/.asound over-rules /etc/asound.conf.

Okay update.

So I set VLC to play through ALSA using your instructions.

I disabled pulse audio entirely through "autospawn=no" and then using ALSA only to control volume.

Amazing, I can hear sound yay, I can control volume and best of all the system does not crash.

I played around with some of the config file settings more but then changed everything back to stock, one of the changes I made caused a no boot, the system kept auto restarting, finally without me doing anything it did boot and I was able to reverse the changes.

So we have narrowed down the problem and fixed it and sound works with this sort of "fix". One problem down, more to go.

The next problem is I sort of need pulse audio since I can't control all the features of my card through ALSA either (can't control all the features through Pulse either, need alsamixer and as we know they both don't agree), I used to use pulse to control for example, audio out through front pannel, rear, rear RCA out, etc... Can't seem to do that in ALSAMIXER, if there is a way I don't know it.


Second is like you said, some applications just can't use ALSA only natively and need Pulseaudio. This is apparently where the .asound file comes in and playing with your config file settings, as apparently you can make pulse talk to ALSA which then talks to the hardware. This should avoid crashing.

In the stock setup, Pulse apparently talks directly to the hardware, this causes the conflict that makes things crash.


So step one is getting my .asound config file to work, I feel like I have not set it up properly.


So back to basics

my .asound config file was named

.asoundrc

and in my /home/matt folder

Is my file even named properly? Is it supposed to be .asoundrc or .asound? Is there anything else I need to so that ALSA "talks" to this file and uses the setting in it?

User avatar
TeaSwigger
Level 3
Level 3
Posts: 109
Joined: Mon Feb 06, 2012 6:42 am
Location: CA

Re: Asus Essence STX II and ALSA/Pulse Audio crashing

Post by TeaSwigger » Sun Feb 04, 2018 12:21 am

Sorry, didn't catch this till now. Glad your system is working without crashing at least!
anotheri wrote:The next problem is I sort of need pulse audio since I can't control all the features of my card through ALSA either (can't control all the features through Pulse either, need alsamixer and as we know they both don't agree), I used to use pulse to control for example, audio out through front pannel, rear, rear RCA out, etc... Can't seem to do that in ALSAMIXER, if there is a way I don't know it.
Here's a snapshot of alsamixer on my system
Screenshot_2018-02-03_19-57-05.png
One uses the left or right arrow keys to select between items. The letters of the active item will be highlighted in red. If you go to analog output, you can use the up or down arrow keys to cycle through the options, in this case, front phones, head phones (the 'serious' headphone jack, out of the card in the back of the pc) or speakers. Similar with impedence. Is yours like that? Does that work?
Second is like you said, some applications just can't use ALSA only natively and need Pulseaudio. This is apparently where the .asound file comes in and playing with your config file settings, as apparently you can make pulse talk to ALSA which then talks to the hardware. This should avoid crashing.

In the stock setup, Pulse apparently talks directly to the hardware, this causes the conflict that makes things crash.
No, alsa is the sound system on the base built-in-to-the-linux-kernel level whereas pulse is an additional layer on top which uses alsa. Evidently pulseaudio is useful for some scenarios, but for me, it's redundant and used to cause trouble.
So step one is getting my .asound config file to work, I feel like I have not set it up properly.


So back to basics

my .asound config file was named

.asoundrc

and in my /home/matt folder

Is my file even named properly? Is it supposed to be .asoundrc or .asound? Is there anything else I need to so that ALSA "talks" to this file and uses the setting in it?
.asoundrc would be right. If it contains a working config it'll take effect automatically, right away. That's for configuring alsa only; pulse has its own config stuff, in /home/matt/.config/pulse. Ideally though, you'd not need to mess with either, only if you want to change the default ways they operate.

Possible good news if you do need to ditch pulseaudio after all, it seems there is a way to get Firefox to use alsa: apulse. I'm trying it out. Here is the post on that topic: viewtopic.php?f=48&p=1425799#p1425799
Mint 18.3 xfce w/nemo - AMD Quad Core - lovely ASUS Xonar ST sound - Radeon R7 Graphics - 1920x1200 Dell U2415
some favs: Zim - Audacious - kid3 - calibre - gimp - artha - deluge - handbrake - k3b - ClickRepair - mc
Folding@Home Mint Team Contributor

anotheri
Level 1
Level 1
Posts: 12
Joined: Mon Jan 22, 2018 11:34 pm

Re: Asus Essence STX II and ALSA/Pulse Audio crashing

Post by anotheri » Mon Feb 19, 2018 3:34 am

So as it turns out I found out the whole crashing thing is an Asus issue... An issue with their sound cards and their motherboards, or potentially both of those and nvidia graphics cards. I stumbled upon this after because I tried installing the full proprietary GUI driver for the Asus card in Windows 10 and the thing would constantly make the same click noise instant crash reboot halfway through the installer. Don't worry I didn't sell out to Windows...

Anyway I found on the dedicated Asus forums a few people were posting about this, the Asus reps eventually acknowledged that it was an issue on their end that they were able to replicate and advised to install the latest BIOS firmware. I did that and I was able to complete the installation of the Asus driver software in Win 10 without crashing. Overall crashing in Linux/Alsamixer also diminished but you can still get it to happen.


I'm a little confused on the directions in that post about installing some stuff to get Firefox to use ALSA directly. So I need to install some sofware manually from the external non approved repository "github"? Every time I try to manually install something in Linux I mess up.

Post Reply

Return to “Hardware Support”