On Sun, Feb 4, 2024 at 02:42 AM, Paul wrote:
If you are able to identify the HDMI interface and set its priority as I did for the USB ports then at least you can prevent clashes with the loopback interfaces.
I agree.
The one bit I probably haven¡¯t quite answered is the naming of the loopback interfaces, though I think looking at the alsa modules config might be the starting point.?
This bit of config would be the same regardless of the codebase as it is core sound config from a naming perspective, though that would have an impact on the code as references to the loopbacks would then have to be updated to reflect the new device names.
I am now at the point where I need to understand the code architecture at a higher level to see how the code modules (assuming its modular) interact with each other.?
While Ashar pointed me at the mixer section of the sbitx.sound.c code, it is called by something else that passes the device names, hence me needing to understand the code at an architectural/flow level before digging in. Maybe in doing so we can get to device naming at the same time.?
I am confident that I am showing the exact lines of code that set the device names in this post.
Look for the highlighted "plughw" strings in three places in that post.
These are the three device names being used by sbitx to access the codec and the two loopback devices.
They are being set by the functions that start the sound handling threads.
This is also why I say they are running even when no one is listening, the code for the devices are being started unconditionally.
And I am giving the names that I think should work and will not depend on boot order:
Go into sbitx.c and change?"plughw:0,0" to?"plughw:CARD=audioinjectorpi,DEV=0".
Go into sbitx_sound.c and change?"plughw:1,0" to?"plughw:CARD=Loopback,DEV=0".
Go into sbitx_sound.c and change?"plughw:2,1" to?"plughw:CARD=Loopback_1,DEV=1".
From what I can tell in the code Ashar refers to the aplay -l (or -L) command to get device names, what I don¡¯t see is how this is done and its not in the sbitx.sound.c code.
ALSA config will be the source of naming of devices but on reflection maybe the loopbacks could be individually named in the /etc/rc.local file instead of using the combined name of snd-aloop for all devices, try creating a line for each loopback e.g.
?
modprobe sbitx-digi-out enable=1 index=1
modprobe sbitx-digi-in enable=1 index=2
?
Instead of
?
modprobe snd-aloop enable=1,1,1,1 index=1,2,3,4
?
I suspect this is where /proc/asound/modules gets the loopback names from, do cat /proc/asound/modules to see what I mean.
I think that's not going to work.?
'modprobe' loads LKMs (loadable kernel modules) into the kernel.
So 'snd-aloop' is the name of a module ( snd-aloop.ko ) that provides support for the loopback devices.
I think changing the names this way will not work.
?
--
Regards,
Dave, N1AI