The officially official Devuan Forum!

You are not logged in.

#1 Today 17:01:05

kapqa
Member
Registered: 2019-01-02
Posts: 391  

[SOLVED] (alsa) arateconf not saving properly

Hello ,

this post is for troubleshooting a alsa setup on LinuxMint;

maybe it can help troubleshoot someone else, too.

setup was attempted with kind help of user @igorzwx

https://dev1galaxy.org/viewtopic.php?pid=49837#p49837
https://dev1galaxy.org/viewtopic.php?pid=57771#p57771

fuser -av $(find /dev/snd -type c 2>/dev/null)

fuser -av $(find /dev/snd -type c 2>/dev/null)
                     USER        PID ACCESS COMMAND
/dev/snd/controlC1:
/dev/snd/pcmC1D0p:
/dev/snd/controlC3:
/dev/snd/hwC3D0:
/dev/snd/pcmC3D2c:
/dev/snd/pcmC3D1p:
/dev/snd/pcmC3D0c:
/dev/snd/pcmC3D0p:
/dev/snd/controlC0:
/dev/snd/controlC2:
/dev/snd/hwC0D0:
/dev/snd/pcmC0D9p:
/dev/snd/pcmC0D8p:
/dev/snd/pcmC0D7p:
/dev/snd/pcmC0D3p:
/dev/snd/hwC2D0:
/dev/snd/pcmC2D7p:
/dev/snd/pcmC2D3p:
/dev/snd/seq:
/dev/snd/timer:

inxi -A

inxi -A
Audio:
  Device-1: AMD Navi 31 HDMI/DP Audio driver: snd_hda_intel
  Device-2: AMD Rembrandt Radeon High Definition Audio driver: snd_hda_intel
  Device-3: AMD Family 17h/19h HD Audio driver: snd_hda_intel
  Device-4: Cambridge Audio USB 1.0 driver: snd-usb-audio type: USB
  API: ALSA v: k6.8.0-79-generic status: kernel-api

cat ~/.asoundrc

cat ~/.asoundrc
# ALSA library configuration file managed by arateconf.
#
# MANUAL CHANGES TO THIS FILE WILL BE OVERWRITTEN!
#
# Manual changes to the ALSA library configuration should be implemented
# by editing the ~/.asoundrc file, not by editing this file.

#=====================================================
# Configuration for HDMI
#-----------------------------------------------------

# Perform dmixer
pcm.dmixer_HDMI
{
    type            dmix
    ipc_key            1024
    ipc_perm        0666

    hint
    {
        show        off
        description    "Direct mixing of multiple audio streams (HDMI)"
    }

    slave
    {
        pcm        "hw:HDMI,0"

        rate        48000
        channels    2
        format        S32_LE

        period_size    1920
        buffer_size    7680
    }
}

# Perform dsnooper
pcm.dsnooper_HDMI
{
    type            dsnoop
    ipc_key            1025
    ipc_perm        0666

    hint
    {
        show        off
        description    "Recording from the same device for several applications simultaneously (HDMI)"
    }

    slave
    {
        pcm        "hw:HDMI,0"

        rate        48000
        format        S32_LE

        period_size    1920
        buffer_size    7680
    }
}

# Perform duplex
pcm.duplex_HDMI
{
    type            asym
    playback.pcm        "dmixer_HDMI"
    capture.pcm        "dsnooper_HDMI"

    hint
    {
        show        off
        description    "Full duplex for simultaneous playback and recording (HDMI)"
    }
}

# Perform convert
pcm.convert_HDMI
{
    type            rate
    converter        fftrate

    hint
    {
        show        off
        description    "Sample rate converter (HDMI)"
    }

    slave
    {
        pcm    "duplex_HDMI"
        rate    48000
        format    S32_LE
    }
}

# Perform plug device
pcm.primary_HDMI
{
    type            plug
    slave.pcm        "convert_HDMI"
    hint.description    "Primary device (HDMI)"
}

#=====================================================
# Configuration for C10
#-----------------------------------------------------

# Perform dmixer
pcm.dmixer_C10
{
    type            dmix
    ipc_key            1026
    ipc_perm        0666

    hint
    {
        show        off
        description    "Direct mixing of multiple audio streams (C10)"
    }

    slave
    {
        pcm        "hw:C10,0"

        rate        192000
        channels    2
        format        S24_3LE

        period_size    7680
        buffer_size    30720
    }
}

# Perform dsnooper
pcm.dsnooper_C10
{
    type            dsnoop
    ipc_key            1027
    ipc_perm        0666

    hint
    {
        show        off
        description    "Recording from the same device for several applications simultaneously (C10)"
    }

    slave
    {
        pcm        "hw:C10,0"

        rate        192000
        format        S24_3LE

        period_size    7680
        buffer_size    30720
    }
}

# Perform duplex
pcm.duplex_C10
{
    type            asym
    playback.pcm        "dmixer_C10"
    capture.pcm        "dsnooper_C10"

    hint
    {
        show        off
        description    "Full duplex for simultaneous playback and recording (C10)"
    }
}

