Unable to record and play audio at the same time on EMU20k2
Hi i have a Creative Labs EMU20k2 (Sound Blaster X-Fi Titanium Series), that is used in 4.0 surround mode. Usally it works fine, but when anything uses its capture node, for instance arecord, playback stops, pw logs report:
[W][01716.485357] spa.audioadapter | [ audioadapter.c: 1478 impl_node_process()] 0x556906c88be8: scheduling stopped node
[W][01775.762557] spa.alsa | [ alsa-pcm.c: 2029 get_avail()] surround40:1: (0 missed) impossible htimestamp diff:7615
[W][01777.795837] spa.alsa | [ alsa-pcm.c: 2029 get_avail()] surround40:1: (24 missed) impossible htimestamp diff:105215
[W][01779.829192] spa.alsa | [ alsa-pcm.c: 2029 get_avail()] surround40:1: (24 missed) impossible htimestamp diff:202815
[E][01780.967756] spa.alsa | [ alsa-pcm.c: 2023 get_avail()] surround40:1: wrong htimestamps from driver, disabling
the recording itself continues correctly and sound output recovers a short time after the capture node is idle again, the above makes it look like a potential kernel bug, but the same setup works fine if recording and playback is done via alsa directly, or if pulseaudio is used, additionaly pipewire playback works fine if recording is performed directly via alsa bypassing pipewire.
pipewire version is 0.3.74 kernel is 6.4.3
custom pipewire configuration is as is below, however this dosent seam to matter as the issue remaines even if only the nodes beloging directly to the hardware are used.
context.modules = [
{ name = libpipewire-module-roc-sink
args = {
fec.code = disable
remote.ip = 10.0.0.2
remote.source.port = 10003
remote.repair.port = 10004
sink.name = "ROC Sink"
sink.props = {
node.name = "roc-sink"
}
}
}
]
context.modules = [
{ name = libpipewire-module-roc-source
args = {
local.ip = 10.0.0.1
resampler.profile = medium
fec.code = disable
sess.latency.msec = 50
local.source.port = 10001
local.repair.port = 10002
source.name = "ROC Source"
source.props = {
node.name = "roc-source"
target.object = "xifi_stereo_pair_1"
audio.position = [ FL FR ]
}
}
}
]
context.modules = [
{ name = libpipewire-module-rt
args = {
#nice.level = 20
#rt.prio = 88
#rt.time.soft = -1
#rt.time.hard = -1
}
flags = [ ifexists nofail ]
}
]
context.modules = [
{ name = libpipewire-module-loopback
args = {
node.description = "Living room"
capture.props = {
node.name = "xifi_stereo_pair_1"
media.class = "Audio/Sink"
audio.position = [ FL FR ]
}
playback.props = {
node.name = "playback.xifi_stereo_pair_1"
audio.position = [ FL FR ]
target.object = "alsa_output.pci-0000_03_00.0.analog-surround-40"
stream.dont-remix = true
node.passive = true
}
}
}
{ name = libpipewire-module-loopback
args = {
node.description = "Bed room"
capture.props = {
node.name = "xifi_stereo_pair_2"
media.class = "Audio/Sink"
audio.position = [ FL FR ]
}
playback.props = {
node.name = "playback.xifi_stereo_pair_2"
audio.position = [ RL RR ]
target.object = "alsa_output.pci-0000_03_00.0.analog-surround-40"
stream.dont-remix = true
node.passive = true
}
}
}
]