2017-07-23, 11:43
Are you sure the PLLs of this anthem cinema device are fully correct?
pcm.anthemresamplecinema
{
type file
slave {
pcm null
}
format "raw"
file "| /etc/brutecfg/convolving.sh %c %b %r %f resample AnthemTC linearphase cinema"
hint {
show on
description "AnthemTC Resampling Cinema"
}
}
13:30:43.581 T:140104039790336 DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-28446.500682, adjusted:-41708.333333
13:30:45.607 T:140104039790336 DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:30185.650143, adjusted:41708.333333
13:31:59.207 T:140104039790336 DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-28538.641195, adjusted:-41708.333333
13:32:00.231 T:140104039790336 DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:20055.278024, adjusted:41708.333333
13:32:32.935 T:140104039790336 DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-29331.784765, adjusted:-41708.333333
13:32:34.962 T:140104039790336 DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:42085.263828, adjusted:41708.333333
#!/bin/sh
# convolving script
CHANNELS="$1" # Number of channels of input stream.
BITS="$2" # Bitrate of input stream f.e. 16,24,32
RATE="$3" # Sampling rate of input stream f.e. 44100,48000
TYPE="$4" # Type for exaple FLOAT_LE, S24_LE etc.
MODE="$5" # resample/noresample --> Resample to 192khz with Sox?
TARGETCURVE="$6" # %CurveName% --> Define TargetCurve filters.
FILTERTYPE="$7" # filter_tpye linearphase or minimum phase
LAYOUT="$8" # Layout for example cinema/music
if [ "$MODE" = "resample" ]
then
# SOX Variables
SOX_OUTPUT_BITS="32"
# Decoding format. possible values:
# signed-integer, unsigned-integer, floating-point
SOX_OUTPUT_FORMAT="floating-point"
SOX_PARAMS="-v -I -b 99.7 -a"
SOX_OUTPUTRATE="48000"
BRUTERATE="$SOX_OUTPUTRATE"
else
BRUTERATE="$RATE"
fi
# Brutefir Variables
BRUTEFIR_CONFIGFILE="/home/steffen/bruteconfig_"$TARGETCURVE"_"$BRUTERATE"_"$CHANNELS"_"$FILTERTYPE"_"$LAYOUT
BRUTEFIR_LOGFILE="/home/steffen/brutefir.log"
# sox resample command.
SOX_CMD="sox -q -t raw -c $CHANNELS -b $BITS -r $RATE -e floating-point - -t raw -b $SOX_OUTPUT_BITS -c $CHANNELS -e $SOX_OUTPUT_FORMAT - rate $SOX_PARAMS $SOX_OUTPUTRATE"
# brutefir command / -daemon?
BRUTEFIR_CMD="brutefir -nodefault $BRUTEFIR_CONFIGFILE"
# Execute sox/brutefir
if [ "$MODE" = "resample" ] && [ "$RATE" -ne "$SOX_OUTPUTRATE" ]
then
$SOX_CMD|$BRUTEFIR_CMD > $BRUTEFIR_LOGFILE 2>&1
else
$BRUTEFIR_CMD > $BRUTEFIR_LOGFILE 2>&1
fi;
(2017-07-29, 08:38)steo86 Wrote: ok. that means you know it but you are not interessted to do it?
I would do it but I don´t have the skills to do that.
From 20ba506289a42571658461e175e7f8f59c2927f6 Mon Sep 17 00:00:00 2001
From: fritsch <[email protected]>
Date: Sat, 29 Jul 2017 09:50:47 +0200
Subject: [PATCH] Resampler: Use soxr
---
xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp
index af5bf93..e23b895 100644
--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp
+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp
@@ -74,6 +74,10 @@ bool CActiveAEResampleFFMPEG::Init(uint64_t dst_chan_layout, int dst_channels, i
return false;
}
+ // use soxr engine
+ if (av_opt_set_int(m_pContext, "resampler", SWR_ENGINE_SOXR, 0) >= 0)
+ CLog::Log(LOGDEBUG, "Setting SOXR resampler");
+
if(quality == AE_QUALITY_HIGH)
{
av_opt_set_double(m_pContext, "cutoff", 1.0, 0);
--
2.7.4