# Perform convert
pcm.convert_C10
{
    type            rate
    converter        fftrate

    hint
    {
        show        off
        description    "Sample rate converter (C10)"
    }

    slave
    {
        pcm    "duplex_C10"
        rate    192000
        format    S24_3LE
    }
}

# Perform plug device
pcm.capture_C10
{
    type            plug
    slave.pcm        "convert_C10"
    hint.description    "Capture device (C10)"
}

#=====================================================
# Configuration for Generic
#-----------------------------------------------------

# Perform dmixer
pcm.dmixer_Generic
{
    type            dmix
    ipc_key            1028
    ipc_perm        0666

    hint
    {
        show        off
        description    "Direct mixing of multiple audio streams (Generic)"
    }

    slave
    {
        pcm        "hw:Generic,0"

        rate        48000
        channels    2
        format        S32_LE

        period_size    1920
        buffer_size    7680
    }
}

# Perform dsnooper
pcm.dsnooper_Generic
{
    type            dsnoop
    ipc_key            1029
    ipc_perm        0666

    hint
    {
        show        off
        description    "Recording from the same device for several applications simultaneously (Generic)"
    }

    slave
    {
        pcm        "hw:Generic,0"

        rate        48000
        format        S32_LE

        period_size    1920
        buffer_size    7680
    }
}

# Perform duplex
pcm.duplex_Generic
{
    type            asym
    playback.pcm        "dmixer_Generic"
    capture.pcm        "dsnooper_Generic"

    hint
    {
        show        off
        description    "Full duplex for simultaneous playback and recording (Generic)"
    }
}

# Perform convert
pcm.convert_Generic
{
    type            rate
    converter        fftrate

    hint
    {
        show        off
        description    "Sample rate converter (Generic)"
    }

    slave
    {
        pcm    "duplex_Generic"
        rate    48000
        format    S32_LE
    }
}

# Perform plug device
pcm.primary_Generic
{
    type            plug
    slave.pcm        "convert_Generic"
    hint.description    "Default device (Generic)"
}

#=====================================================
# Configuration for Generic_1
#-----------------------------------------------------

# Perform dmixer
pcm.dmixer_Generic_1
{
    type            dmix
    ipc_key            1030
    ipc_perm        0666

    hint
    {
        show        off
        description    "Direct mixing of multiple audio streams (Generic_1)"
    }

    slave
    {
        pcm        "hw:Generic_1,0"

        rate        48000
        channels    2
        format        S32_LE

        period_size    1920
        buffer_size    7680
    }
}

# Perform dsnooper
pcm.dsnooper_Generic_1
{
    type            dsnoop
    ipc_key            1031
    ipc_perm        0666

    hint
    {
        show        off
        description    "Recording from the same device for several applications simultaneously (Generic_1)"
    }

    slave
    {
        pcm        "hw:Generic_1,0"

        rate        48000
        format        S32_LE

        period_size    1920
        buffer_size    7680
    }
}

# Perform duplex
pcm.duplex_Generic_1
{
    type            asym
    playback.pcm        "dmixer_Generic_1"
    capture.pcm        "dsnooper_Generic_1"

    hint
    {
        show        off
        description    "Full duplex for simultaneous playback and recording (Generic_1)"
    }
}

# Perform convert
pcm.convert_Generic_1
{
    type            rate
    converter        fftrate

    hint
    {
        show        off
        description    "Sample rate converter (Generic_1)"
    }

    slave
    {
        pcm    "duplex_Generic_1"
        rate    48000
        format    S32_LE
    }
}

# Perform plug device
pcm.primary_Generic_1
{
    type            plug
    slave.pcm        "convert_Generic_1"
    hint.description    "Default device (Generic_1)"
}

#=====================================================
# Configuration for default audio device
#-----------------------------------------------------

# Perform plug device
pcm.capture
{
    type            plug
    slave.pcm        "convert_HDMI"
    hint.description    "Capture device"
}

# Perform plug device
pcm.!default
{
    type            plug
    slave.pcm        "convert_C10"
    hint.description    "Primary device"
}

whereis arateconf

whereis arateconf
arateconf: /usr/bin/arateconf

issue is with

arateconf

whenever i change something there, it seems then to revert back to initial settings as shown here

===============
|  Main menu  |
---------------

    Curr. | Used | Play (def) | Rec (def) | Available cards
----------|------|------------|-----------|-----------------------------------
0 - >>>>> |  *   |  *     *   |  *    *   | HDA-Intel - HDA ATI HDMI
1 -       |  *   |  *         |  *        | USB-Audio - Cambridge Audio USB Audio 1.0
2 -       |  *   |  *         |  *        | HDA-Intel - HD-Audio Generic
3 -       |  *   |  *         |  *        | HDA-Intel - HD-Audio Generic

U - Toggle used flag
P - Set this device as default player
R - Set this device as default recorder

O - Output device: HDMI,0
I - Input device : HDMI,0

