[LAD] [PATCH] [SOUND] Fixes recording gain control

2009-03-10 Thread Viral Mehta
Have tested two usb audio mic devices.
At the time of initialization, SNDRV_MIXER_OSS_PRESENT_PVOLUME bit is not
set for MIC (slot 7).
So, the same should not be checked when an application tries to do gain 
control
for audio recording devices. Just check
slot-present for SNDRV_MIXER_OSS_PRESENT_CVOLUME independently.
Verified with a simple application which opens /dev/dsp for recording and
/dev/mixer for volume control.


Signed-off-by: Viral Mehta viral.me...@einfochips.com
---
 sound/core/oss/mixer_oss.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index 4690b8b..919c7eb 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -690,7 +690,7 @@ static int snd_mixer_oss_put_volume1(struct 
snd_mixer_oss_file *fmixer,

if (slot-present  SNDRV_MIXER_OSS_PRESENT_PVOLUME) {
snd_mixer_oss_put_volume1_vol(fmixer, pslot, 
slot-numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
-   if (slot-present  SNDRV_MIXER_OSS_PRESENT_CVOLUME)
+   } else if (slot-present  SNDRV_MIXER_OSS_PRESENT_CVOLUME) {
snd_mixer_oss_put_volume1_vol(fmixer, pslot, 
slot-numid[SNDRV_MIXER_OSS_ITEM_CVOLUME], left, right);
} else if (slot-present  SNDRV_MIXER_OSS_PRESENT_GVOLUME) {
snd_mixer_oss_put_volume1_vol(fmixer, pslot, 
slot-numid[SNDRV_MIXER_OSS_ITEM_GVOLUME], left, right);

-- 
1.5.3.3



-- 
_
Disclaimer: This e-mail message and all attachments transmitted with it
are intended solely for the use of the addressee and may contain legally
privileged and confidential information. If the reader of this message
is not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby
notified that any dissemination, distribution, copying, or other use of
this message or its attachments is strictly prohibited. If you have
received this message in error, please notify the sender immediately by
replying to this message and please delete it from your computer. Any
views expressed in this message are those of the individual sender
unless otherwise stated.Company has taken enough precautions to prevent
the spread of viruses. However the company accepts no liability for any
damage caused by any virus transmitted by this email.
__
 
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


Re: [LAD] [alsa-devel] [PATCH] [SOUND] recording gain control

2009-03-10 Thread Viral Mehta
Takashi Iwai wrote:
 At Tue, 10 Mar 2009 10:00:13 +0100,
 Clemens Ladisch wrote:
   
 (CC alsa-devel)

 Viral Mehta wrote:
 
 Hi,

 I am trying to do gain control while RECORDING for my Audio Mic device.

 My application opens /dev/mixer device and calls ioctl(fdmixer, 
 MIXER_WRITE(SOUND_MIXER_MIC), ...)

 But, the call fails. It traces to sound/core/oss/mixer_oss.c file and 
 snd_mixer_oss_put_volume1() function.
 It never falls in if (slot-present  SNDRV_MIXER_OSS_PRESENT_CVOLUME) 
 as condition if (slot-present  SNDRV_MIXER_OSS_PRESENT_PVOLUME)  
 comes as false.

 I think there is a bug in kernel and I think it should be like as below,

 --- sound/core/oss/mixer_oss.c  2008-12-03 13:24:02.0 +0530
 +++ sound/core/oss/mixer_oss.c   2009-03-09 16:22:06.548766896 +0530
 @@ -688,7 +688,7 @@ static int snd_mixer_oss_put_volume1(str

  if (slot-present  SNDRV_MIXER_OSS_PRESENT_PVOLUME) {
  snd_mixer_oss_put_volume1_vol(fmixer, pslot, 
 slot-numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
 -   if (slot-present  SNDRV_MIXER_OSS_PRESENT_CVOLUME)
 +   } else if (slot-present  SNDRV_MIXER_OSS_PRESENT_CVOLUME) {
  snd_mixer_oss_put_volume1_vol(fmixer, pslot, 
 slot-numid[SNDRV_MIXER_OSS_ITEM_CVOLUME], left, right);
  } else if (slot-present  SNDRV_MIXER_OSS_PRESENT_GVOLUME) {
  snd_mixer_oss_put_volume1_vol(fmixer, pslot, 
 slot-numid[SNDRV_MIXER_OSS_ITEM_GVOLUME], left, right);
   
 Your mailer mangled the patch; see linux/Documentation/email-clients.txt.
 

 Also, the current code behaves intentionally so (as it's designed for
 mic-loopback volume).

 A more feasible fix would be to add another if check for *_CVOLUME
 instead of moving it.


   
Oh okie. It makes sense.
I just sent out a patch on LAD. Should I resubmit with what you proposed ?

 Takashi
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/


 Email Scanned for Virus  Dangerous Content by : www.CleanMailGateway.com


   
-- 
_
Disclaimer: This e-mail message and all attachments transmitted with it
are intended solely for the use of the addressee and may contain legally
privileged and confidential information. If the reader of this message
is not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby
notified that any dissemination, distribution, copying, or other use of
this message or its attachments is strictly prohibited. If you have
received this message in error, please notify the sender immediately by
replying to this message and please delete it from your computer. Any
views expressed in this message are those of the individual sender
unless otherwise stated.Company has taken enough precautions to prevent
the spread of viruses. However the company accepts no liability for any
damage caused by any virus transmitted by this email.
__
 
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


Re: [LAD] [alsa-devel] [PATCH] [SOUND] recording gain control

2009-03-10 Thread Takashi Iwai
At Tue, 10 Mar 2009 17:52:46 +0530,
Viral Mehta wrote:
 
 Takashi Iwai wrote:
  At Tue, 10 Mar 2009 10:00:13 +0100,
  Clemens Ladisch wrote:

  (CC alsa-devel)
 
  Viral Mehta wrote:
  
  Hi,
 
  I am trying to do gain control while RECORDING for my Audio Mic device.
 
  My application opens /dev/mixer device and calls ioctl(fdmixer, 
  MIXER_WRITE(SOUND_MIXER_MIC), ...)
 
  But, the call fails. It traces to sound/core/oss/mixer_oss.c file and 
  snd_mixer_oss_put_volume1() function.
  It never falls in if (slot-present  SNDRV_MIXER_OSS_PRESENT_CVOLUME) 
  as condition if (slot-present  SNDRV_MIXER_OSS_PRESENT_PVOLUME)  
  comes as false.
 
  I think there is a bug in kernel and I think it should be like as below,
 
  --- sound/core/oss/mixer_oss.c  2008-12-03 13:24:02.0 +0530
  +++ sound/core/oss/mixer_oss.c   2009-03-09 16:22:06.548766896 +0530
  @@ -688,7 +688,7 @@ static int snd_mixer_oss_put_volume1(str
 
   if (slot-present  SNDRV_MIXER_OSS_PRESENT_PVOLUME) {
   snd_mixer_oss_put_volume1_vol(fmixer, pslot, 
  slot-numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
  -   if (slot-present  SNDRV_MIXER_OSS_PRESENT_CVOLUME)
  +   } else if (slot-present  SNDRV_MIXER_OSS_PRESENT_CVOLUME) {
   snd_mixer_oss_put_volume1_vol(fmixer, pslot, 
  slot-numid[SNDRV_MIXER_OSS_ITEM_CVOLUME], left, right);
   } else if (slot-present  SNDRV_MIXER_OSS_PRESENT_GVOLUME) {
   snd_mixer_oss_put_volume1_vol(fmixer, pslot, 
  slot-numid[SNDRV_MIXER_OSS_ITEM_GVOLUME], left, right);

  Your mailer mangled the patch; see linux/Documentation/email-clients.txt.
  
 
  Also, the current code behaves intentionally so (as it's designed for
  mic-loopback volume).
 
  A more feasible fix would be to add another if check for *_CVOLUME
  instead of moving it.
 
 

 Oh okie. It makes sense.
 I just sent out a patch on LAD. Should I resubmit with what you proposed ?

LAD is no good place for sending a patch of sound driver.
Please post to alsa-devel ML (and add Cc to me).


thanks,

Takashi
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


[LAD] Anyone out there familiar with the code base of sonic visualizer?

2009-03-10 Thread Nathanael Anderson
Anyone on the list familiar with the code base of sonic visualizer? I'm
wondering if it would be possible to make a standalone program that works
multiplatform and can read live audio data, and return an array of the
likelyhood that each note was played in an audio stream in the previous 20ms
(not a hard limit, just an example). Similar to how the melodic range
visualization works, everytime x samples are read, check which chords, and
octives they fall into, so say there is an 88 position array of all notes
that are on a keyboard, and middle c is played, so position 60 in the array
would get a high value. I want to be able to work off acoustic data. This in
not going to be used to drive a sequencer or anything. I just want to be
able to check if said note was played.

Thanks in advance for any feedback. If there is another program that you
think would provide better results please let me know. I've tried aubio, and
it crashed all the time on me.

Nathanael
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


[LAD] New release of jconv

2009-03-10 Thread Fons Adriaensen
Hello all,

Jconv-0.8.0 is now available at the usual place

http://www.kokkinizita.net/linuxaudio/downloads

New in this release:

- New command line option -L nsamples, tries
to compensate for 'nsamples' of processing
latency.

- Jack ports can now be given meaningful names
and optionally be connected, by commands in the
config files.

- Some new reverb IRs available in a separate
package 'jconv-reverbs'. Includes ambisonic and
stereo IRs of the concert hall of La Casa della
Musica, and the former Santa Elisabetta church,
now La Casa del Suono, in Parma.
 
Enjoy !


-- 
FA

Laboratorio di Acustica ed Elettroacustica
Parma, Italia

Be quiet, Master Land; and you, Professor,
will you be so good as to listen to me ?
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


Re: [LAD] New release of jconv

2009-03-10 Thread alex stone
On Wed, Mar 11, 2009 at 1:28 AM, Fons Adriaensen f...@kokkinizita.netwrote:

 Hello all,

 Jconv-0.8.0 is now available at the usual place

 http://www.kokkinizita.net/linuxaudio/downloads

 New in this release:

 - New command line option -L nsamples, tries
 to compensate for 'nsamples' of processing
 latency.

 - Jack ports can now be given meaningful names
 and optionally be connected, by commands in the
 config files.

 - Some new reverb IRs available in a separate
 package 'jconv-reverbs'. Includes ambisonic and
 stereo IRs of the concert hall of La Casa della
 Musica, and the former Santa Elisabetta church,
 now La Casa del Suono, in Parma.

 Enjoy !


 --
 FA

 Laboratorio di Acustica ed Elettroacustica
 Parma, Italia

 Be quiet, Master Land; and you, Professor,
 will you be so good as to listen to me ?
 ___
 Linux-audio-dev mailing list
 Linux-audio-dev@lists.linuxaudio.org
 http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


Fons, downloaded, but get the following make error:

 make
g++  -O3 -Wall -MMD -MP -DVERSION=\0.8.0\  -c -o jconv.o jconv.cc
In file included from jconv.cc:29:
jclient.h: In member function ‘void Jclient::start()’:
jclient.h:48: error: no matching function for call to
‘Convproc::start_process(int, int)’
/usr/include/zita-convolver.h:250: note: candidates are: int
Convproc::start_process(int)
make: *** [jconv.o] Error 1


What am i doing wrong here?

Alex.



-- 
Parchment Studios (It started as a joke...)
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


Re: [LAD] New release of jconv

2009-03-10 Thread Fons Adriaensen
On Wed, Mar 11, 2009 at 01:44:45AM +0300, alex stone wrote:

 Fons, downloaded, but get the following make error:
 
  make
 g++  -O3 -Wall -MMD -MP -DVERSION=\0.8.0\  -c -o jconv.o jconv.cc
 In file included from jconv.cc:29:
 jclient.h: In member function ‘void Jclient::start()’:
 jclient.h:48: error: no matching function for call to
 ‘Convproc::start_process(int, int)’
 /usr/include/zita-convolver.h:250: note: candidates are: int
 Convproc::start_process(int)
 make: *** [jconv.o] Error 1
 
 
 What am i doing wrong here?

Nothing, I forgot you need an update of zita-convolver.
It's uploaded now.

Make sure to check the makefile for zita-convolver
and add the best optimisation flags for your CPU.

Ciao,

-- 
FA

Laboratorio di Acustica ed Elettroacustica
Parma, Italia

Be quiet, Master Land; and you, Professor,
will you be so good as to listen to me ?
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


Re: [LAD] New release of jconv

2009-03-10 Thread Jörn Nettingsmeier
Fons Adriaensen wrote:
 On Wed, Mar 11, 2009 at 01:44:45AM +0300, alex stone wrote:

 What am i doing wrong here?
 
 Nothing, I forgot you need an update of zita-convolver.
 It's uploaded now.
 
 Make sure to check the makefile for zita-convolver
 and add the best optimisation flags for your CPU.

thanks, that one fixed the problem for me. there's a spurios makeald
in the Makefile that prevents the install target from working. i deleted
it without apparent ill effects.

best,

jörn




___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


Re: [LAD] New release of jconv

2009-03-10 Thread Jörn Nettingsmeier
wow. thanks for the new example configurations and the extensive
comments! very helpful.

the convolver itself is a bit of a marketing disaster, though. i mean,
uh, it just convolves. No fancy new features, such as UltraLowJitter, or
at least TrueMultiplyAndAdd (for purists, as opposed to FFT-based, for
that extra dash of depth and clarity). And TubeMode would be cool as
well. but one cannot have it all, i assume. ;)

in the reverb configs, you mention that you cut off the direct sound by
setting an offset, which will then make the convolutions suitable to use
in a classic aux send setup, so that the reverb return will be 100% wet.
but why do you remove the first 5 ms of the room response?
i seem to recall it is about control of low frequency energy, but i
forgot the details. are those 5ms a natural constant, a matter of taste,
or maybe a function of the room's rt60? pointers to TFM would be R with
great interest.


best,

jörn

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


Re: [LAD] New release of jconv

2009-03-10 Thread Fons Adriaensen
On Wed, Mar 11, 2009 at 02:26:06AM +0300, alex stone wrote:

 Hehe Jorn, there's an echo in here.
 I'll go hunting for the makeald, then.

Just delete the makeald line in the install
target. I'll update the release...

(Seems like I'm trying to do too much in too little time)

Ciao,

-- 
FA

Laboratorio di Acustica ed Elettroacustica
Parma, Italia

Be quiet, Master Land; and you, Professor,
will you be so good as to listen to me ?
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


[LAD] Strange network problem ?

2009-03-10 Thread Fons Adriaensen
Hello all,

Today I had a strange problem when using the
WFS system here.

The 'master' PC sends a multicast message every
1024 samples (21.333 ms) to all 'render' PCs.
This has to arrive on time, and when it's late
the renderers will mute their output and report
the error in their status messages. 

Today I used some ssh -X logins from my laptop
in the WFS room to the WFS master to run Ardour
and some other apps for a demo. All this worked
well all the time, as it has done before.

I left everything running when going for lunch
with our visitors, and when I returned restarted
Ardour to listen again. I got a lots 'of 'message
too late' errors from the rendering machines, and
interrupted sound. Strange enough this seemed to
be related to the _volume_ of the sounds...

In other words to Ardour's level meters. 
Restarting Ardour in a new ssh login did not
help, but running it directly on the WFS master
solved the problem. So apparently the network
traffic required to update Ardour's meters was
causing the delays. And clearly the whole remote
X session was slower than normal. CPU loads 
looked normal.

Now all this should be peanuts for a Gbit
network that has no other traffic at all,
and it worked perfectly before. I just never
left it running for such a long time.

Anyone an idea as to what is happening here,
and how it could be cured ?

TIA,

-- 
FA

Laboratorio di Acustica ed Elettroacustica
Parma, Italia

Be quiet, Master Land; and you, Professor,
will you be so good as to listen to me ?
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


Re: [LAD] New release of jconv

2009-03-10 Thread Fons Adriaensen
On Wed, Mar 11, 2009 at 12:45:17AM +0100, Jörn Nettingsmeier wrote:

 wow. thanks for the new example configurations and the extensive
 comments! very helpful.

I hope you like the AMB ones...
 
 the convolver itself is a bit of a marketing disaster, though. i mean,
 uh, it just convolves. No fancy new features, such as UltraLowJitter, or
 at least TrueMultiplyAndAdd (for purists, as opposed to FFT-based, for
 that extra dash of depth and clarity). And TubeMode would be cool as
 well. but one cannot have it all, i assume. ;)

:-) I'll take the IR of a long tube one if these days.

 in the reverb configs, you mention that you cut off the direct sound by
 setting an offset, which will then make the convolutions suitable to use
 in a classic aux send setup, so that the reverb return will be 100% wet.
 but why do you remove the first 5 ms of the room response?

Because it's not room response but speaker response
(mainly LF, if the source was not well equalised),
or reflections from very close objects which are
not perceived as reflections but just add a nasty
colouration.

Ciao,

-- 
FA

Laboratorio di Acustica ed Elettroacustica
Parma, Italia

Be quiet, Master Land; and you, Professor,
will you be so good as to listen to me ?
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev