alsa-project/alsa-ucm-conf

Newest Update for Fedora 37 (alsa-ucm-1.2.9-1.fc37) causes crackling with device

ClaraCrazy opened this issue ยท 8 comments

First bug report here + not skilled with debugging, so please go easy on me ๐Ÿ˜„

OS: Fedora 37
Alsa-lib: 1.2.9-1
Issue: Audio crackling
Audio Device: Logic3 TX101 5.1 Soundbar connected via Scarlett 2i2 3rd Gen audio interface (USB)

Reverted lib back to alsa-lib.1.2.8-2.fc37 (which in turn also downgraded alsa-ucm and alsa-utils again) and issues are fixed. I have no idea how to debug this, but would love to help in any way possible, sadly there was no issue template that would give me infos on what logs are useful / where to get those so uh.. please someone just point me in the right direction :)

Thanks for your time

perexg commented

Could you try to downgrade only ucm package? There seem to be no related changes in alsa-lib.

Downgrading just UCM to the version that was previously on my system (1.2.8-2) also forces me to downgrade the utils package to 1.2.7-2 and it does fix the issue. So it seems that blaming lib was a bit hasty.

For testing, I also then upgraded just ucm, keeping utils on the same downgraded version, and the issue is back. So yes, UCM is the culprit it seems.

Now, whats next? ๐Ÿ˜„

perexg commented

Is your card detected as Focusrite Scarlett 2i4 Gen 2 with 1.2.8 ? Also Line2 device should be present in 1.2.8, but removed in 1.2.9.

If it's correct, try 1.2.9 again and modify /usr/share/alsa/ucm2/USB-Audio/Focusrite/Scarlett-2i-HiFi.conf - change PlaybackChannels and DirectPlaybackChannels from 2 to 4 in If.scarlett_2i2_gen3 block there.

using aplay -l I get USB [Scarlett 2i2 USB] and using arecord -L I get Scarlett 2i2 USB, USB Audio. Interestingly enough, the file you instructed me to modify, only has a block for If.scarlet_2i4 on both the new and the old version (file names differ slightly, same contents) however, neither PlaybackChannels nor DirectPlaybackChannels exist.

Here are the files for both 1.2.8 and 1.2.9:

1.2.8 /usr/share/alsa/ucm2/USB-Audio/Focusrite/Scarlett-2i-gen2-HiFi.conf
Include.pcm_split.File "/common/pcm/split.conf"

Macro [
	{
		SplitPCM {
			Name "scarlett2i_stereo_out"
			Direction Playback
			Format S32_LE
			Channels 2
			HWChannels 4
			HWChannelPos0 FL
			HWChannelPos1 FR
			HWChannelPos2 FL
			HWChannelPos3 FR
		}
	}
	{
		SplitPCM {
			Name "scarlett2i_mono_in"
			Direction Capture
			Format S32_LE
			Channels 1
			HWChannels 2
			HWChannelPos0 MONO
			HWChannelPos1 MONO
		}
	}
]

SectionDevice."Line1" {
	Comment "Line 1-2"
	Value {
		PlaybackPriority 200
	}
	Macro.pcm_split.SplitPCMDevice {
		Name "scarlett2i_stereo_out"
		Direction Playback
		HWChannels 4
		Channels 2
		Channel0 0
		Channel1 1
		ChannelPos0 FL
		ChannelPos1 FR
	}
}

If.scarlett_2i4 {
	Condition {
		Type String
		String1 "${var:PlaybackChannels}"
		String2 "4"
	}
	True.SectionDevice."Line2" {
		Comment "Line 3-4"

		Value {
			PlaybackPriority 100
		}
		Macro.pcm_split.SplitPCMDevice {
			Name "scarlett2i_stereo_out"
			Direction Playback
			HWChannels 4
			Channels 2
			Channel0 2
			Channel1 3
			ChannelPos0 FL
			ChannelPos1 FR
		}
	}
}

SectionDevice."Mic1" {
	Comment "Input 1"

	Value {
		CapturePriority 200
	}
	Macro.pcm_split.SplitPCMDevice {
		Name "scarlett2i_mono_in"
		Direction Capture
		HWChannels 2
		Channels 1
		Channel0 0
		ChannelPos0 MONO
	}
}

SectionDevice."Mic2" {
	Comment "Input 2"

	Value {
		CapturePriority 100
	}
	Macro.pcm_split.SplitPCMDevice {
		Name "scarlett2i_mono_in"
		Direction Capture
		HWChannels 2
		Channels 1
		Channel0 1
		ChannelPos0 MONO
	}
}
1.2.9 /usr/share/alsa/ucm2/USB-Audio/Focusrite/Scarlett-2i-HiFi.conf
Include.pcm_split.File "/common/pcm/split.conf"

Macro [
	{
		SplitPCM {
			Name "scarlett2i_stereo_out"
			Direction Playback
			Format S32_LE
			Channels 2
			HWChannels 4
			HWChannelPos0 FL
			HWChannelPos1 FR
			HWChannelPos2 FL
			HWChannelPos3 FR
		}
	}
	{
		SplitPCM {
			Name "scarlett2i_mono_in"
			Direction Capture
			Format S32_LE
			Channels 1
			HWChannels 2
			HWChannelPos0 MONO
			HWChannelPos1 MONO
		}
	}
]

SectionDevice."Line1" {
	Comment "Line 1-2"
	Value {
		PlaybackPriority 200
	}
	Macro.pcm_split.SplitPCMDevice {
		Name "scarlett2i_stereo_out"
		Direction Playback
		HWChannels 4
		Channels 2
		Channel0 0
		Channel1 1
		ChannelPos0 FL
		ChannelPos1 FR
	}
}

If.scarlett_2i4 {
	Condition {
		Type String
		String1 "${var:PlaybackChannels}"
		String2 "4"
	}
	True.SectionDevice."Line2" {
		Comment "Line 3-4"

		Value {
			PlaybackPriority 100
		}
		Macro.pcm_split.SplitPCMDevice {
			Name "scarlett2i_stereo_out"
			Direction Playback
			HWChannels 4
			Channels 2
			Channel0 2
			Channel1 3
			ChannelPos0 FL
			ChannelPos1 FR
		}
	}
}

SectionDevice."Mic1" {
	Comment "Input 1"

	Value {
		CapturePriority 200
	}
	Macro.pcm_split.SplitPCMDevice {
		Name "scarlett2i_mono_in"
		Direction Capture
		HWChannels 2
		Channels 1
		Channel0 0
		ChannelPos0 MONO
	}
}

SectionDevice."Mic2" {
	Comment "Input 2"

	Value {
		CapturePriority 100
	}
	Macro.pcm_split.SplitPCMDevice {
		Name "scarlett2i_mono_in"
		Direction Capture
		HWChannels 2
		Channels 1
		Channel0 1
		ChannelPos0 MONO
	}
}

As you can tell, neither of these have the values you suggested tweaking. I'm not sure why that is. I never messed with any of those components and just for sanity sake I set up a fresh VM with USB passthrough, which resulted in the exact same.

perexg commented

Oops. Wrong file. It should be /usr/share/alsa/ucm2/USB-Audio/Focusrite/Scarlett-2i.conf of course.

Well, I tried changing it to 4, but sadly that does not fix my issue. Quite the opposite in fact. When changing both values to 4, I get no audio out at all. I'll try each value at a time and will edit this in a few minutes.

DirectPlaybackChannels doesnt make any audible changes
PlaybackChannels is what kills the audio completely