# FMOD studio API - Problem initializing USB sound card

**URL:** https://qa.fmod.com/t/fmod-studio-api-problem-initializing-usb-sound-card/13927
**Category:** FMOD Engine
**Created:** [June 7, 2018, 4:33pm UTC](https://qa.fmod.com/t/fmod-studio-api-problem-initializing-usb-sound-card/13927 "2018-06-07T16:33:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![SimonKBR](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@SimonKBR](https://qa.fmod.com/u/SimonKBR)
#### Post date: [June 7, 2018, 4:33pm UTC](https://qa.fmod.com/t/fmod-studio-api-problem-initializing-usb-sound-card/13927/1 "2018-06-07T16:33:06Z")

</div>

Hi,

I’m working with the FMOD studio API on a raspberry pi 3 B: linux api version 1.10.05

When I use the built-in sound output everything works fine. When I set my USB soundcard (ESI gigaport HD+) as the systems default sound output I get FMOD error 51 – Error initializing output device. The soundcard works fine outside of the FMOD API.

I generated a log file, which shows the specific error: [ERR] OutputALSA::init : snd\_pcm\_hw\_params\_set\_rate returned -22 = Invalid argument.  
I realise that this could be a really device/driver specific problem but I have no clue what this error means, could anyone point me in the right direction?

LOG:  
`
[LOG] System::create : Header version = 1.10.05. Current version = 1.10.05.
[LOG] Manager::init : maxchannels = 256 studioflags = 00000000 flags 00000000 extradriverdata (nil).
[LOG] SystemI::init : Initialize version=11005 (94661), maxchannels=256, flags=0x00020000
[LOG] FMOD_OS_Init : Detected Neon instruction support, will use Neon optimized mixing and resampling.
[LOG] SystemI::setOutputInternal : Setting output to ‘FMOD ALSA Output’
[LOG] OutputALSA::registerLib : Loaded ALSA version 1.1.3.
[LOG] OutputALSA::enumerate : Found device NAME:null IOID:(null).
[LOG] OutputALSA::enumerate : Found device NAME:default IOID:(null).
[LOG] OutputALSA::enumerate : Found device NAME:sysdefault:CARD=ALSA IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:dmix:CARD=ALSA,DEV=0 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:dmix:CARD=ALSA,DEV=1 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:dsnoop:CARD=ALSA,DEV=0 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:dsnoop:CARD=ALSA,DEV=1 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:hw:CARD=ALSA,DEV=0 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:hw:CARD=ALSA,DEV=1 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:plughw:CARD=ALSA,DEV=0 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:plughw:CARD=ALSA,DEV=1 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:sysdefault:CARD=HD IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:front:CARD=HD,DEV=0 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:surround21:CARD=HD,DEV=0 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:surround40:CARD=HD,DEV=0 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:surround41:CARD=HD,DEV=0 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:surround50:CARD=HD,DEV=0 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:surround51:CARD=HD,DEV=0 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:surround71:CARD=HD,DEV=0 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:iec958:CARD=HD,DEV=0 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:dmix:CARD=HD,DEV=0 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:dsnoop:CARD=HD,DEV=0 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:hw:CARD=HD,DEV=0 IOID:Output.
[LOG] OutputALSA::enumerate : Found device NAME:plughw:CARD=HD,DEV=0 IOID:Output.
[ERR] OutputALSA::init : snd_pcm_hw_params_set_rate returned -22 = Invalid argument.
[LOG] SystemI::close : Closed.
[LOG] LiveUpdate::release :
[LOG] LiveUpdate::reset : Reset connection (reason Disconnected)
`

Kind regards,  
Simon

---

<div class="post-metadata">

### Author: ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)
#### Post date: [June 8, 2018, 6:06am UTC](https://qa.fmod.com/t/fmod-studio-api-problem-initializing-usb-sound-card/13927/2 "2018-06-08T06:06:17Z")

</div>

Hi Simon,

In my test of 1.10.05 on Linux it works as expected. Could you please check that you have the x86 version of ALSA installed as well as the x64?

[https://www.fmod.com/resources/documentation-api?page=content/generated/platform\_linux/basics.html#/](https://www.fmod.com/resources/documentation-api?page=content/generated/platform_linux/basics.html#/)

Thanks,  
Richard

---

<div class="post-metadata">

### Author: ![SimonKBR](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@SimonKBR](https://qa.fmod.com/u/SimonKBR)
#### Post date: [June 8, 2018, 3:29pm UTC](https://qa.fmod.com/t/fmod-studio-api-problem-initializing-usb-sound-card/13927/3 "2018-06-08T15:29:15Z")

</div>

> [@](#):
>
> Hi Simon,
> 
> In my test of 1.10.05 on Linux it works as expected. Could you please check that you have the x86 version of ALSA installed as well as the x64?
> 
> [https://www.fmod.com/resources/documentation-api?page=content/generated/platform\_linux/basics.html#/](https://www.fmod.com/resources/documentation-api?page=content/generated/platform_linux/basics.html#/)
> 
> Thanks,  
> Richard

Thanks for your reply. I looked further into the ALSA settings.

ALSA version is 1.1.3 (as seen in de log).  
I checked the ALSA driver version: Advanced Linux Sound Architecture Driver Version k4.14.34-v7+.

The problem has been solved. I changed some settings relevant for my USB sound card in the ALSA config file and selected a different output driver using System::setDriver.

---

<div class="post-metadata">

### Author: ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)
#### Post date: [June 11, 2018, 11:53pm UTC](https://qa.fmod.com/t/fmod-studio-api-problem-initializing-usb-sound-card/13927/4 "2018-06-11T23:53:12Z")

</div>

Good to hear you were able to resolve the issue, Simon. Please let us know if you need any further assistance.

Thanks,  
Richard

---

<div class="post-metadata">

### Author: ![granjow](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/granjow/32/928_2.png) [@granjow](https://qa.fmod.com/u/granjow)
#### Post date: [February 11, 2020, 8:49pm UTC](https://qa.fmod.com/t/fmod-studio-api-problem-initializing-usb-sound-card/13927/5 "2020-02-11T20:49:25Z")

</div>

I just stumbled over the same error message. Running the application as root fixed the issue.

For the record:  
I am running it on a Raspberry Pi 3 B+ on Raspbian Stretch, the output device is a ESI GIGAPORT HD+. To get the device as default output, I needed the following settings:

`/etc/asound.conf`

```
pcm.!default {
        type plug
        slave {
                pcm "hw:1,0"
        }
}

ctl.!default {
        type hw
        card 1
        device 0
}

```

`/usr/share/alsa/alsa.conf`

```
defaults.ctl.card 1
defaults.pcm.card 1
defaults.pcm.device 0
```
