Hi,
Just to give you an update:
finally we have ALSA input running in our production system (Ubuntu 10.04 LTS)
without getting any overflow errors anymore.
The overflow error occured after input of 8GB data by using ALSA interface.
Example: for 16bit stereo at 44.1 kHz alsa input failed after 13.52 hours (13
hours, 32 min)
16*2*44100 / 8bit => 176400 bytes/sec = 605 MB/hour
13.52 * 605 MB = 8192 MB
Other bit rates and/or sample rates will result in other failing times
I just want to summarize how to get it running with liquidsoap 1.0.0beta1
source package from sourceforge download section:
1.) apply ALSA overflow patch before installation
Index: alsa_stubs.c
===================================================================
--- alsa_stubs.c (révision 7697)
+++ alsa_stubs.c (copie de travail)
@@ -114,7 +114,11 @@
return ans;
}
-static void check_for_err(int ret)
+/* Here, we use the type snd_pcm_sframes_t
+ * which is long usually and makes sure we
+ * avoid long to int overflow in the read/write
+ * function's return value. */
+static void check_for_err(snd_pcm_sframes_t ret)
{
if (ret>= 0)
return;
@@ -296,7 +300,7 @@
int ofs = Int_val(ofs_);
snd_pcm_t *handle = Pcm_handle_val(handle_);
char *buf;
- int ret;
+ snd_pcm_sframes_t ret;
if (ofs + len * Frame_size_val(handle_)> caml_string_length(dbuf))
caml_invalid_argument("buffer");
@@ -320,7 +324,7 @@
int ofs = Int_val(ofs_);
snd_pcm_t *handle = Pcm_handle_val(handle_);
char *buf;
- int ret;
+ snd_pcm_sframes_t ret;
if (ofs + len * Frame_size_val(handle_)> caml_string_length(sbuf))
caml_invalid_argument("buffer");
@@ -346,7 +350,7 @@
snd_pcm_t *handle = Pcm_handle_val(handle_);
char **buf;
int c;
- int ret;
+ snd_pcm_sframes_t ret;
/* TODO: check the size of dbuf */
buf = malloc(chans * sizeof(char*));
@@ -377,7 +381,7 @@
snd_pcm_t *handle = Pcm_handle_val(handle_);
char **buf;
int c;
- int ret;
+ snd_pcm_sframes_t ret;
/* TODO: check the size of sbuf */
buf = malloc(chans * sizeof(char*));
@@ -408,7 +412,7 @@
snd_pcm_t *handle = Pcm_handle_val(handle_);
float **buf;
int c, i;
- int ret;
+ snd_pcm_sframes_t ret;
/* TODO: check the size of dbuf */
buf = malloc(chans * sizeof(float*));
@@ -440,7 +444,7 @@
snd_pcm_t *handle = Pcm_handle_val(handle_);
float **buf;
int c, i;
- int ret;
+ snd_pcm_sframes_t ret;
/* TODO: check the size of fbuf */
buf = malloc(chans * sizeof(float*));
@@ -472,7 +476,7 @@
snd_pcm_t *handle = Pcm_handle_val(handle_);
double **buf;
int c, i;
- int ret;
+ snd_pcm_sframes_t ret;
/* TODO: check the size of fbuf */
buf = malloc(chans * sizeof(double*));
@@ -504,7 +508,7 @@
snd_pcm_t *handle = Pcm_handle_val(handle_);
double **buf;
int c, i;
- int ret;
+ snd_pcm_sframes_t ret;
/* TODO: check the size of fbuf */
buf = malloc(chans * sizeof(double*));
2.) define a virtual sound device at /etc/asound.conf
pcm.liq-test {
type plug
slave { pcm "hw:0,0" }
}
3.) make liquidsoap use the virtual device
radio= input.alsa(device="pcm.liq-test")
BR, Peter
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users