F - Format: 48000 Hz, 2 ch, 'S32_LE'
C - Converter: fftrate

A - Show all plugins [ ]
M - Plug-ins:
[X] Convert,  [ ] Expand, [X] Asym
[ ] Play Vol, [X] Dmix
[ ] Rec. Vol, [X] Dsnoop
[ ] Phonon,   [ ] Normalizator

T - Test
S - Save to '/home/rich/.asoundrc'
X - Delete '/home/rich/.asoundrc'

ESC - Exit
>

i mean, the setting is changed factually, from HDMI to DAC (as desired), but arateconf shows itself as if HDMI is default when i evoke it next time, or is this by default?

thanks

EDIT: it seems that the DAC has now effectively switch to 24Bit/96Khz, so maybe something has saved and worked.
EDIT2: sound however always revert back to HDMI, even if i set the output in Mate Sound Settings Output (from HDMI to USB DAC) > next time opening, its back to HDMI.
EDIT3: it seems arateconf is taking precedence, so maybe this can be solved?

Last edited by kapqa (Today 17:39:12)

Online

#2 Today 17:42:44

igorzwx
Member
Registered: 2024-05-06
Posts: 243  

Re: [SOLVED] (alsa) arateconf not saving properly

Config was saved (but it was, perhaps, misconfigured). You can read it with command

cat ~/.asoundrc

Tests failed, perhaps.
Was it like this:

Saving config file...
Test: 'default' ... 'capture' ... Failed!
Test: 'default' ... 'capture' ... Failed!
Ok.

Try
DAC : 32bit 96kHz
HDA : 32bit 192kHz
HDMI: 16bit 48kHz

? DAC : 32bit 192kHz

What is in the spec? If 24bit, try 32bit and 24bit.

24bit usually means 32bit in this context.

EDIT:
If you managed to compile the fftrate (despite so little experience with Linux), you might be able to solve any problem.

HDMI is most probably 16bit 48kHz
HDA codec (motherboard) usually supports 32bit 192kHz (best quality) and some other formats.

If this you DAC spec _https://dev1galaxy.org/viewtopic.php?pid=57443#p57443
you have to try 32bit 192kHz
If it does not work, try 24bit or 16bit.

Last edited by igorzwx (Today 18:24:58)

Offline

#3 Today 18:22:46

kapqa
Member
Registered: 2019-01-02
Posts: 391  

Re: [SOLVED] (alsa) arateconf not saving properly

spec is perhaps

usb 1.0 > max. 24/96khz
usb 2.0>  max 24/192khz

macos> over usb > max 24/192khz
s/pdif > max 24/96?

yes, little experience, but now it sounds better.

it seems if i switch to USB 2.0 mode, it wouldn't play, but maybe just needs to be re-configured again properly; will test some more.

could be wrong about those; there should be upsampling on the DAC from source material to 24/384, but this is not shown on the device itself;

Online

#4 Today 18:43:04

igorzwx
Member
Registered: 2024-05-06
Posts: 243  

Re: [SOLVED] (alsa) arateconf not saving properly

If you switch to USB2, it should be re-configured.

"upsampling on the DAC from source material to 24/384" (in your DAC) has nothing to do with the fftrate plugin, arateconf, and ALSA.

Spec of your DAC:

Digital input word widths supported

16-24bit

Digital input sampling frequencies supported

32kHz, 44.1kHz, 48kHz, 88.2kHz, 96kHz, 176.4kHz**, 192kHz

_https://dev1galaxy.org/viewtopic.php?pid=57443#p57443

On Linux (s/pdif), your DAC should support 32bit 192kHz (or 32bit 96kHz, or else).
It is so with OSS4 (in exclusive mode), and it should be the same with ALSA.

Try 32bit instead of 24bit.

The 32-bit representation serves as a larger, more flexible "container" to preserve the higher precision of the 24-bit data and prevent clipping during internal mixing or editing, especially in professional digital audio workstations (DAWs). The 24-bit data is stored within the 32-bit format, ensuring its precision is maintained without needing resampling.

Why 32-bit is Used as a Container
DAWs and audio servers use 32-bit internally to avoid the complexities of dithering and exporting to fixed-point formats like 24-bit...
When 24-bit integer data is stored in a 32-bit container, the 24-bit precision is preserved within the larger format, similar to storing a number like 0100 in a longer string of zeros, like 00000100.

It may sound esoteric, but it is about Linux drivers for sound cards. The drivers usually support 32-bit (rather than 24-bit) containers for audio formats (digital input).

Last edited by igorzwx (Today 20:54:06)

Offline

#5 Today 21:38:31

kapqa
Member
Registered: 2019-01-02
Posts: 391  

Re: [SOLVED] (alsa) arateconf not saving properly

thanks, but i have not yet s/pdif on the PC motherboard; was planning to buy the pcie x1 card , but postponed; will check then.

yes, i have heard that sound over USB may be spotty, and although it seems there offer higher bandwith intotal when compared to s/pdif, that may well not be the whole there is to the  story.

Online

Board footer