# FMOD Studio ignores /etc/asound.conf when using ALSA as the back end

**URL:** https://qa.fmod.com/t/fmod-studio-ignores-etc-asound-conf-when-using-alsa-as-the-back-end/20188
**Category:** FMOD Engine
**Tags:** linux
**Created:** [May 2, 2023, 8:43am UTC](https://qa.fmod.com/t/fmod-studio-ignores-etc-asound-conf-when-using-alsa-as-the-back-end/20188 "2023-05-02T08:43:41Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![sldev](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@sldev](https://qa.fmod.com/u/sldev)
#### Post date: [May 2, 2023, 8:43am UTC](https://qa.fmod.com/t/fmod-studio-ignores-etc-asound-conf-when-using-alsa-as-the-back-end/20188/1 "2023-05-02T08:43:41Z")

</div>

Greetings,

I have been using FMOD (3, Ex & Studio) for years on Linux computers, with ALSA as the back end, and never encountered a problem with mixing so far, but I just upgraded my main PC to a Ryzen9 7900X CPU, and I found out that FMOD Studio entirely ignores the /etc/asound.conf ALSA configuration (it is like if FMOD was only opening hw:0,0, at the hardware level, bypassing ALSA configuration).

With this CPU/motherboard, the sound is using usb\_audio and got several PCM channels (one for the back panel, which lack a headphone jack, one for the front jacks with the headphone, and one for the SPDIF output); unlike all my previous motherboards which had a HD Audio chipset, the jacks cannot be re-affected and so I had to configure ALSA to redirect the PCM output to both channels 0 & 1 so to be able to get sound in the headphone.

My /etc/asound.conf file is as follow (I found the solution on [stackoverflow.com](http://stackoverflow.com): [linux - Alsa: how to duplicate a stream on 2 outputs and save system configs? - Stack Overflow](https://stackoverflow.com/questions/43939191/alsa-how-to-duplicate-a-stream-on-2-outputs-and-save-system-configs)):

pcm.quad {  
type multi  
slaves.a.pcm “dmix:Audio,0”  
slaves.a.channels 2  
slaves.b.pcm “dmix:Audio,1”  
slaves.b.channels 2  
bindings.0 { slave a; channel 0; }  
bindings.1 { slave a; channel 1; }  
bindings.2 { slave b; channel 0; }  
bindings.3 { slave b; channel 1; }  
}

pcm.stereo2quad {  
type route  
slave.pcm “quad”  
ttable.0.0 1  
ttable.1.1 1  
ttable.0.2 1  
ttable.1.3 1  
}

pcm.!default {  
type asym  
playback.pcm “plug:stereo2quad”  
capture.pcm “plug:dsnoop:Audio”  
}

pcm.dsp {  
type asym  
playback.pcm “plug:stereo2quad”  
capture.pcm “plug:dsnoop:Audio”  
}

So, my question is: how to tell FMOD Studio to use /etc/asound.conf configuration and the software mixer instead of hw:0,0 ?..

---

<div class="post-metadata">

### Author: ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)
#### Post date: [May 5, 2023, 2:18am UTC](https://qa.fmod.com/t/fmod-studio-ignores-etc-asound-conf-when-using-alsa-as-the-back-end/20188/2 "2023-05-05T02:18:13Z")

</div>

Hi,

Just to clarify, are you using the FMOD Studio application, or the FMOD API? If it’s the former, have you set the Output Device to ALSA under Edit-\>Preferences-\>Audio? If it’s the latter, have you followed the instructions in [our Linux platform-specific documentation regarding device selection](https://www.fmod.com/docs/2.02/api/platforms-linux.html#device-selection)?

---

<div class="post-metadata">

### Author: ![sldev](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@sldev](https://qa.fmod.com/u/sldev)
#### Post date: [May 5, 2023, 7:37am UTC](https://qa.fmod.com/t/fmod-studio-ignores-etc-asound-conf-when-using-alsa-as-the-back-end/20188/3 "2023-05-05T07:37:55Z")

</div>

I am speaking about applications using the FMOD Studio API (not about the FMOD Studio application, which I never used), here Second Life viewers.  
And yes, the said applications properly initialize the FMOD Studio API with setOutput(FMOD\_OUTPUTTYPE\_ALSA).  
I also tried to use the FMOD\_ALSA\_DEVICE environment variable, but it is of no help at all, since your documentation states it can only get set with what “aplay -L” lists, and these are only hardware devices, not the configured ALSA software mixers:  
null  
Discard all samples (playback) or generate zero samples (capture)  
sysdefault  
Default Audio Device  
sysdefault:CARD=Audio  
USB Audio, USB Audio  
Default Audio Device  
front:CARD=Audio,DEV=0  
USB Audio, USB Audio  
Front output / input  
surround21:CARD=Audio,DEV=0  
USB Audio, USB Audio  
2.1 Surround output to Front and Subwoofer speakers  
surround40:CARD=Audio,DEV=0  
USB Audio, USB Audio  
4.0 Surround output to Front and Rear speakers  
surround41:CARD=Audio,DEV=0  
USB Audio, USB Audio  
4.1 Surround output to Front, Rear and Subwoofer speakers  
surround50:CARD=Audio,DEV=0  
USB Audio, USB Audio  
5.0 Surround output to Front, Center and Rear speakers  
surround51:CARD=Audio,DEV=0  
USB Audio, USB Audio  
5.1 Surround output to Front, Center, Rear and Subwoofer speakers  
surround71:CARD=Audio,DEV=0  
USB Audio, USB Audio  
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers  
iec958:CARD=Audio,DEV=0  
USB Audio, USB Audio  
IEC958 (S/PDIF) Digital Audio Output  
iec958:CARD=Audio,DEV=1  
USB Audio, USB Audio #1  
IEC958 (S/PDIF) Digital Audio Output  
hdmi:CARD=NVidia,DEV=0  
HDA NVidia, Generic Digital  
HDMI Audio Output

---

<div class="post-metadata">

### Author: ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)
#### Post date: [May 11, 2023, 6:05am UTC](https://qa.fmod.com/t/fmod-studio-ignores-etc-asound-conf-when-using-alsa-as-the-back-end/20188/4 "2023-05-11T06:05:19Z")

</div>

Thanks for the additional information. I’ve done some testing, and I’ve also run into issue trying to define an output with `etc/asound.conf`. However, defining an output in `~/home/.asoundrc` works fine for me - could you confirm whether or not you run into the same issue after doing so?

---

<div class="post-metadata">

### Author: ![sldev](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@sldev](https://qa.fmod.com/u/sldev)
#### Post date: [May 11, 2023, 9:56pm UTC](https://qa.fmod.com/t/fmod-studio-ignores-etc-asound-conf-when-using-alsa-as-the-back-end/20188/5 "2023-05-11T21:56:02Z")

</div>

For me, it does not make any difference. I tried:

- With ~/.asoundrc and /etc/asound.conf (configured the same way), for both an unprivileged user and root.
- With only ~/.asoundrc (/etc/asound.conf removed), for both an unprivileged user and root.

FMOD Studio API still ignores the configuration and does not duplicate the sounds in the headphone channel.

---

<div class="post-metadata">

### Author: ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)
#### Post date: [May 12, 2023, 6:35am UTC](https://qa.fmod.com/t/fmod-studio-ignores-etc-asound-conf-when-using-alsa-as-the-back-end/20188/6 "2023-05-12T06:35:01Z")

</div>

Unfortunately, I still cannot reproduce this issue - after some more testing, I’m able to successfully detect the ALSA configuration located at both `~/.asoundrc` and `/etc/asound.conf` with `aplay -L`. Unfortunately, I cannot offer much more help, as this is an ALSA/Linux setup issue, and falls outside the scope of FMOD support. The [prerequisite](https://fmod.com/docs/2.02/api/platforms-linux.html#device-selection) for FMOD identifying devices is for the device to be visible in `aplay -L`, and for `aplay -D yourDevice yourAudioFile.wav` to play audio successfully. Since the device is not showing up in `aplay -L`, that will need to be resolved before I can offer any assistance in relation to FMOD.

---

<div class="post-metadata">

### Author: ![sldev](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@sldev](https://qa.fmod.com/u/sldev)
#### Post date: [May 12, 2023, 10:06am UTC](https://qa.fmod.com/t/fmod-studio-ignores-etc-asound-conf-when-using-alsa-as-the-back-end/20188/7 "2023-05-12T10:06:20Z")

</div>

It is in no way an ALSA/Linux setup issue: any audio software which does comply with ALSA specs (sox, VLC, mplayer, Audacity, Wine, and even Second Life viewers configured to use OpenAL instead of FMOD Studio), and yes, “aplay” as well (e.g. ‘aplay somesound.wav’), does properly use the software mixer overrides configured in /etc/asound.conf (or ~/.asoundrc: both do work fine).  
The only type of software that fails is the one only plugging in ALSA at the hardware level (such as ogg123, for example), and, obviously, FMOD Studio API !

aplay -L only lists cards and channels, but never software mixer overrides/names you define in .asounrc/asound.conf, so if the FMOD Studio API only relies on this, it obviously cannot “see” the configuration done at the system level to override hardware defaults.

Conclusion: either there is a bug in the FMOD Studio API, or its ALSA support is, at best, incomplete. You guys should really have a look at what sox/VLC/mplayer/Wine/Audacity are doing in their code to detect ALSA software mixers and implement the same algorithm in FMOD Studio…

---

<div class="post-metadata">

### Author: ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)
#### Post date: [May 15, 2023, 12:04am UTC](https://qa.fmod.com/t/fmod-studio-ignores-etc-asound-conf-when-using-alsa-as-the-back-end/20188/8 "2023-05-15T00:04:43Z")

</div>

> [@sldev](#):
>
> aplay -L only lists cards and channels, but never software mixer overrides/names you define in .asounrc/asound.conf, so if the FMOD Studio API only relies on this, it obviously cannot “see” the configuration done at the system level to override hardware defaults.

It’s possible that `defaults.namehint.showall` in `/usr/share/alsa/alsa.conf` is set to `off` - if it is, you will either need to specify a device namehint i.e.

```auto
pcm.quad {
type multi
slaves.a.pcm “dmix:Audio,0”
slaves.a.channels 2
slaves.b.pcm “dmix:Audio,1”
slaves.b.channels 2
bindings.0 { slave a; channel 0; }
bindings.1 { slave a; channel 1; }
bindings.2 { slave a; channel 2; }
bindings.3 { slave a; channel 3; }
hint.description "this is a hint"
}

```

or change `defaults.namehint.showall` to `on`. For some additional context, and to double check whether this is an issue with FMOD, could I get your distro, ALSA version, and FMOD version?

---

<div class="post-metadata">

### Author: ![sldev](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@sldev](https://qa.fmod.com/u/sldev)
#### Post date: [May 15, 2023, 9:24pm UTC](https://qa.fmod.com/t/fmod-studio-ignores-etc-asound-conf-when-using-alsa-as-the-back-end/20188/9 "2023-05-15T21:24:19Z")

</div>

> [@](#):
>
> It’s possible that ‘defaults.namehint.showall’ in ‘/usr/share/alsa/alsa.conf’ is set to ‘off’

That’s a good guess, Sir ! 😃

Indeed, replacing “defaults.namehint.showall off” with “defaults.namehint.showall on” in /usr/share/alsa/alsa.conf allows to see the configured software mixers via aplay -L, and then FMOD Studio API properly picks up one of those (“dsp” or “default”, I suppose): I do not even need to set a FMOD\_ALSA\_DEVICE environment variable.

FYI, the output for aplay -L is now:

```auto
null
	Discard all samples (playback) or generate zero samples (capture)
sysdefault
	Default Audio Device
quad
stereo2quad
dsp
default
sysdefault:CARD=Audio
	USB Audio, USB Audio
	Default Audio Device
front:CARD=Audio,DEV=0
	USB Audio, USB Audio
	Front output / input
surround21:CARD=Audio,DEV=0
	USB Audio, USB Audio
	2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Audio,DEV=0
	USB Audio, USB Audio
	4.0 Surround output to Front and Rear speakers
surround41:CARD=Audio,DEV=0
	USB Audio, USB Audio
	4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Audio,DEV=0
	USB Audio, USB Audio
	5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Audio,DEV=0
	USB Audio, USB Audio
	5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Audio,DEV=0
	USB Audio, USB Audio
	7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Audio,DEV=0
	USB Audio, USB Audio
	IEC958 (S/PDIF) Digital Audio Output
iec958:CARD=Audio,DEV=1
	USB Audio, USB Audio #1
	IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=NVidia,DEV=0
	HDA NVidia, Generic Digital
	HDMI Audio Output
```

And like you suggested, instead of modifying /usr/share/alsa/alsa.conf, simply adding ‘hint.description “default”’ into the ‘pcm.!default { }’ block of /etc/asound.conf also does the trick and allows FMOD to pick up that mixer for playback by default.

As for my distro it is PCLinuxOS (a rolling release, with currently libalsa v1.2.9), and FMOD Studio API is the current one too (v2.02.13), but its configuration is no different from other Linux distros in this respect (no special “patch” changing /usr/share/alsa/alsa.conf, in the [SRPMS for libalsa](http://distrib-coffee.ipsl.jussieu.fr/pub/linux/pclinuxos/pclinuxos/srpms/SRPMS.pclos/libalsa2-1.2.9-1pclos2023.src.rpm)), so users of other distros would encounter the same issue as I did, when using bare metal ALSA (granted, most people use a dispensable “sound daemon” such as PulseAudio).

If anything, and since FMOD, unlike other programs using ALSA, appears to rely on this specific feature, you might want to add a note about it in your (user & devel) documentation…

---

<div class="post-metadata">

### Author: ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)
#### Post date: [May 15, 2023, 9:56pm UTC](https://qa.fmod.com/t/fmod-studio-ignores-etc-asound-conf-when-using-alsa-as-the-back-end/20188/10 "2023-05-15T21:56:56Z")

</div>

Happy to hear that you’ve resolved your problem. I agree that adding a note regarding this to our documentation would be a good idea - I’ve flagged some changes internally.
