Ross Bencina | 1 May 10:11 2008

Re: Padding 24-bit samples

Hi Richard

It's difficult to offer suggestions for other approaches without 
understanding why you want/need to use the padded 24 bit format in the first 
place.

I can only guess that you're using an fixed-point integer decoder which 
outputs samples in this format.

I imagine a loop that shifts all the samples left by 8 bits will not cost 
much.. but I understand your concern to make things as optimised as 
possible.. and agree this might be work which can be avoided.

Keep in mind that you may not avoid  conversion overhead if lower levels of 
the system then have to reconvert the samples to another format anyway. Are 
you sure that the format of all intermediate buffering and bus-transfers 
occur as padded 24-bit with the same endianess as the host?

In principal I don't see a problem with accepting such a patch, however it 
would need to accomodate all of the conversion functions to other PA sample 
types, and all relevant clipping/dithering variants -- since we already have 
a bit of a release blocker with the few (obscure) unimplemented conversion 
functions for currently "supported" formats.

Best wishes

Ross.

----- Original Message ----- 
From: "Richard Titmuss" <richard_titmuss <at> logitech.com>
(Continue reading)

Shayne Wissler | 1 May 21:50 2008
Picon

Error message: Device unavailable

Hello,

I've been trying to use portaudio on "Ubuntu 7.10 - the Gutsy Gibbon"
and am getting mixed results. At first, the patest programs all worked
for me. Now my system is in such a state that I keep getting "Error
message: Device unavailable" from patest_saw; the other patest
programs seem to just crash.

If I reboot, it seems to work again, but then it gets into this broken
state. When I run my own program that is based on ALSA, sound works
fine. When I run my own program based on patest_write_sine, it fails
in the same manner.

I have tried this both with pa_stable_v19_20071207 and a v18 and get
the same results: I can access sound with the ALSA API or with other
sound programs on my system just fine, but all the patest programs
fail.

Suggestions?

Shayne
Bjorn Roche | 1 May 22:44 2008

Java/linux and Portaudio

Hey all,

	I am changing the way my app is built and I'm now using JNI (the java  
native interface) to access portaudio and do all my audio processing.  
The trouble is the main app is launched as a java app, and I don't  
think setting java suid root on client systems is a good idea, nor, of  
course, is running java suid root, but I'd still like to take realtime  
priority on Linux to avoid droppouts in my playback thread. Any idea  
how this can be done?

	thanks,

	bjorn

-----------------------------
Bjorn Roche
XO Wave
Digital Audio Production and Post-Production Software
http://www.xowave.com
http://blog.bjornroche.com
http://myspace.com/xowave
Phil Burk | 2 May 00:14 2008

Re: Java/linux and Portaudio

If you need the PortAudio code to run as root for low latency, then you 
could run it in its own process. Then instead of using JNI you 
communicate with the 'C' code using TCP/IP and sockets.  The audio 'C' 
code runs as a server and you can connect as a client from Java. Java is 
still in user mode. Java sends commands and audio data in packets over 
TCP/IP to the server. I have used this technique to communicate with an 
AU plugin running under LogicExpress from our Java editor application.

Launching the audio server as root is still tricky.

Phil Burk

Bjorn Roche wrote:
> Hey all,
> 
>     I am changing the way my app is built and I'm now using JNI (the 
> java native interface) to access portaudio and do all my audio 
> processing. The trouble is the main app is launched as a java app, and I 
> don't think setting java suid root on client systems is a good idea, 
> nor, of course, is running java suid root, but I'd still like to take 
> realtime priority on Linux to avoid droppouts in my playback thread. Any 
> idea how this can be done?
> 
>     thanks,
> 
>     bjorn
Bjorn Roche | 2 May 01:06 2008

Re: Java/linux and Portaudio

Hey Phil,

	Thanks for the advice. This is how I used to do it, but many features  
on the mac were greatly enhanced by JNI, and I'd like to keep my  
codebase as similar as possible on the two platforms. If there was a  
way to use JNI on Linux, that would be better, but your suggestion is  
likely very workable.

	bjorn

On May 1, 2008, at 6:14 PM, Phil Burk wrote:

> If you need the PortAudio code to run as root for low latency, then  
> you could run it in its own process. Then instead of using JNI you  
> communicate with the 'C' code using TCP/IP and sockets.  The audio  
> 'C' code runs as a server and you can connect as a client from Java.  
> Java is still in user mode. Java sends commands and audio data in  
> packets over TCP/IP to the server. I have used this technique to  
> communicate with an AU plugin running under LogicExpress from our  
> Java editor application.
>
> Launching the audio server as root is still tricky.
>
> Phil Burk
>
> Bjorn Roche wrote:
>> Hey all,
>>    I am changing the way my app is built and I'm now using JNI (the  
>> java native interface) to access portaudio and do all my audio  
>> processing. The trouble is the main app is launched as a java app,  
(Continue reading)

Phil Burk | 2 May 01:20 2008

Re: Java/linux and Portaudio

JNI does have many advantages for combining Java and PortAudio. JSyn 
uses JNI on Mac, Windows and Linux.

But if you want the Java in 'user' mode and the audio code running under 
'root' then it seems you would need two processes and some sort of IPC 
to pass commands and data between them.

Using BSD sockets API in 'C' is pretty portable. Windows needs a couple 
setup calls. Other than that the TCP/IP technique is portable across 
major platforms in 'C'.

Phil

