alsa-project / alsa-ucm-conf

ALSA Use Case Manager configuration
BSD 3-Clause "New" or "Revised" License
76 stars 216 forks source link

SplitPCM devices missing profiles since 1.2.10 #346

Closed freswa closed 8 months ago

freswa commented 1 year ago

When updating t 1.2.10 the profile Analog Stereo Output + Inputs is gone. Instead I get a Surround ... profile, which doesn't work at all.

Downgrading alsa, alsa-ucm-conf and alsa-lib from 1.2.10 to 1.2.9 fixes the issue.

I'm on Kernel 6.5.1 with Pipewire backend.

perexg commented 1 year ago

Could you try to downgrade only alsa-ucm-conf ? But there are no related changes in the config files.

Show alsaucm -c hw:0 dump text output (replace zero with the motu card number - see aplay -l) for 1.2.10.

freswa commented 1 year ago

Only alsa-ucm-conf on 1.2.9:

Verb.HiFi {
    Comment "Analog Stereo Outputs + Inputs"
    Device.Line1 {
        Comment "Headphone + Monitor Out"
        Values {
            CaptureCTL "_ucm0001.hw:M4"
            PlaybackCTL "_ucm0001.hw:M4"
            PlaybackChannels 2
            PlaybackPCM "_ucm0001.m4_stereo_out:M4,0,0,1"
            PlaybackPriority 200
        }
    }
    Device.Line2 {
        Comment "Line Out"
        Values {
            CaptureCTL "_ucm0001.hw:M4"
            PlaybackCTL "_ucm0001.hw:M4"
            PlaybackChannels 2
            PlaybackPCM "_ucm0001.m4_stereo_out:M4,0,2,3"
            PlaybackPriority 100
        }
    }
    Device.Mic1 {
        Comment "Mic In 1L"
        ConflictingDevices [
            Mic3
        ]
        Values {
            CaptureCTL "_ucm0001.hw:M4"
            CaptureChannels 1
            CapturePCM "_ucm0001.m4_mono_in:M4,0,0"
            CapturePriority 200
            PlaybackCTL "_ucm0001.hw:M4"
        }
    }
    Device.Mic2 {
        Comment "Mic In 2R"
        ConflictingDevices [
            Mic3
        ]
        Values {
            CaptureCTL "_ucm0001.hw:M4"
            CaptureChannels 1
            CapturePCM "_ucm0001.m4_mono_in:M4,0,1"
            CapturePriority 100
            PlaybackCTL "_ucm0001.hw:M4"
        }
    }
    Device.Line3 {
        Comment "Line In L"
        ConflictingDevices [
            Line5
        ]
        Values {
            CaptureCTL "_ucm0001.hw:M4"
            CaptureChannels 1
            CapturePCM "_ucm0001.m4_mono_in:M4,0,2"
            CapturePriority 100
            PlaybackCTL "_ucm0001.hw:M4"
        }
    }
    Device.Line4 {
        Comment "Line In R"
        ConflictingDevices [
            Line5
        ]
        Values {
            CaptureCTL "_ucm0001.hw:M4"
            CaptureChannels 1
            CapturePCM "_ucm0001.m4_mono_in:M4,0,3"
            CapturePriority 100
            PlaybackCTL "_ucm0001.hw:M4"
        }
    }
    Device.Mic3 {
        Comment "Stereo Mic In 1L+1R"
        ConflictingDevices [
            Mic2,
            Mic1
        ]
        Values {
            CaptureCTL "_ucm0001.hw:M4"
            CaptureChannels 2
            CapturePCM "_ucm0001.m4_stereo_in:M4,0,0,1"
            CapturePriority 100
            PlaybackCTL "_ucm0001.hw:M4"
        }
    }
    Device.Line5 {
        Comment "Stereo Line In L+R"
        ConflictingDevices [
            Line4,
            Line3
        ]
        Values {
            CaptureCTL "_ucm0001.hw:M4"
            CaptureChannels 2
            CapturePCM "_ucm0001.m4_stereo_in:M4,0,2,3"
            CapturePriority 100
            PlaybackCTL "_ucm0001.hw:M4"
        }
    }
}
Verb.Direct {
    Comment "Direct M4"
    Device.Direct {
        Comment "Direct M4"
        Values {
            CaptureCTL "_ucm0001.hw:M4"
            CaptureChannels 4
            CapturePCM "_ucm0001.hw:M4"
            CapturePriority 1000
            PlaybackCTL "_ucm0001.hw:M4"
            PlaybackChannels 4
            PlaybackPCM "_ucm0001.hw:M4"
            PlaybackPriority 1000
        }
    }
}

alsa-ucm-conf on 1.2.10:

ALSA lib ucm_subs.c:807:(uc_mgr_get_substituted_value) variable '${var:__Device}' is not defined in this context!
ALSA lib parser.c:2024:(parse_verb_file) error: /USB-Audio/MOTU/M4-HiFi.conf failed to parse device
ALSA lib main.c:1554:(snd_use_case_mgr_open) error: failed to import hw:3 use case configuration -22
alsaucm: error failed to open sound card hw:3: Invalid argument
perexg commented 1 year ago

Could you test the above one character fix (b68aa52acdd2763fedad5eec0f435fbf43e5ccc6) ?

freswa commented 1 year ago

Works for me

CameronNemo commented 1 year ago

Just updated to 1.2.10. I have a separate device but the same error.

