bondagit / aes67-linux-daemon

AES67 Linux Daemon with configuration WebUI
GNU General Public License v3.0
372 stars 82 forks source link

No sound with Hasseb Audio over Ethernet Pro #137

Open olm52 opened 1 year ago

olm52 commented 1 year ago

I have bought Hasseb Audio over Ethernet Pro for testing AES67/RAVENNA: https://www.hasseb.fi/shop2/index.php?route=product/product&product_id=65

I have configured AES67 and Hasseb device as explained here. However no sound at all.

Maybe I am missing something. I have connected the device with Ethernet cable (input) and cable to the optical Toslink port (output to DAC)

I see that /proc/asound/RAVENNA is receiving audio signal. The command used is the one recommended here: speaker-test -D plughw:RAVENNA -r 48000 -c 2 -t sine I note that the output is declaring 16 bit but the Hasseb supports only 24 bit

Moreover I see some strange errors in dmesg. For example: [ 1344.346165] mr_alsa_audio_pcm_prepare for playback stream [ 1344.346168] Leaving mr_alsa_audio_pcm_prepare.. [ 1344.346191] entering mr_alsa_audio_pcm_hw_free (substream name=subdevice #0 #0) ... [ 1344.346208] entering mr_alsa_audio_pcm_close (substream name=subdevice #0 #0) ... [ 1390.111325] entering mr_alsa_audio_pcm_open (substream name=subdevice #0 #0) ... [ 1390.111328] mr_alsa_audio_pcm_open: playback format nb bits range: [8, 32] [ 1390.111329] mr_alsa_audio_pcm_open: playback period size range: [48, 196608], periods range: [2, 128] [ 1390.111391] Current PTPFrame Size = 48, minPTPFrameSize = 48, maxPTPFrameSize = 384 [ 1390.111523] mr_alsa_audio_pcm_hw_params (enter): rate=48000 format=2 channels=2 period_size=48, nb_periods=128 , buffer_bytes=24576 ****[ 1390.111525] mr_alsa_audio_pcm_hw_params (playback): wrong nbPeriods (128 instead of 1024)...**** [ 1390.111530] mr_alsa_audio_pcm_hw_params done: rate=48000 format=2 channels=2 period_size=48, nb_periods=128 , buffer_bytes=24576

bondagit commented 1 year ago

I have just tried and it works for me. On the daemon side select TIC frame size @1FS (samples) to 48 - 1ms

olm52 commented 1 year ago

Yes I have already set this, but no sound.

olm52 commented 1 year ago

aes67_1 aes67_2 AES67_3 AES67_4

bondagit commented 1 year ago

hmm strange, everything seems ok. regarding:

speaker-test -D plughw:RAVENNA -r 48000 -c 2 -t sine I note that the output is declaring 16 bit but the Hasseb supports only 24 bit

This is no problem as encoding conversion is done by the RAVENNA driver.

olm52 commented 1 year ago

Content of /proc/asound/RAVENNA/pcm0p/sub0/hw_params

access: RW_INTERLEAVED format: S16_LE subformat: STD channels: 2 rate: 48000 (48000/1) period_size: 48 buffer_size: 6144

olm52 commented 1 year ago

Anyway I have tried to send a 24 bit / 48 kHz with the same result: aplay -D plughw:RAVENNA /home/audiolinux/Downloads/Temp/24_48k_PerfectTest.wav

olm52 commented 1 year ago

some more information: /proc/asound/RAVENNA/pcm0p/sub0/status state: RUNNING owner_pid : 49312 trigger_time: 2843.474197094 tstamp : 0.000000000 delay : 6144 avail : 0 avail_max : 0

hw_ptr : 5306688 appl_ptr : 5312832

/proc/asound/RAVENNA/pcm0p/sub0/sw_params tstamp_mode: NONE period_step: 1 avail_min: 48 start_threshold: 6144 stop_threshold: 6144 silence_threshold: 0 silence_size: 0 boundary: 6917529027641081856

olm52 commented 1 year ago

That avail:0 is not right I think...

bondagit commented 1 year ago

No, this is correct. You can try to sniff the session with Wireshark or use another device.

olm52 commented 1 year ago

I have tested the original RAVENNA daemon and it was working fine. Adapting the SDP file for the input stream to the one used by RAVENNA now I can use the AES67 daemon.

Original SDP file: v=0 o=- 2831156481 226032181 IN IP4 192.168.1.5 s=AES67 daemon a8c00501 ALSA Source 0 c=IN IP4 239.1.1.5/15 t=0 0 a=clock-domain:PTPv2 0 m=audio 5004 RTP/AVP 98 c=IN IP4 239.1.1.5/15 a=rtpmap:98 L24/48000/2 a=sync-time:0 a=framecount:48 a=ptime:1 a=mediaclk:direct=0 a=ts-refclk:ptp=IEEE1588-2008:00-10-4B-FF-FE-08-6E-41:0

Working SDP file v=0 o=- 2 0 IN IP4 192.168.1.5 s=AES67 daemon a8c00501 ALSA Source 0 c=IN IP4 239.1.1.5/15 t=0 0 a=clock-domain:PTPv2 68 a=mediaclk:direct=0 m=audio 5004 RTP/AVP 98 c=IN IP4 239.1.1.5/15 a=rtpmap:98 L24/48000/2 a=source-filter: incl IN IP4 239.1.1.5 192.168.1.5 a=clock-domain:PTPv2 68 a=sync-time:0 a=framecount:48-192 a=palign:0 a=ptime:1 a=mediaclk:direct=0 a=recvonly

the only problem is that stopping play there is a repeated sound of the last note for a few seconds

bondagit commented 1 year ago

Hey thanks for finding this. Could you identify what exactly in the SDP file is causing the issue ?

the only problem is that stopping play there is a repeated sound of the last note for a few seconds

Yes, I also have this on the Hasseb device I have here but the problem is not related to the daemon.

olm52 commented 1 year ago

I will investigate. Tomorrow I will go on holiday for a week. I will re-testing at the end of July.

I have also an archlinux package already made that I could upload to AUR.

Another problem is that play stops after few minutes. In dmesg I have PTP Master announce timeout, resetting

systemd service is giving this: _sessionmanager:: failed to retrieve PTP clock info

bondagit commented 1 year ago

PTP Master announce timeout, resetting

Ok, this is an easy fix in case: I have recently modified the driver to reset the PTP slave state in case we don't receive any new announcement from the master in 5 secs, see code at ravenna-alsa-lkm/driver/PTP.c:1093. Commit: https://github.com/bondagit/ravenna-alsa-lkm/commit/cdd64d2358b684e7d9d3eacc12f547b3f58abd5e

olm52 commented 1 year ago

I have just tested with last ravenna driver and last daemon. The version is r346.767d38d I checked in the source code that the above commit is present.

After around 8 min. sound stops and in dmesg: PTP Master announce timeout, resetting ...

bondagit commented 1 year ago

can you change the announcement interval of your PTP master clock ? It looks like after a certain period your master clock stops sending announcements.

olm52 commented 1 year ago

Here I have installed this package: https://aur.archlinux.org/packages/linuxptp This is version 3.1.1

I see that in Ubuntu last version is now 4.0 In Ubuntu package there are also 3 systemd services missing in the arch package: phc2sys@ ptp4l@ timemaster I guess that I should enable ptp4l@ with my network interface but the content is usr/sbin/ptp4l -f /etc/linuxptp/ptp4l.conf -i %I and I don't have here ptp4l.conf

Today I will make a new arch package based on Ubuntu. I guess that you are speaking of ptp4l.conf?

bondagit commented 1 year ago

I am also using linuxptp and I am not experiencing any issue. The default parameters should be OK and I have PTP master announcements every 2 seconds (use a network sniffer to check for PTP master traffic, e.g. Wireshark) . I usually start the master clock with the following parameters: sudo ptp4l -i <interface> -m -l7 -E -S Be aware that with linuxptp you cannot run the PTP master clock on the same host where you have the daemon (the PTP slave). The reason is that linuxptp disable the multicast loop routing and you have to patch it if you want to do so.

bondagit commented 1 year ago

any update on this ?

olm52 commented 1 year ago

No for the moment.