Bjorn Roche wrote:
> Hey Phil,
> 
>     Thanks for the advice. This is how I used to do it, but many 
> features on the mac were greatly enhanced by JNI, and I'd like to keep 
> my codebase as similar as possible on the two platforms. If there was a 
> way to use JNI on Linux, that would be better, but your suggestion is 
> likely very workable.
> 
>     bjorn
> 
> On May 1, 2008, at 6:14 PM, Phil Burk wrote:
> 
>> If you need the PortAudio code to run as root for low latency, then 
>> you could run it in its own process. Then instead of using JNI you 
>> communicate with the 'C' code using TCP/IP and sockets.  The audio 'C' 
>> code runs as a server and you can connect as a client from Java. Java 
(Continue reading)

Yong Hyeon Yoon | 2 May 05:09 2008

Re: Java/linux and Portaudio

Hi,

Runtime.getRuntime().exec() works great for me.
IPC between two processes is automatically established. And you end up  
with Input/Output/Error Streams that can be used to pass command and  
data between two processes. No socket programming is required.

Bjorn, what do you mean by "If there was a way to use JNI on Linux,  
that would be better"? I think I cannot understand what you really  
meant. As far as I know, JNI works on all platforms.

yong

On 1-May-08, at 4:20 PM, Phil Burk wrote:

> JNI does have many advantages for combining Java and PortAudio. JSyn  
> uses JNI on Mac, Windows and Linux.
>
> But if you want the Java in 'user' mode and the audio code running  
> under 'root' then it seems you would need two processes and some  
> sort of IPC to pass commands and data between them.
>
> Using BSD sockets API in 'C' is pretty portable. Windows needs a  
> couple setup calls. Other than that the TCP/IP technique is portable  
> across major platforms in 'C'.
>
> Phil
>
> Bjorn Roche wrote:
>> Hey Phil,
(Continue reading)

Stelios Bounanos | 2 May 06:09 2008
X-Face
Picon

Re: Java/linux and Portaudio

Hi Bjorn,

>>>>> On Thu, 1 May 2008 16:44:07 -0400, Bjorn Roche <bjorn <at> xowave.com> said:

> Hey all,
> 	I am changing the way my app is built and I'm now using JNI (the java  
> native interface) to access portaudio and do all my audio processing.  
> The trouble is the main app is launched as a java app, and I don't  
> think setting java suid root on client systems is a good idea, nor, of  
> course, is running java suid root, but I'd still like to take realtime  
> priority on Linux to avoid droppouts in my playback thread. Any idea  
> how this can be done?

Your application can get realtime priority in few different ways.

1) With kernel 2.6.12+ and a recent PAM library, you can set the rtprio
   limit in /etc/security/limits.conf. Virtually all distributions can
   do this now, and some ship with a limits.conf that permits processes
   in the audio group to run with realtime priority.

2) Rely on the realtime-lsm kernel module, an older method that has been
   deprecated for some time and is no longer supported in kernels 2.6.24+.

3) Through set_rlimits, a setuid wrapper that sets maximum allowable
   realtime priority limits etc. (as supported by 2.6.12+) for user
   processes, based on a configuration file. Another obsolete kludge.

4) Somehow grant your audio process the CAP_SYS_NICE capability without
   being setuid root. POSIX file capabilities can do this, but it's a
   relatively new mechanism and not universally supported yet.
(Continue reading)

Ross Bencina | 2 May 10:39 2008

Re: Java/linux and Portaudio

Hi Bjorn

Just thinking out loud here:

Perhaps it would be possible to still use JNI to communicate with your C 
code, even if its in a difference process, so long as they share a 
commonally addressed memory window. This kind of address-aligned shared 
memory is a bit difficult to guarantee if you're not controlling both 
processes -- but in your case the audio process would be completely under 
your control...

Just a thought.

Ross.

----- Original Message ----- 
From: "Bjorn Roche" <bjorn <at> xowave.com>
To: <portaudio <at> techweb.rfa.org>
Sent: Friday, May 02, 2008 6:44 AM
Subject: [Portaudio] Java/linux and Portaudio

> Hey all,
>
> I am changing the way my app is built and I'm now using JNI (the java 
> native interface) to access portaudio and do all my audio processing.  The 
> trouble is the main app is launched as a java app, and I don't  think 
> setting java suid root on client systems is a good idea, nor, of  course, 
> is running java suid root, but I'd still like to take realtime  priority 
> on Linux to avoid droppouts in my playback thread. Any idea  how this can 
> be done?
(Continue reading)

Nick Guenther | 1 May 19:54 2008
Picon

building is broken on MacOS 10.4

I'm trying to build PA on OS 10.4.11 and it's not going so well. The
wiki claims <http://portaudio.com/trac/wiki/TutorialDir/Compile/MacintoshCoreAudio>
you can just do configure && make but that's not working. I tried both
with the latest stable and the current svn snapshots and got the same
result (seen below).
I do have /Developer/SDKs/MacOSX10.4u.sdk. I don't know what else I can do.

Also, did you know that there is still an outdated COMPILING.DARWIN
file in the root of the repository?

Please CC me, I'm not on this list
Thanks
-Nick

Axkbk:~/Download kousu$ tar zxf pa_stable_v19_20071207.tar.gz
Axkbk:~/Download kousu$ cd portaudio/
Axkbk:~/Download/portaudio kousu$ ls
COMPILING.DARWIN        README.txt              bindings
 configure               fixdir.bat              install-sh
  portaudio-2.0.pc.in
Doxyfile                SConstruct              build
 configure.in            fixfile.bat             ltmain.sh
  src
LICENSE.txt             V19-devel-readme.txt    config.guess
 depcomp                 include                 missing
  test
Makefile.in             aclocal.m4              config.sub
 doc                     index.html              pablio
  testcvs
Axkbk:~/Download/portaudio kousu$ ./configure && make
(Continue reading)


Gmane