* What's the right way to do??? resample??
@ 2005-03-31 2:49 Joe Hsu
2005-03-31 14:36 ` Dirk Jagdmann
0 siblings, 1 reply; 4+ messages in thread
From: Joe Hsu @ 2005-03-31 2:49 UTC (permalink / raw)
To: alsa-devel
I am a beginner on Linux audio programming.
When recording from one audio codec and playing
back from another audio codec in real time, there
must be some asynchronous problems.(Buffer overrun
for recording or buffer underrun for playback).
I believe this problem must have some answers.
Hence should I resample audio in real time dynamically
so that asynchronous conditions would be eliminated?
If so, what resample library would be suitable??
Libsamplerate or Libresample???
Thanks if anyone can give me some hints.
(My recording device is 8000HZ and my playback device
also works at 8000HZ)
--
The sun is shinny but the ice is slippery.
-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/Info/Sentarus/hamr30
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: What's the right way to do??? resample??
2005-03-31 2:49 What's the right way to do??? resample?? Joe Hsu
@ 2005-03-31 14:36 ` Dirk Jagdmann
2005-04-01 1:34 ` Joe Hsu
0 siblings, 1 reply; 4+ messages in thread
From: Dirk Jagdmann @ 2005-03-31 14:36 UTC (permalink / raw)
To: Joe Hsu; +Cc: alsa-devel
> When recording from one audio codec and playing
> back from another audio codec in real time, there
> must be some asynchronous problems.(Buffer overrun
> for recording or buffer underrun for playback).
> I believe this problem must have some answers.
> Hence should I resample audio in real time dynamically
> so that asynchronous conditions would be eliminated?
> If so, what resample library would be suitable??
> Libsamplerate or Libresample???
There is now software solution to this problem, because software has no
way to figure out, when/how much two hardware pieces get out of sync.
You have to sync your hardware for input and output. That either means
you have to use a hardware which provides both input and output and full
duplex access or you have to use an external word clock cable to
synchronisation. Then on the software side you can be sure, that your
output will always consume the exact amount of data the input has just
generated.
--
---> doj / cubic
----> http://cubic.org/~doj
-----> http://llg.cubic.org
-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/Info/Sentarus/hamr30
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: What's the right way to do??? resample??
2005-03-31 14:36 ` Dirk Jagdmann
@ 2005-04-01 1:34 ` Joe Hsu
2005-04-01 9:04 ` Clemens Ladisch
0 siblings, 1 reply; 4+ messages in thread
From: Joe Hsu @ 2005-04-01 1:34 UTC (permalink / raw)
To: Dirk Jagdmann; +Cc: alsa-devel
On Thu, 31 Mar 2005 16:36:15 +0200, Dirk Jagdmann <doj@cubic.org> wrote:
> You have to sync your hardware for input and output. That either means
> you have to use a hardware which provides both input and output and full
> duplex access or you have to use an external word clock cable to
> synchronisation. Then on the software side you can be sure, that your
> output will always consume the exact amount of data the input has just
> generated.
Thanks.
Actually I record from bt878 and play it back on AC97. So
what do you mean by "external world clock" in this case?
Is /dev/rtc an sort of external world clock? Or you just
mean there is no solution without hardware modifications
in such a case??
--
The sun is shinny but the ice is slippery.
-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/Info/Sentarus/hamr30
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: What's the right way to do??? resample??
2005-04-01 1:34 ` Joe Hsu
@ 2005-04-01 9:04 ` Clemens Ladisch
0 siblings, 0 replies; 4+ messages in thread
From: Clemens Ladisch @ 2005-04-01 9:04 UTC (permalink / raw)
To: Joe Hsu; +Cc: Dirk Jagdmann, alsa-devel
Joe Hsu wrote:
> On Thu, 31 Mar 2005 16:36:15 +0200, Dirk Jagdmann <doj@cubic.org> wrote:
> > You have to sync your hardware for input and output. That either means
> > you have to use a hardware which provides both input and output and full
> > duplex access or you have to use an external word clock cable to
> > synchronisation. Then on the software side you can be sure, that your
> > output will always consume the exact amount of data the input has just
> > generated.
>
> Actually I record from bt878 and play it back on AC97. So
> what do you mean by "external world clock" in this case?
In this case, there is no word clock; the hardware would have to
support it.
> Or you just mean there is no solution without hardware
> modifications in such a case??
You could either connect the TV card's analog output to the line in of
the AC97 so that both recording and playback use the same clock, or
you could convert the sample rate in software. Most existing
libraries like e.g. libsamplerate assume that you know the exact
sample rate in advance, so you would have to write your own sample
rate converter that can adjust it ratio dynamically.
Regards,
Clemens
-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/Info/Sentarus/hamr30
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-04-01 9:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-31 2:49 What's the right way to do??? resample?? Joe Hsu
2005-03-31 14:36 ` Dirk Jagdmann
2005-04-01 1:34 ` Joe Hsu
2005-04-01 9:04 ` Clemens Ladisch
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.