12-16-2023, 04:02 AM
@raspiter
Ok, I think I have a solution, thanks to some hints I found on the InterWeb. I've tested it briefly with the ALSA Loopback enabled and using the peppyalsa-client (described in @fdealexa github documentation) which displays a text-based bar graph in real time in the terminal window. This combo works with the Art Blakey M4A tracks I downloaded from Apple iTunes, the other M4A test tracks I had on hand, on the moOde Internet radio stations, and some music tracks with other encodings.
You might give it a try with your full PeppyMeter installlation.
My solution consists of an modification of /etc/alsa/conf.d/_sndaloop.conf to insert a new plugin in the loopback branch which explicitly forces the format in that branch to be S16_SE. I arbitrary named the new plugin peppyprep.
Here's my entire new file
The hint found on the InterWeb was that plugin type meter doesn't advise ALSA of its input format requirements so this alteration lets us tell it explicitly.
Let us know how it goes.
Regards,
Kent
PS - It should be possible to use a simplified syntax in the definition of peppyprep but that didn't work for me. I had to use the syntax you see here.
Ok, I think I have a solution, thanks to some hints I found on the InterWeb. I've tested it briefly with the ALSA Loopback enabled and using the peppyalsa-client (described in @fdealexa github documentation) which displays a text-based bar graph in real time in the terminal window. This combo works with the Art Blakey M4A tracks I downloaded from Apple iTunes, the other M4A test tracks I had on hand, on the moOde Internet radio stations, and some music tracks with other encodings.
You might give it a try with your full PeppyMeter installlation.
My solution consists of an modification of /etc/alsa/conf.d/_sndaloop.conf to insert a new plugin in the loopback branch which explicitly forces the format in that branch to be S16_SE. I arbitrary named the new plugin peppyprep.
Here's my entire new file
Code:
pi@moode837:/etc/alsa/conf.d $ more _sndaloop.conf
#
# This file provides a default Loopback device by overriding the _audioout device defined in /etc/alsa/conf.d/
#
# The trailing underscores are removed/added by job "alsa_loopback" to effectively turn the override On/Off.
# This job is submitted by snd-config.php and corresponds to the setting "ALSA loopback ON/OFF".
#
# modified by TheOldPresbyope to define and interconnect plugin "peppyprep"
#
pcm.!_audioout {
type plug
slave.pcm {
type multi
slaves {
a { channels 2 pcm "plughw:2,0" }
b { channels 2 pcm "peppyprep" }
}
bindings {
0 { slave a channel 0 }
1 { slave a channel 1 }
2 { slave b channel 0 }
3 { slave b channel 1 }
}
}
ttable [
[ 1 0 1 0 ] # left -> a.left, b.left
[ 0 1 0 1 ] # right -> a.right, b.right
]
}
pcm.peppyprep {
type plug
slave
{
pcm "pippopeppy"
format S16_LE
}
}
pcm.pippopeppy {
type meter
slave.pcm "hw:Loopback,0"
scopes.0 peppyalsa
}
pcm_scope.peppyalsa {
type peppyalsa
decay_ms 400
meter "/var/tmp/peppyfifo"
meter_max 100
meter_show 0
}
pcm_scope_type.peppyalsa {
lib /usr/local/lib/libpeppyalsa.so
}
The hint found on the InterWeb was that plugin type meter doesn't advise ALSA of its input format requirements so this alteration lets us tell it explicitly.
Let us know how it goes.
Regards,
Kent
PS - It should be possible to use a simplified syntax in the definition of peppyprep but that didn't work for me. I had to use the syntax you see here.