From: Jan S. <ha...@st...> - 2011-10-08 13:31:35
|
On Sep 21 16:26:39, Schumacher Marlon wrote: > I'm having a hard time trying to use sox (sox14.3.2 executable on a MBPro5,2 running MacOS10.6.8) with certain external audio devices. > I've been looking for answers in the manual and archives but now had to resort to asking the list: > > I've been trying to use a MOTU 828MKII and a RME Fireface800 set as default audio device in the OS like this: > > sox -d myoutfile.aiff > > and I am getting (with both devices) this message: > > Input File : 'default' (coreaudio) > Channels : 1 > Sample Rate : 44100 > Precision : 32-bit > Sample Encoding: 32-bit Signed Integer PCM > > In:0.00% 00:00:00.00 [00:00:00.00] Out:0 [ | ] Clip:0 <path-to-sox-exec> WARN coreaudio: coreaudio: unhandled extra buffer. Data discarded. > > -and a 0kb file is written. Have you tried settings the MOTU or the RME as your default input/output in the 'Sound' panel in the MacOS Preferences? > Interestingly, both devices are connected through firewire. > (I tried an M-audio MobilePre (USB) and it worked fine. I don't have a firewire device, but I can confirm the MAudio MobilePre (both the first version and MKII) works fine. > This is a known bug with the OSX Core Audio driver in SoX. It only is > an issue with certain sound devices. The other reported case is > something like on a laptop the speakers work but the headphones do > not. That's me. My SoX installation (14.3.2 from source, on MacOS 10.5.8) does not play(1) through the built-in speakers, but plays OK through the headphones, or the MAudio. While I don't know much about CoreAudio, I believe it is not an audio application's job to differentiate if the user uses headphones or not, or how the audio is routed once the samples have been given to the audio subsystem; so I chalk that problem up to be a weirdness of the MacOS audio subsystem, and not really SoX's fault. > I am the only one developing SoX on OSX right now and I can not > reproduce the issue myself and ran out of ideas to fix. > Hopefully, some one that has hardware issues will some day also be > able to debug it. I take that as a gentle nod to finally submit a gdb trace of my problematic session :-) > But apart from that, is it possible to choose a sound device for sox > on MaxOSX? If I plug my MAudio in (USB), and set that to be my Input/Output in the Sound panel of the Preferences, sox (and other applications) just start to use that. In particular, this works: $ rec in.wav $ play in.wav without specifying the device. > Yes, you can specify a specific device name. First run it like this: > sox -V6 infile -t coreaudio junkname > It will print a line with 'Found Audio Device' "device name"' for each > audio device you have installed. Next rerun the command replace > "junkname" with something from that list. On Sep 28 14:57:57, Chris Bagwell wrote: > Ouch. I think I see a bug in SoX source code. [...] > I'll test it out later and commit a fix. On Sep 29 21:41:11, Chris Bagwell wrote: > I've fixed the bug below but can't test it very well since I only have > 3 audio devices (why I never saw the problem before I guess). Rebuilding from the current git tree, this is what my SoX sees: $ sox -V6 -n -t coreaudio junkname sox: SoX v14.4.0 time: Oct 8 2011 14:25:29 uname: Darwin mac.stare.cz 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386 compiler: gcc 4.0.1 (Apple Inc. build 5493) arch: 1248 48 44 L sox INFO nulfile: sample rate not specified; using 48000 Input File : '' (null) Channels : 1 Sample Rate : 48000 Precision : 32-bit fCoreAudioDriverUID AppleHDAEngineInput:1 sox INFO coreaudio: Found Audio Device "Built-in Microp" sox INFO coreaudio: Found Audio Device "Built-in Input" sox INFO coreaudio: Found Audio Device "Built-in Outpu" sox INFO coreaudio: Found Audio Device "M-Audio Mobile" sox FAIL formats: can't open output file `junkname': can not open audio device (I guess the device name is limited to be a char[16] including the \0.) And indeed, I can specify these on the SoX command line. For example, if I set the default MacOS sound device back to be the bultin mic/speakers, I can run $ sox -t coreaudio "M-Audio Mobile" in.wav $ sox in.wav -t coreaudio "M-Audio Mobile" fCoreAudioDriverUID AppleHDAEngineInput:1 in.wav: File Size: 2.29M Bit Rate: 3.07M Encoding: Signed PCM Channels: 2 @ 32-bit Samplerate: 48000Hz Replaygain: off Duration: 00:00:05.97 In:45.7% 00:00:02.73 [00:00:03.24] Out:131k [ -==| ] Hd:0.0 Clip:0 Aborted. and it records and plays fine through the MAudio. Jan |