ALSA lib ucm_subs.c:807:(uc_mgr_get_substituted_value) variable '${var:__Device}' is not defined in this context!
ALSA lib parser.c:2024:(parse_verb_file) error: /USB-Audio/Steinberg/UR44-HiFi.conf failed to parse device
ALSA lib main.c:1554:(snd_use_case_mgr_open) error: failed to import hw:2 use case configuration -22
ALSA lib parser.c:2965:(uc_mgr_scan_master_configs) Unable to open '-hw:2': Invalid argument
alsaucm: error failed to get card list: Invalid argument

I edited the config manually in the same manner as the patch and it fixed the issue. Note there are some other __Device var references later in SplitPCM... not sure if that needs updating.

nodens commented 1 year ago

FYI, same issue with Arturia Minifuse 2, applying the change locally fixes it. I guess it affects all cards using split.conf.

kepstin commented 11 months ago

Yeah, appears to affect many cards that use SplitPCM. I was using 1.2.9 with https://github.com/alsa-project/alsa-ucm-conf/pull/309 applied to add support for my Scarlett Solo, and was quite confused after upgrading to 1.2.10 where despite the configuration being merged, it was no longer being applied.

I ended up adding the patch https://github.com/alsa-project/alsa-ucm-conf/commit/b68aa52acdd2763fedad5eec0f435fbf43e5ccc6 to the Exherbo distribution package for alsa-ucm-conf to fix the issue for all our users, but I'd really appreciate a bugfix release of alsa-ucm-conf which includes this fix (and I assume package maintainers on other distros would too).

CameronNemo commented 11 months ago

Just to clarify the scope/impact here, because the title only says Motu M4: this seems to affect anything using SplitPCM, so this is probably 19 different models of USB audio interface.

~> rg -l SplitPCM /usr/share/alsa/ucm2/ | wc -l
20
~> rg -l SplitPCM /usr/share/alsa/ucm2
/usr/share/alsa/ucm2/USB-Audio/NativeInstruments/Traktor-Kontrol-Z1-Mixer.conf
/usr/share/alsa/ucm2/USB-Audio/Audient/Audient-iD4-HiFi-0003.conf
/usr/share/alsa/ucm2/USB-Audio/Steinberg/UR44-HiFi.conf
/usr/share/alsa/ucm2/USB-Audio/Steinberg/UR24C-HiFi.conf
/usr/share/alsa/ucm2/USB-Audio/Audient/Audient-iD4-HiFi-0009.conf
/usr/share/alsa/ucm2/USB-Audio/Roland/BridgeCast-Hifi.conf
/usr/share/alsa/ucm2/USB-Audio/USB-Audio.conf
/usr/share/alsa/ucm2/USB-Audio/Arturia/Minifuse-4-HiFi.conf
/usr/share/alsa/ucm2/USB-Audio/Arturia/Minifuse-12-HiFi.conf
/usr/share/alsa/ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3-HiFi.conf
/usr/share/alsa/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf
/usr/share/alsa/ucm2/USB-Audio/Behringer/UMC202HD-HiFi.conf
/usr/share/alsa/ucm2/USB-Audio/Behringer/Flow8-Recording-Hifi.conf
/usr/share/alsa/ucm2/USB-Audio/Behringer/Flow8-Streaming-Hifi.conf
/usr/share/alsa/ucm2/USB-Audio/MOTU/M2-HiFi.conf
/usr/share/alsa/ucm2/USB-Audio/UniversalAudio/Volt2-HiFi.conf
/usr/share/alsa/ucm2/USB-Audio/MOTU/M4-HiFi.conf
/usr/share/alsa/ucm2/USB-Audio/Focusrite/Scarlett-2i-HiFi.conf
/usr/share/alsa/ucm2/USB-Audio/GoXLR/GoXLR-HiFi.conf
/usr/share/alsa/ucm2/common/pcm/split.conf
maxhille commented 10 months ago

@perexg It'll soon be half a year since this was fixed. Distributions on 1.2.10 have broken audio and some non-rolling distros will prep their spring releases in the coming weeks. It would be wonderful to get a 1.2.11

maxhille commented 10 months ago

@freswa Could you edit this issue's title to reflect that all SplitPCM devices are affected?

Slabity commented 8 months ago

Any update on this? It looks like the patch to fix this has been applied, but my audio setup is still completely broken with profiles not splitting relevant Input/Outputs and causing applications to fail to use the correct devices:

Good profiles:

goodaudiooutput

Bad profiles:

badaudiooutputs

Unless this is irrelevant to this issue, in which case I'll open up a different issue.

kepstin commented 8 months ago

@Slabity the list of profiles that you have under "Bad profiles" is the expected profiles that should be available on a Scarlett Solo device. If you select the profile "Default", then it will split the input into two separate mono inputs, labelled "Input 1 Mic" and "Input 2 Inst/Line". You will have a single stereo output labelled "Headphones / Line 1-2".

From your output, the profiles are correctly being applied - if you have an issue with what the profile is doing, please file a separate issue.

This issue should probably be closed, since the fix is in released version 1.2.11.

Slabity commented 8 months ago

@kepstin - Yes, "Default" will do what you are describing, but the problem is I do not want the "Headphones / Line 1-2" output to appear at all with no way of disabling it. I only use this device as a mic input, and when that output exists then various applications try to use it as the primary output device for some reason.

For years I have been able to simply select "Digital Stereo (IEC958) Input" and it has allowed me to expose only the input device and everything works smoothly. Only the past 2-3 weeks has this changed and removed the different profiles. I was told on a Matrix chat that the change in behavior was likely part of this issue but it sounds like it's unrelated? If so then I'll open a new issue.

perexg commented 8 months ago

Closing as already fixed in 1.2.11.