PeppyMeter

Getting into issues with the service file - it is not created automatically, and when I manually create and edit it triggered errors.

To manually create the file I copied this sample:
https://github.com/seniorgod/ifi-ti...v-file#adjust-the-systemd-service-description

Devices file shows:
device#0=bcm2835 Headphones: - (hw:2,0)
device#1=E50: USB Audio (hw:3,0)
Number of devices = 2

So I edited the service file to this:
[Unit]
Description=Tidal Connect Service*

[Service]
Restart=on-failure
ExecStart=/usr/ifi/ifi-tidal-release/bin/tidal_connect_application \
--tc-certificate-path "/usr/ifi/ifi-tidal-release/id_certificate/IfiAudio_ZenStream.dat" \
--netif-for-deviceid eth0 \
-f "DietPi stream to project“ \
--codec-mpegh true \
--codec-mqa false \
--model-name "DietPi Streamer" \
--disable-app-security false \
--disable-web-security false \
--enable-mqa-passthrough false \
--playback-device "E50: USB Audio (hw:3,0)" \
--log-level 3
User=root
Group=root
RestartSec=1
KillMode=control-group*

[Install]
WantedBy=multi-user.target*


Yet when I try to run the application I get these errors:

services error.jpg


What am I doing wrong???
 
Hi,

I have been using peppy, integrated into Kodi (with my own custom skin and signicant c++ code changes) for some time and my Kodi volume has been at 100% (given I use my DAC for volume control).

I am toying/testing the idea of using CamillaDSP for my PEQ and also using Kodi for volume control (and maybe moving to a "powerdac".. PC -> DDC -> POWERDAC)

What I discovered (at least with kodi) is that if I say have my Kodi volume at 60% then Peppy reads this as a reduced volume across the Peppy pipe and basically doesnt move.

I had assumed Peppy would be reading the RAW PCM stream to gather the VU meter values not the volume attenuated value (as noted, this might be a Kodi specific issue)

I have overcome this by hacking kodi and peppy (specifically datasource.py... never written in python so luckily the change was small!!!) so that kodi registers (via an OS file) a refactor value and datasource.py reads this refactor value thus keeping Peppy at the correct level (tested with a 1khz tone at -1dbfs for all Kodi volume levels).

The datasource.py change was simple enough (change in bold.. indents got lost in the paste)

if os.path.isfile("/home/ricko/PeppyMeter/max_in_pipe"):
with open('/home/ricko/PeppyMeter/max_in_pipe', 'r') as file:
sdat = file.read().rstrip()
self.max_in_pipe = float(sdat)
new_left = int(self.max_in_ui * ((data[length - 4] + (data[length - 3] << 8)) / self.max_in_pipe))
new_right = int(self.max_in_ui * ((data[length - 2] + (data[length - 1] << 8)) / self.max_in_pipe))
os.remove("/home/ricko/PeppyMeter/max_in_pipe")
else:

new_left = int(self.max_in_ui * ((data[length - 4] + (data[length - 3] << 8)) / self.max_in_pipe))
new_right = int(self.max_in_ui * ((data[length - 2] + (data[length - 1] << 8)) / self.max_in_pipe))

Part of the refactor table is as below (so if kodi volume is 93 then the refactor value [self.max_in_pipe above] will be 61.50)

99:98.20
98:88.50
97:82.30
96:77.00
95:73.00
94:67.00
93:61.50
92:58.00

So that all works great and didnt take me too long but my question is: Is it normal for Peppy to use the attenuated volume or is there some ALSA config in my .asoundrc (shown below) that I have screwed up

pcm.!default {
type plug
slave.pcm "peppyalsa"
}

ctl.!default {
type hw
card 1
}

pcm.peppyalsa {
type meter
slave.pcm "hw:1,1"
scopes.0 peppyalsa
}

pcm_scope.peppyalsa {
type peppyalsa
decay_ms 400
meter "/tmp/myfifo"
meter_max 100
meter_show 0
}

pcm_scope_type.peppyalsa {
lib /usr/local/lib/libpeppyalsa.so
}



Thanks


Bluck
 
I had assumed Peppy would be reading the RAW PCM stream to gather the VU meter values not the volume attenuated value
Is it normal for Peppy to use the attenuated volume
If kodi attenuates, it reduces the sample values before sending them over to the alsa chain. The peppyalsa device just observes the values being passed through the chain to the soundcard and displays the levels. There is no non-attenuated raw PCM stream available for Peppy.

I could not find any config for kodi to use hw volume, like e.g. mpd offers. Then the player would not attenuate the samples, but operate an alsa volume control element provided by the soundcard driver. That way the volume control operation would bypass the alsa chain and Peppy would be receiving samples at full volume. But IMO not possible with kodi (but I may be wrong).
 
"I could not find any config for kodi to use hw volume, like e.g. mpd offers. "

Thanks for the comments that addressed the issue in a clear and concise manner... and I did wonder how other players (like mpd) handled this and didnt have this issue.

Anyways my little hack works fine/seamlessly but your hint regarding hw volume will provide a path for futher investigation when time permits. I was actually deep in the kodi code that relates to ALSA device selection/initialization the other day so will start there.

Thanks again

Bluck