Peter Kövesdi - 2020-04-22

Hey,

I'm running XBian on a rasperry pi. I'd like to have squeezelite running
in parallel to Kodi, both using the same soundcard output at the same time.
Now, further more I want squeezelite to play directly, and Kodi to play
with swapped stereo channels.

For this purpose I wrote the following /etc/asound.conf:


pcm.dmixer {
type dmix
ipc_key 1023
ipc_perm 0666
slave {
pcm "hw:1,0"
rate 44100
}
bindings {
0 0
1 1
}
}

pcm.swapped {
type plug
slave {
pcm "dmixer"
}
ttable.0.1 1
ttable.1.0 1
}


Kodi is supposed to use 'swapped', while squeezelite is supposed to use
'dmixer' directly.

The problem is, in Kodi the ttable entries of 'swapped' seem ignored,
the channels are still unswapped. If I use 'swapped' with squeezelite,
it's ok, they get swapped.

Now, my workaround at the moment is this: I swap in 'dmixer' (where
swapping works in Kodi as well) and again in 'swapped', and use the
opposite: 'dmixer' for Kodi and 'swapped' for squeezelite:


pcm.dmixer {
type dmix
ipc_key 1023
ipc_perm 0666
slave {
pcm "hw:1,0"
rate 44100
}
bindings {
0 1 # from 0 => to 0
1 0 # from 1 => to 1
}

}

pcm.swapped {
type plug
slave {
pcm "dmixer"
}
ttable.0.1 1
ttable.1.0 1
}


This works so far, but I'd like to do it right, not working around. Has
somebody an idea, how to achieve it correctly or what might be the
reason for Kodi to ignore ttable?

Thank You very much!

--
Gauner