alsa-project / alsa-plugins

The Advanced Linux Sound Architecture (ALSA) - plugins
GNU Lesser General Public License v2.1
40 stars 28 forks source link

aaf plugin not working raspberry pi cm4 #39

Open steeley opened 2 years ago

steeley commented 2 years ago

trying to send to the ALSA device aaf0. pI cm4 with kernel setup to support avb/tsn correctly. (Linux cm432 5.10.76-v7l-AVB_KERNEL+ #3 SMP Sat Nov 6 22:50:41 GMT 2021 armv7l GNU/Linux).

PCIe i210 network card is the interface set up correctly according to: https://tsn.readthedocs.io/avb.html

Error is: `sudo speaker-test -p 2500 -F S16_BE -c 2 -r 48000 -D aaf0

speaker-test 1.1.9

Playback device is aaf0 Stream parameters are 48000Hz, S16_BE, 2 channels Using 16 octaves of pink noise Rate set to 48000Hz (requested 48000Hz) Buffer size range from 1 to 206158430 Period size range from 0 to 206158431 Requested period time 2500 us Periods = 4 was set period_size = 120 was set buffer_size = 480 0 - Front Left ALSA lib pcm_aaf.c:670:(aaf_tx_pdu) Failed to send AAF PDU Write error: -5,Input/output error xrun_recovery failed: -5,Input/output error Transfer failed: Input/output error `

perexg commented 2 years ago

It's an error from the sendmsg syscall. See https://github.com/alsa-project/alsa-plugins/blob/master/aaf/pcm_aaf.c#L668 .

steeley commented 2 years ago

yes thanks. I'm trying to find why aaf->pdu_size is wrong size but no clue why.

petipok commented 2 years ago

Hello, I have the same error when starting the talker, using the following command: speaker-test -F S16_BE -c 2 -r 48000 -D aaf0 -p 12500

The strange thing is that by monitoring the traffic on the interface with Wireshark, I can see a few (~100) AVB packages, so something is transmitted before throwing the error.

My frames_per_pdu is set to 6 that gives 125 microseconds at 48kHz sampling rate, so the 12500 microseconds period time should be fine, I don't get why this plugins throws this error.

Any idea?

karno-ian commented 2 years ago

don't know. - never got this to work. Assume it doesn't work and is just broken

aditpape commented 2 years ago

ALSA lib pcm_aaf.c:670:(aaf_tx_pdu) Failed to send AAF PDU

The return value/errno of sendmsg() syscall itself is of interest here. It may return an error (likely non-recoverable) or signal a 'partial write' (if possible in that setup..) which can be handled with a loop around sendmsg() until all data is accepted by socket.