bondagit / ravenna-alsa-lkm

RAVENNA ALSA LKM
20 stars 9 forks source link

Distortions in long-term operation #26

Open Matzeee opened 1 month ago

Matzeee commented 1 month ago

After listening for hours (several days in row), I hoped the distortions were gone, but they are still occurring sometimes.\ I can provide audio data, but would prefer to not publish it, since it contains non-free music.

Another attempt worth trying might be a machine with onboard hardware PTP, as recommended by pipewire: https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/AES67#recommended-setup \ https://www.hp.com/hpinfo/newsroom/press_kits/2013/HPDiscoverBarcelona/ProDesk_600_G1_Desktop_Mini_Datasheet.pdf \ https://ark.intel.com/content/www/us/en/ark/products/60019/intel-ethernet-connection-i217-lm.html

Any hint to improve is highly appreciated. However, for further testing and before using in production, a solution to automatically detect distortions during long-term operation would be crucial.\ It should be possibe to configure our exbox in order to simply route channels received from AES67 to its AES67 outputs.\ Or to provide a sinus from MADI.

Setup

exbox.md (MADI-Dante converter)

Dell Wyse 5070, Celeron J4105, 8GB

Channels streamed (exbox -> Wyse 5070)

Another identical Wyse 5070

Config

Might also be helpful for others…

cat /etc/systemd/system/performance-governor.service
[Unit]
Description=Set CPU governor to performance. Manually created.
After=network.target

[Service]
# use oneshot instead?
Type=simple
ExecStart=/bin/bash -c "echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"

[Install]
WantedBy=multi-user.target
cat /etc/sysctl.d/custom-aes67.conf
kernel.perf_cpu_time_max_percent = 0
kernel.sched_rt_runtime_us = 1000000
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
performance
performance
performance
performance

cat /proc/sys/kernel/perf_cpu_time_max_percent
0

cat /proc/sys/kernel/sched_rt_runtime_us
1000000

ethtool -T en…
Time stamping parameters for en…:
Capabilities:
        software-transmit
        software-receive
        software-system-clock
PTP Hardware Clock: none
Hardware Transmit Timestamp Modes: none
Hardware Receive Filter Modes: none
cat /etc/daemon.conf
{
  "http_port": 8080,
  "rtsp_port": 8854,
  "http_base_dir": "/usr/local/share/aes67-daemon/webui/",
  "log_severity": 3,
  "playout_delay": 0,
  "tic_frame_size_at_1fs": 48,
  "max_tic_frame_size": 1024,
  "sample_rate": 48000,
  "rtp_mcast_base": "239.69.0.1",
  "rtp_port": 5004,
  "ptp_domain": 0,
  "ptp_dscp": 48,
  "sap_mcast_addr": "239.255.255.255",
  "sap_interval": 30,
  "syslog_proto": "",
  "syslog_server": "255.255.255.254:1234",
  "status_file": "/etc/status.json",
  "interface_name": "xxx",
  "mdns_enabled": true,
  "custom_node_id": "Sumner AES67",
  "node_id": "Sumner AES67",
  "ptp_status_script": "/usr/local/share/aes67-daemon/scripts/ptp_status.sh",
  "mac_addr": "xxx",
  "ip_addr": "10.0.62.101",
  "streamer_channels": 8,
  "streamer_files_num": 8,
  "streamer_file_duration": 1,
  "streamer_player_buffer_files_num": 1,
  "streamer_enabled": false,
  "auto_sinks_update": true
}
Edit Sink 0
ID  0
Name    ALSA Sink 0
Use SDP (ticked)
Source URL  http://10.0.62.101:8080/api/source/sdp/0
Remote Source SDP   SAP from 10.0.62.32 - EXBOX-MD : 32

SDP 
v=0
o=- 26901352560 26901352560 IN IP4 10.0.62.32
s=EXBOX-MD : 32
i=4 channels: Stream L Ch 49, Stream R Ch 50, Logging L Ch 51, Logging R Ch 52
c=IN IP4 239.69.198.123/32
t=0 0
a=keywds:Dante
a=recvonly
m=audio 5004 RTP/AVP 99
a=rtpmap:99 L24/48000/4
a=ptime:1
a=ts-refclk:ptp=IEEE1588-2008:00-1D-…:0
a=mediaclk:direct=0

Delay (samples) 960 - 20ms@48kHz
Ignore RefClk GMID  (ticked by default)
Channels    4
Audio Channels map  ALSA Input 1 -> ALSA Input 4

https://merging.atlassian.net/wiki/spaces/PUBLICDOC/pages/4819571/Merging+RAVENNA+Advanced+Pages+User+Guide. \ Untick Ignore RefClk GMID?

cat /etc/asound.conf

pcm_slave.aes67-sinks {
        pcm "hw:CARD=RAVENNA"
        rate 48000
        channels 4
        buffer_size 4096
        format S24_3LE
}

pcm.sink_12 {
        type dsnoop
        ipc_key 0x11111
        slave aes67-sinks
        bindings {
                0 0
                1 1
        }
}

pcm.sink_34 {
        type dsnoop
        ipc_key 0x11111
        slave aes67-sinks
        bindings {
                0 2
                1 3
        }
}
cat /etc/liquidsoap/main.liq

settings.frame.audio.samplerate := 48000

# defined in /etc/asound.conf
stream_aes67 = input.alsa(device="plug:sink_12", fallible=true)

# dante avio from arecord -l:
#       card 2: Module [Dante USB I/O Module], device 0: USB Audio [USB Audio]
stream = input.alsa(device="plughw:Module,0", fallible=true)

fm     = input.alsa(device="plug:sink_34", fallible=true)

stream = mksafe(stream)
stream_aes67 = mksafe(stream_aes67)

aac_mid = %fdkaac(channels=2, samplerate=48000, vbr=4, afterburner=true, aot="mpeg4_aac_lc", sbr_mode=false)

opus_logging = %opus(samplerate=48000, channels=2,
                vbr="unconstrained", bitrate=48, dtx=false,
                complexity = 10)

mp3_high = %mp3.vbr(stereo_mode='joint_stereo', samplerate=48000, internal_quality=1, id3v2=true, quality=2)

output.file(
        opus_logging,
        {time.string("/var/fm-loggings/%Y/%Y-%m/%Y-%m-%d/%Y-%m-%d_%H-%M-%S-fm_logging.opus")},
        fm,
        reopen_when={0m}, fallible=true)

mp3_ice = output.icecast(
  […]
  mp3_high,
  stream
)

aac_ice = output.icecast(
  […]
  aac_mid,
  stream_aes67
)