• Takashi Sakamoto's avatar
    ALSA: firewire-lib: replay sequence of incoming packets for outgoing packets · 39c2649c
    Takashi Sakamoto authored
    ALSA IEC 61883-1/6 packet streaming engine uses pre-computed parameters
    ideal for nominal sampling transfer frequency (STF) to transfer packets
    to device since it was added 2011. As a result of user experience for a
    decade, it is clear that the sequence is not suitable to some actual
    devices. It takes the devices to generate noise, and causes any type of
    discontinuity in the series of packet transferred from the device. It's
    required for the engine to transfer packets according to effective STF.
    
    The effective STF is given by media clock recovered by the sequence of
    packet transferred from the target device. In the previous commit, the
    sequence is already cached. The media clock recovery can be achieved by
    analyzing the sequence.
    
    In technological world, many ideas are proposed for media clock recovery.
    However, the small part of them could be actually adopted in our case
    since floating point arithmetic is not mostly available in Linux kernel
    land.
    
    This commit adopts the simple way from them; sequence replay, which means
    that the sequence of parameters from incoming packet is used as is to
    transfer outgoing packets. The media clock is not computed internally,
    but the sequence of outgoing packet superficially looks to be generated by
    the media clock.
    
    The association between source and destination is decided when starting
    AMDTP domain. When the target device supports a pair of isochronous packet
    streams, the tx stream is source and the rx stream is destination. When it
    supports two pair of streams, each of tx stream is associated to
    corresponding rx stream in its order. When it supports less number of tx
    streams than rx streams, the fist tx stream is selected for all of rx
    streams. When it supports more tx streams than rx streams, the first tx
    packet is associated to the rx stream.
    
    As I noted in previous commit, the sequence of parameters from incoming
    packet is different between devices, time to time. It is worse idea to
    replay the sequence of parameters from a device for the sequence of
    packet to the other devices even if they are in the same category of
    device.
    Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
    Link: https://lore.kernel.org/r/20210527122611.173711-3-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    39c2649c
amdtp-stream.h 9.95 KB