ALSA: error setting input device format bits

Optimize your system for ultimate performance.

Moderators: khz, MattKingUSA

ubuntuuser
Established Member
Posts: 277
Joined: Mon Jan 02, 2017 9:46 am

Re: ALSA: error setting input device format bits

Postby ubuntuuser » Fri Jan 10, 2020 3:28 am

Boone777 wrote:
ubuntuuser wrote:
Boone777 wrote:Hello!
I have not been able to use ALSA in Reaper with my interface: NI Session

I can select ALSA in Reaper on a Vanilla install of any distro, then select my interface for ins and outs but when I hit apply:
ALSA: error setting input device format bits

I tried many distros currently the best for my setup is Xubuntu and also trying on the side Manjaro-RT cinnamon.

I have no problem setting things up with Cadence and use ALSA via jack, but I get some crackles after with only 1 or 2 instruments at 256 sample 5,6ms latency. Instruments are either Repro-5 from U-he (native linux) or it could be Kontakt via Linvst.
I understand these might not be optimized for Linux but on my Win7 boot on same computer I can get up to 10 heavy instruments in realtime 3,5-5 ms no problem.

Also HTOP shows high random activity for Pulseaudio or Cinnamon --replace when real-time kernel is on for both Xubuntu and Manjaro.

I'd like to try ALSA but everything I tried so far tells me my interface maybe is not supported by ALSA ?

Pulse recognise it no problem everything works in Pulseaudio.



Intel Core i7-3770 Quad-Core Processor 3.4, Nvidia Geforce GTX1050Ti, Reaper 5,99 16gig RAM, Kingdian 480gig SSD


Some distros such as Manjaro don't seem to setup realtime so you could try that, also don''t use wine-rt use wineHQ staging, winehq is the latest and greatest.


set realtime priorities

If they are not set then cpu spiking can occur with Kontakt and other plugins.


sudo edit /etc/security/limits.conf

add

@audio - rtprio 99

------

sudo edit /etc/group

change

audio:x:29:pulse

to audio:x:29:pulse,<your_username>

------------

sudo edit /etc/security/limits.d/audio.conf

@audio - rtprio 95
@audio - memlock unlimited
#@audio - nice -19



Manjaro-RT does'nt set realtime ? That's weird. Is it really worth it to enter these commands it seems to break the OS the more fiddle with it.


Manjaro doesn't, I don't know about Manjaro-RT.

It's just editing a few files and adding a few lines.

The editor I've got by default on Manjaro is Mousepad, so the editing commands (using a terminal) would be

sudo mousepad /etc/security/limits.d/audio.conf

and so on for the other files (/etc/security/limits.conf, /etc/group).

If the entries are already in those files (/etc/security/limits.d/audio.conf, /etc/security/limits.conf, /etc/group) then obviously nothing needs to be changed in them.

ubuntuuser
Established Member
Posts: 277
Joined: Mon Jan 02, 2017 9:46 am

Re: ALSA: error setting input device format bits

Postby ubuntuuser » Fri Jan 10, 2020 3:32 am

Boone777 wrote:
ubuntuuser wrote:The 24 bit format might be need to be setup in a ~/.asoundrc file (/home/your-username/.asoundrc)


Maybe something like this below but the device number (hw:1,0) and the card number (1) may need to be altered for your device, although the usb audio device and card number will usually be 1 if it's used with the inbuilt sound which is usually device 0 and card number 0.

It assumes the audio device is hw:1 (cat /proc/asound/cards)

Jack can then be started using something like jackd --realtime -d alsa -d hw:1 -p256 -n2 -r96000

Then start Reaper or another DAW

I can't verify any of this because I don't have a Guitar Rig Session usb, so you probably need to tweak it for your device.

To get the device/card info use

cat /proc/asound/cards

aplay -l

arecord -l


More details at https://www.volkerschatz.com/noise/alsa.html


------------

pcm.!default
{
type plug
slave sl3
}

ctl.!default
{
type hw
card 1
}

# Makes the subdevices aka channel 1&2 available for alsa applications

pcm_slave.sl3
{
pcm "hw:1,0"
format S24_3BE
channels 2
rate 192000
}

----------


It works with Jack and Pulseaudio already I just want to make it work with ALSA only to avoid bridging wich I suspect is not helping latency.
But yes Reaper sees the interface as hw:0


The /home/your-username/.asoundrc file above might help with Reaper and the ALSA input bits error and might not.

Just try it and if it doesn't work then it doesn't work.

From a terminal,

mousepad ~/.asoundrc (or mousepad /home/your-username/.asoundrc)

then add the below to the file and save the file.

If it doesn't work then just delete the .asoundrc file.

pcm.!default
{
type plug
slave sl3
}

ctl.!default
{
type hw
card 1
}

# Makes the subdevices aka channel 1&2 available for alsa applications

pcm_slave.sl3
{
pcm "hw:1,0"
format S24_3BE
channels 2
rate 192000
}

ubuntuuser
Established Member
Posts: 277
Joined: Mon Jan 02, 2017 9:46 am

Re: ALSA: error setting input device format bits

Postby ubuntuuser » Fri Jan 10, 2020 4:14 am

In general, the reason for setting realtime configuration and maybe a custom asoundrc is that only some distros are setup especially for realtime audio, as most users are not audio centric.

I have had to set the realtime priorities on Manjaro and I used to have to do it on Mint.

I don't need to set the realtime priorities on Ubuntu Studio or MX Linux where just installing qjackctl and answering yes to realtime does the job.

I have had to use a custom asoundrc file for a Edirol usb audio device that I have.

User avatar
Linuxmusician01
Established Member
Posts: 697
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland

Re: ALSA: error setting input device format bits

Postby Linuxmusician01 » Fri Jan 10, 2020 2:10 pm

First of all sorry for the tl;dr. Y'all keep on advising to set a sample rate of 192 kHz via ~/.asoundrc. The good old audio CD is 44.1 kHz and usually I do not see any audio app of audio file use more than 48 kHz. Maybe it's me but aren't the pops and crackles a result of a sample rate that a bit too ambitious for this computer/Linux? May the reason that it works fine in Windows be that the rate in that OS is capped somehow?

ubuntuuser
Established Member
Posts: 277
Joined: Mon Jan 02, 2017 9:46 am

Re: ALSA: error setting input device format bits

Postby ubuntuuser » Sat Jan 11, 2020 7:01 am

Lists Alsa hardware info and the audio devices formats which can be used to setup a custom asoundrc file

https://gitlab.com/sonida/alsa-capabilities

chmod +x alsa-capabilities and then run it

https://lacocina.nl/detect-alsa-output-capabilities


Return to “System Tuning and Configuration”

Who is online

Users browsing this forum: No registered users and 2 guests