Tuesday, May 15, 2012

Fixing playrec for Ubuntu

playrec provides high performance real time audio I/O for Octave and Matlab.  But the code base appears to be rotting because the site's forum is blocked for new members and changes in portaudio have not made it into the code base. 

Download portaudio V19 source code and place it the playrec directory.  The you get to fight the compile problems.

There's a note about pa_skeleton.c
  • from a maintainer..."moving src/common/pa_skeleton.c to src/hostapi/skeleton/pa_hostapi_skeleton.c since that's the logical place for it."
  • fixed this by: create a symlink, execute the following in .../portaudio/src/common
    • ln -s ../hostapi/skeleton/pa_hostapi_skeleton.c pa_skeleton.c

With the delivered code, the compile_playrec script complains about
  • #error "Portaudio: PA_NO_<APINAME> is no longer supported, please remove definition and use PA_USE_<APINAME> instead"
The file compile_playrec_func.m has some settings for api selections that look like
   if use_oss
        pa_api_specific_files = [pa_api_specific_files,...
                                 {'src/hostapi/oss/pa_unix_oss.c'}];

        compiler_flags = [compiler_flags, {'PA_USE_OSS'}];
    else
        %compiler_flags = [compiler_flags, {'PA_NO_OSS'}];
    end
I added the % comment symbol for all the lines that have "PA_NO" in flag...and playrec appears to compile and work.