Hi every one.
This is my first mail to the list.
Hope I can help you as well.
I am using the fftw3 library to implement a transform in a array of 5120
elements .
I have this array from a program that I created modifying the arecord
program.
If someone could gimme a little help solving that problem.
I have that array been filled with value in this function:
static void compute_max_peak(u_char *data, size_t count)
{
signed int val, max, max_peak = 0, perc;
size_t ocount = count;
int arrayt[5120][1], l, cc;
int t = 0;
int tcount = 0;
//zero o array
for (cc = 0; cc <= 1; cc++) {
for (l = 0; l <= 5119; l++) {
arrayt[l][cc] = 0;
}
}
signed short *valp = (signed short *)data; //Dados no buffer
signed short mask = snd_pcm_format_silence_16(hwparams.format);
//Frames de silencio
count /= 2; // 5120
printf("Count = %i\n", count);
while (count-- > 0) {
val = *valp++ ^ mask;
val = abs(val);
// armazeno dados nos indices [x][0]
* for (cc = 0; cc <= 0; cc++) {
for (l = tcount; l <= tcount; l++) {
printf("TCOUNT = %i <=> cc = %i\n", tcount, cc);
arrayt[l][cc] = val;
}
}*
tcount++;
if (max_peak < val) //Armazena a maior amostra em max_peak
max_peak = val;
printf("val[%i] = %i\n", t, val);
t++;
}
fftw_calculation(arrayt);
for (cc = 1; cc <= 1; cc++) {
for (l = 0; l <= 5119; l++) {
arrayt[l][cc] = 0;
}
}*/
max = 1 << (bits_per_sample-1); //2#15 = 32768
printf("Max peak (%li samples): %05i (0x%04x) \n", (long)ocount,
max_peak, max_peak);
perc = max_peak * 100 / max;
for (val = 0; val < 20; val++)
if (val <= perc / 5)
putc('#', stdout);
else
putc(' ', stdout);
printf(" %i%%\n", perc);
for (cc = 0; cc <= 1; cc++) {
for (l = 0; l <= 5119; l++) {
printf("arrayt[%i][%i] = %i\n", l, cc, arrayt[l][cc]);
}
}
}
and the transform is calculated by this fucntion:
fftw_calculation(int data[5120][1]) {
fftw_complex *out, *in;
fftw_plan p;
int N, l, cc;
N = 1024;
in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * N);
out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * N);
in = (fftw_complex *)data;
for (cc = 0; cc <= 1; cc++) {
for (l = 0; l <= 1023; l++) {
out[l][cc] = 0;
}
}
p = fftw_plan_dft_1d(N, in, out, -1, FFTW_ESTIMATE);
fftw_execute(p);
for (cc = 0; cc <= 1; cc++) {
for (l = 0; l <= 1023; l++) {
printf("out[%i][%i] = %i\n", l, cc, out[l][cc]);
}
}
//fftw_destroy_plan(p);
}
The problem is, I can't user N as any number higher than 1024, or I get
segfault.
But if you see, the array been transformed is a array of [5120][1] elements.
Is there anybody here familiar with the fftw3 implementation.
Tks in advanced.
Having a SIP connection can be a god-send when you have lots of strings
to figure out verbally ..
Jeff Pulver used to have a free sip service at pulver.com, but a year
ago (or some such) he warned that the service would be discontinued.
Something to do with Facebook premium service IIRC ...
Problem: Although Ekiga.net works just fine for me, I cannot set up my
significant other on that network. It appears like it only works if you
have an Ekiga client?
There is no Ekiga client for ancient Mac's ...
Question: Any suggestions for an alternative SIP service?
Hi,
I'm working toward getting the UA-101 to work on Linux. I've had a look
at the Alsa drivers, and I after 23s of playback I hit the known glitch
bug:
http://lists.linuxaudio.org/pipermail/linux-audio-user/2009-April/059447.ht…
I've tried fiddling with various alsa buffering settings to get a point
solution that works, but with no luck.
Comparing the USB traffic on Windows and Linux was interesting. The
Linux trace has the sound samples being sent to USB Endpoint 2, but the
Windows trace is weird.
The both traces the sound sample was a long period of silence followed
by a sine wave. There are several things 'odd' under windows:
The data send to the sound card (on USB EP 2) started out as as string
of '0x00 0x00...' as you would expect for a 'silence' sample. After
about 2 seconds, 'silence' is send as lots blocks like
00000000: 00 00 ff ff 00 ff fe ff 00 ff ff ff 00 ff ff ff
00000010: 00 00 00 00 00 ff ff ff 00 00 00 00 00 ff ff ff
in a pattern I haven't got to the bottom of yet.
The second difference I've noticed is that on Windows the UA-101 is
sending data to the PC (on USB EP 81). This is 'random' data (but it
does have a lot of zeros in it), I haven't investigated it yet:
00000000: 00 a9 fb ff 00 e5 00 00 00 65 00 00 00 11 00 00
00000010: 00 5c 00 00 00 15 00 00 00 3f 00 00 00 f9 ff ff
5760 bytes are sent to the sound card, then 9120 bytes are sent back.
This cycle repeats every ~4.6ms. That is about 26 bytes/sample out and
41 bytes/sample back. I'll take some more accurate measurements when I
have a parser for the log format.
On Linux there is no data being read back.
My next move is going to construct some .wav files that differ in a few
samples and compare the traces that they produce.
I have a couple of questions:
* Does anyone know the background behind "I think that's the mentioned
synchronizing-problem in the UA-1000 quirk ('FIXME: playback must be
synchronized to capture')"?
* Any idea what could be causing the glitch?
* Has anyone done any analysis on this problem before?
Cheers,
Phil
Hi,
Looking for a distribution-agnostic, community-maintained place for gathering
linuxaudio-related documentation, wiki.linuxaudio.org seems to be one of the
main resources.
The visual style seemed a bit old-fashioned and cluttered. I took a stab at
cleaning it up a bit:
http://arnout.engelen.eu/files/dev/linuxmusicians/linuxaudiostyle/
How do you like it?
'wiki.linuxaudio.org' and 'apps.linuxaudio.org' have a different logo and a
different start page, but apart from that share the exact same content. This
is pretty confusing. Wouldn't it be more elegant to make 'apps.linuxaudio.org'
redirect to something like 'wiki.linuxaudio.org/apps' ?
Regards,
Arnout Engelen
Hi,
I am running a .mp3 file using 'xine' without any issues on my Fedora
Core 8 machine.
I am reading /dev/dsp and storing it in some file.
i.e. cat /dev/dsp > musicfile
Now I am stopping 'xine' and then writing 'musicfile' to /dev/dsp.
i.e. cat musicfile > /dev/dsp
In this case I can hear the music but with a lot of noise in it.
Is there any way I can remove/reduce this noise from 'musicfile'?
I also tried following program (it records the voice and plays it
immediately) that I got from net to understand how to write to /dev/dsp
but it does not seem to record my voice and hence plays nothing and
there is noise only.
-------------------------------------------------------
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <stdlib.h>
#include <stdio.h>
#include <linux/soundcard.h>
#define LENGTH 3 /* how many seconds of speech to store */
#define RATE 8000 /* the sampling rate */
#define SIZE 8 /* sample size: 8 or 16 bits */
#define CHANNELS 1 /* 1 = mono 2 = stereo */
/* this buffer holds the digitized audio */
unsigned char buf[LENGTH*RATE*SIZE*CHANNELS/8];
int main()
{
int fd; /* sound device file descriptor */
int arg; /* argument for ioctl calls */
int status; /* return status of system calls */
/* open sound device */
fd = open("/dev/dsp", O_RDWR);
if (fd < 0) {
perror("open of /dev/dsp failed");
exit(1);
}
/* set sampling parameters */
arg = SIZE; /* sample size */
status = ioctl(fd, SOUND_PCM_WRITE_BITS, &arg);
if (status == -1)
perror("SOUND_PCM_WRITE_BITS ioctl failed");
if (arg != SIZE)
perror("unable to set sample size");
arg = CHANNELS; /* mono or stereo */
status = ioctl(fd, SOUND_PCM_WRITE_CHANNELS, &arg);
if (status == -1)
perror("SOUND_PCM_WRITE_CHANNELS ioctl failed");
if (arg != CHANNELS)
perror("unable to set number of channels");
arg = RATE; /* sampling rate */
status = ioctl(fd, SOUND_PCM_WRITE_RATE, &arg);
if (status == -1)
perror("SOUND_PCM_WRITE_WRITE ioctl failed");
while (1) { /* loop until Control-C */
printf("Say something:\n");
status = read(fd, buf, sizeof(buf)); /* record some sound */
if (status != sizeof(buf))
perror("read wrong number of bytes");
printf("You said:\n");
status = write(fd, buf, sizeof(buf)); /* play it back */
if (status != sizeof(buf))
perror("wrote wrong number of bytes");
/* wait for playback to complete before recording again */
status = ioctl(fd, SOUND_PCM_SYNC, 0);
if (status == -1)
perror("SOUND_PCM_SYNC ioctl failed");
}
}
---------------------------------------------------------------------------------------
Regards,
Girish
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
This should settle any doubts people have about there being a GPL violation,
along with understanding how the GPL is properly applied. Here is part of
the header from a file in the previous version of Impro-Visor. No notice to
any change was given with the current preview version and jMusic code is still
used in it. Therefore, it be logically deduced that the GPL still applies:
/**
* This Java Class is part of the Impro-Visor API
*
* Copyright (C) 2005-2008 by Robert Keller and Harvey Mudd College
*
* It has been edited from the jMusic API version 1.5, March 2004.
* Copyright (C) 2000 Andrew Sorensen & Andrew Brown
*
* Impro-Visor is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
...
Raymond
Hi,
I don't see the Faust code (the .dsp file) that has been used to
produce Guitarix (http://sourceforge.net/apps/trac/guitarix/browser/
trunk/src. It the Faust source code available somewhere?
Thanks
Stephane
>>> Thanks man. I'll forward this to Bob Keller too.
>>> I think he mentioned in a message that he is willing to give developers
>>> svn access to the recent code.
>>>
> >
> > Really. Last year I found Improvisor and wanted to contribute to it,
> > so I got in contact with Bob. I made some changes to integrate the
> > application better into the desktop (on Mac OS X also) and did some
> > initial cleanup.
> > The reaction I received was less than welcoming. In fact, the message I
> > got was that they were not interested in really allowing outside
> > developers to contribute. Thus my changes were never used, or considered
> > as far as I can tell. What I got was a bunch of excuses about the
> > situation with the application until finally this Bob guy came straight
> > out and harshly refused to cooperate on development. I even had to ask
> > numbers of time before I could finally get the source code and this
> > resulted in it finally being posted on the group.
> > Basically the group that works on it is his student research group at the
> > educational institution he is employed at. So it appears that they just
> > want to keep all the glory and credit for the application to themselves by
> > disallowing outside contributions. This is really not manner that we
> > usually associate with FOSS. The fact that you have to subscribe to a user
> > group even to get the binary is one big clue. To my mind the only reason
> > it is under GPL is because they use other libraries that are, not because
> > they see some benefit to doing so.
> > The only way to go with this application, at the moment, is to fork it. I
> > was considering doing this a while ago, but have other projects keeping me
> > busy. If you can convince them to open it up, great. I wouldn't hold my
> > breath though. If enough other developers are interested then I could give
> > some time to a fork.
> This is what he replied me
> "If there are developers who are serious, I could provide svn access to
> our repository. Right now there are 3 people who are active. We are
> about to release version 4, which is almost a year out from version 3.39
> that is in the user group. "
> So I think we have to go the working together way first.
> I've forwarded the message of Lasconic to him, let's wait for his reply
> on that.
No, I think you are wrong here to even consider trying to cooperate. I waited
after your initial reply to respond because obviously you weren't fully
considering my points, so I decided to see what happens. Now a preview of the
next version of impro-visor has been released and it is as I expected. No
source code, again. Blatant GPL violation again. That was unexpected, not!
Where's that SourceForge project also? That's right, it does not exist.
I sent a message about the missing source code, again. I wonder what excuses
he will give, again (or has he decided to not even respond to my legitimate
inquiries now). Last time it was that he was on the road or busy or <enter
lame excuse here>. He had the time to package up binaries for Linux,
Mac, and Windows, but could not zip up the source and post it at the same
time?! Go check that with him and let's see how the responses match what I am
saying.
Now I am seriously considering forking this application myself, to make
sure that everyone can get the current source code, they do not have
to join some group just to get the binary, and that real contributions can
actually get in. Yeah, I'm a serious developer, but that guy never offered to
give me any access and the new version still has bugs that I already fixed
which he would not accept.
I will give it a little longer, but if these people don't get their act
together and start doing things in accord with the GPL, then they should
either change their license and remove all GPL stuff or not be surprised when
a forked version appears (Improvisor+ sounds good: Improvisor, plus the source
code and the ability for others to contribute, and not needing to be in some
group just to get it, and ...).
There has been plenty of time for them to do the right thing. Time has run
out already. Let's not be naive. Some people put out applications as GPL
just so they can say they did, but really they just want to ride on the FOSS
bandwagon to look good. Then when you try to get involved, contribute, or
ask for the source code, all of a sudden they clamp down on things and show
you that they want to control everything, as if it is a commercial proprietary
program. Sorry this does not fly with me. I have had this experience with
another project that thinks they are FOSS and that they can do no wrong. The
end result was that I did actually end up having to fork the program because
of their inability to conduct themselves properly.
Perhaps some other people should get in contact with this project and voice
their concerns and views about how FOSS and GPL based projects do things.
If they start to do things right, then I won't have to fork it. But either
way, the source code and binaries WILL be freely available and without need
for membership in some group. Drive that point home if you will.
Regards,
Raymond Martin