amiaopensource / audiorecorder

tool for calibration and recording of analog audio sources
BSD 3-Clause "New" or "Revised" License
26 stars 5 forks source link

installation issue: internal mac settings? #73

Closed bturkus closed 6 years ago

bturkus commented 6 years ago

hey, I'm trying to get audiorecorder up and running, but I'm having a somewhat mysterious installation issue. I've got audio coming into to computer, which I can see here:

screen shot 2018-06-14 at 2 47 01 pm

But audiorecorder is coming up empty. If I switch over to the internal mic, I can record myself cursing this turn of events, but nothing else seems to resolve the prob. I can provide any other info if needed; sorry if this is a lame description.

Thanks,

Ben

privatezero commented 6 years ago

How frustrating! So currently the internal mic will interface with audiorecorder but not the external device? If all is working well it should just be using sox to control coreaudio to grab the default device. What happens if you try selecting the zoom and then running the command rec ~/Desktop/test.wav? Does that capture any audio?

bturkus commented 6 years ago

Yeah that works! What the hell?

On Thu, Jun 14, 2018 at 3:21 PM, Andrew Weaver notifications@github.com wrote:

How frustrating! So currently the internal mic will interface with audiorecorder but not the external device? If all is working well it should just be using sox to control coreaudio to grab the default device. What happens if you try selecting the zoom and then running the command rec ~/Desktop/test.wav? Does that capture any audio?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/amiaopensource/audiorecorder/issues/73#issuecomment-397409366, or mute the thread https://github.com/notifications/unsubscribe-auth/AIkiXiXO_jghvJmlBRVO_9q1LRxJZLOmks5t8relgaJpZM4UofxH .

--

Benjamin Turkus | The New York Public Library Assistant Manager for Audio and Moving Image Preservation

Barbara Goldsmith Preservation Division 40 Lincoln Center Plaza, New York, NY 10023 T. 212.870.1609 <(212)870-1609> | benjaminturkus@nypl.org http://www.nypl.org/preservation https://twitter.com/NYPLPreserve

Lifelong Learning | Advancing Knowledge | Strengthening Our Communities

privatezero commented 6 years ago

Any unusual terminal output? Also, does unplugging and replugging device/rebooting the computer do anything?

bturkus commented 6 years ago

nothing as far as I can tell, just the "broken pipe" bit at the end that I figured was related to stopping the capture prematurely:

pamis-iMac:~ pamiaudio$ audiorecorder -p
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-ffplay --enable-libfreetype --enable-libmp3lame --enable-librubberband --enable-libtesseract --enable-libx264 --enable-libx265 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/2.3.0/include/openjpeg-2.3
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100

Input File     : 'default' (coreaudio)
Channels       : 4
Sample Rate    : 96000
Precision      : 32-bit
Sample Encoding: 32-bit Signed Integer PCM

In:0.00% 00:00:00.64 [00:00:00.00] Out:57.3k [      |      ]        Clip:0    Input #0, sox, from 'pipe:':
  Metadata:
    comment         : Processed by SoX
  Duration: N/A, bitrate: 6144 kb/s
    Stream #0:0: Audio: pcm_s32le, 96000 Hz, stereo, s32, 6144 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s32le (native) -> pcm_s16le (native))
Output #0, wav, to 'pipe:':
  Metadata:
    ICMT            : Processed by SoX
    ISFT            : Lavf58.12.100
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
    Metadata:
      encoder         : Lavc58.18.100 pcm_s16le
In:0.00% 00:00:01.28 [00:00:00.00] Out:119k  [      |      ]        Clip:0    siIn:0.00% 00:00:01.92 [00:00:00.00] Out:180k  [      |      ]        Clip:0    siIn:0.00% 00:00:02.56 [00:00:00.00] Out:242k  [      |      ]        Clip:0    siIn:0.00% 00:00:03.29 [00:00:00.00] Out:311k  [      |      ]        Clip:0    siIn:0.00% 00:00:03.88 [00:00:00.00] Out:369k  [      |      ]        Clip:0    siIn:0.00% 00:00:03.93 [00:00:00.00] Out:377k  [      |      ]        Clip:0    siIn:0.00% 00:00:05.16 [00:00:00.00] Out:492k  [      |      ]        Clip:0    siIn:0.00% 00:00:05.89 [00:00:00.00] Out:561k  [      |      ]        Clip:0    siIn:0.00% 00:00:06.49 [00:00:00.00] Out:618k  [      |      ]        Clip:0    siIn:0.00% 00:00:06.53 [00:00:00.00] Out:627k  [      |      ]        Clip:0    siIn:0.00% 00:00:07.77 [00:00:00.00] Out:741k  [      |      ]        Clip:0    siIn:0.00% 00:00:08.49 [00:00:00.00] Out:811k  [      |      ]        Clip:0    siIn:0.00% 00:00:09.09 [00:00:00.00] Out:868k  [      |      ]        Clip:0    siIn:0.00% 00:00:09.13 [00:00:00.00] Out:877k  [      |      ]        Clip:0    siIn:0.00% 00:00:10.37 [00:00:00.00] Out:991k  [      |      ]        Clip:0    siIn:0.00% 00:00:11.09 [00:00:00.00] Out:1.06M [      |      ]        Clip:0    siIn:0.00% 00:00:11.65 [00:00:00.00] Out:1.11M [      |      ]        Clip:0    siIn:0.00% 00:00:11.73 [00:00:00.00] Out:1.13M [      |      ]        Clip:0    siIn:0.00% 00:00:12.97 [00:00:00.00] Out:1.24M [      |      ]        Clip:0    siIn:0.00% 00:00:13.70 [00:00:00.00] Out:1.31M [      |      ]        Clip:0    siIn:0.00% 00:00:14.25 [00:00:00.00] Out:1.36M [      |      ]        Clip:0    siIn:0.00% 00:00:14.34 [00:00:00.00] Out:1.38M [      |      ]        Clip:0    siIn:0.00% 00:00:15.57 [00:00:00.00] Out:1.49M [      |      ]        Clip:0    siIn:0.00% 00:00:16.30 [00:00:00.00] Out:1.56M [      |      ]        Clip:0    siIn:0.00% 00:00:16.85 [00:00:00.00] Out:1.61M [      |      ]        Clip:0    siIn:0.00% 00:00:17.58 [00:00:00.00] Out:1.68M [      |      ]        Clip:0    siIn:0.00% 00:00:18.18 [00:00:00.00] Out:1.74M [      |      ]        Clip:0    siIn:0.00% 00:00:18.90 [00:00:00.00] Out:1.81M [      |      ]        Clip:0    siIn:0.00% 00:00:19.46 [00:00:00.00] Out:1.86M [      |      ]        Clip:0    siIn:0.00% 00:00:20.18 [00:00:00.00] Out:1.93M [      |      ]        Clip:0    size=    3403kB time=00:00:19.75 bitrate=1411.2kbits/s speed=   1x    
av_interleaved_write_frame(): Broken pipe
Error writing trailer of pipe:: Broken pipe
size=    3431kB time=00:00:19.92 bitrate=1410.5kbits/s speed=0.991x    
video:0kB audio:3432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!

When recording with sox solo, I am getting a bunch of this:

pamis-iMac:~ pamiaudio$ rec ~/Desktop/test.wav

Input File     : 'default' (coreaudio)
Channels       : 4
Sample Rate    : 96000
Precision      : 32-bit
Sample Encoding: 32-bit Signed Integer PCM

In:0.00% 00:00:19.46 [00:00:00.00] Out:1.87M [      |      ]        Clip:0    rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.
rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.
rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.
rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.
rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.
rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.
rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.
rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.
rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.
rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.
rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.
rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.
rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.
In:0.00% 00:00:30.74 [00:00:00.00] Out:2.95M [      |      ]        Clip:0    rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.
In:0.00% 00:00:31.24 [00:00:00.00] Out:3.00M [      |      ]        Clip:0    rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.
rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.

And I've restarted/powered off-on everything, and uninstalled and re-installed audiorecorder. Major bummer!

privatezero commented 6 years ago

One thing that jumps out at me is that your Zoom device is outputting four channels.This is probably what is causing your buffer overruns when capturing directly with sox - four channels of 32 bit 96 kHz is too much for the buffer to handle!

Audiorecorder is currently designed to avoid this problem by trimming the input down to the first two input channels. It is possible that if your zoom is outputting the content on channels 3/4 instead of 1/2 that this is what is causing it to 'work' but not actually capture anything.

One way to test this theory would be to hack audiorecorder to remove that filter by messing with line 410. (This line relates to the preview filter, so this wouldn't change the recording behavior, but if it worked would at least confirm the problem)

You could either remove the remix ${SOXCHANNELS} part completely, or maybe just try changing it to remix 3 4 and seeing if audiorecorder -p got you any audio.

Also, is there any way on the Zoom to control what channels things are coming out of?

privatezero commented 6 years ago

If that is indeed the issue, I can update it to allow selecting channels 3/4 from the option menu (which probably should be done anyway)

bturkus commented 6 years ago

That is definitely the issue; thanks for sticking with me! 3/4 would be awesome additions, but there should be some way to control the Zoom. Need to read up it...again, thanks so much!

privatezero commented 6 years ago

yay! awesome!! I'll open a separate issue to remind myself to add a little more freedom with channel selection.