Fw: realtime adjustable delay with alsa in full-duplex capture and playback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Forwarded Message -----
From: John Donson <millim1974@xxxxxxxxx>
To: "alsa-user@xxxxxxxxxxxxxxxxxxxxx" <alsa-user@xxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, November 15, 2011 8:25 PM
Subject: realtime adjustable delay with alsa in full-duplex capture and playback

Hi

I want to realize an application that features a constant but realtime adjustable delay between playback and capture with mmap alsa lib usage. The idea is to use up/down button with process messaging to fine tune sync between audio and video. I am using a commercial DVB-S reciever with AC3-OUT connected to the Linux PC SPDIF input of the soundcard and a subsequent TV for video display of the STB. Audio as about 500ms leading the corresponding image sequence. Which is good in general since I also plan to chain brutefir for DRC which gives we room for max 22000 samples FIR filter length/channel to be back in sync.

I know this can be accomplished by proper buffer length settings for a fixed delay. But it should be adjustable to use it for other purpose as well. Unfortunately I am not able to find a detailed diagram how alsa uses its  ring-buffer and how interrupts do affect delay as well. Can I use snd_pcm_wait, snd_pcm_delay, snd_pcm_forward, and snd_pcm_rewind for that purpose and how? Is there a code fragment available?

Or in general, exists a code for SPDIF input to analog AC3 output with realtime adjustable delay? I managed easily to get it to work down to 3ms with arecord | ffmpeg spdif copy and ac3dec. For the application I am thinking to modify clalsadrv, ac3dec and irmp3 for my stand alone AC3 receiver Linux project. Better ideas welcome? But don't say JACK!

Regards
John 


------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux