Re: Any idea why this can hang on a long-running Mac?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 20 15:30:29, dgl@xxxxxxxx wrote:
> On my Mac Mini (details below), the following simple command
> starts hanging more and more often the longer I
> run the machine without a reboot:
> sox --buffer 512 -n -d synth 1 sin 440

I suspect macOS's audio subsystem and
SoX's very outdated support for it.

Can you reproduce the problem with the latest SoX?
The homebrew version, though patched, is extremely old.

Also, run it with sox -V to see the debug messages, as in
sox -V5 --buffer 512 -n -d synth 1 sin 440 gain -6
and post the complete output here: both for
the successful run and for the hang.

> The buffer size reduction makes this happen sooner,
> but the issue can eventually happen without this I believe.

So does it ever occur without the --buffer option?
(Not that I think that is the problem.)

> When the hang occurs:
> * It is immediate with no output sound, though the SoX progress display does appear.
> * The progress counter does not advance.
> * Kill will not kill the process; kill -9 is required.
> * ps shows the status as S+, meaning foreground and in a less-than-20-second sleep.
> * nwchan is 0 and wchan is -

What does 'wchan' and 'nwchan' mean?
I don't see those in this here macOS's ps(1) or top(1) output.

> My Mac is running Monterey
> because it is too old to run a newer OS,

So what machine is it, exactly?
(Monterey is 2021, that's not old.)

> but this is a rather old problem. I am running SoX from Homebrew.

Try with the latest cvs.
(Or one of the resurrected versions
mentioned on this list in the last year.)

> In case it matters, my default output device is a Turtle Beach USB
> sound card, though I don't think the device changes this issue.

Have you tried? Does it ever occur using the machine's native device?
(What is that native device, and why are you using the usb instead?)

> I do run Loopback but am not using it for default output.

Does it ever occur when you are not using Loopback?
(Not that I think it will make a difference,
but don't bring other variables into it.)

For reference, this is what SoX 14.4.2 (built from source) does on my
MacBook Air that has been running macOS 15.2 (Sequoia) for weeks now.

$ sox -V5 --buffer 512 -n -d synth 1 sin 440 gain -6
sox DBUG sox: Looking for a default device: trying format `coreaudio'
sox DBUG coreaudio: audio device did not accept 44100 sample rate. Use 48000 instead.
sox:	  SoX v
time:	  Aug  7 2024 16:53:02
uname:	  Darwin mb.local 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec	6 18:40:14 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T8103 arm64
compiler: gcc Apple LLVM 15.0.0 (clang-1500.1.0.2.5)
arch:	  1288 48 88 L
sox INFO nulfile: sample rate not specified; using 48000

Input File     : '' (null)
Channels       : 1
Sample Rate    : 48000
Precision      : 32-bit

sox DBUG coreaudio: audio device did not accept 44100 sample rate. Use 48000 instead.
sox INFO formats: can't set 1 channels; using 2

Output File    : 'default' (coreaudio)
Channels       : 2
Sample Rate    : 48000
Precision      : 25-bit
Sample Encoding: 32-bit Floating Point PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no

sox DBUG effects: sox_add_effect: extending effects table, new size = 8
sox DBUG synth: type=sine, combine=create, samples_to_do=48000, f1=440, f2=440, offset=0, phase=0, p1=-1, p2=-1, p3=-1 mult=0
sox DBUG gain: mult=1
sox DBUG remix: 0:
sox DBUG remix: 	0 1
sox DBUG remix: 1:
sox DBUG remix: 	0 1
sox INFO sox: effects chain: input	  48000Hz  1 channels (multi) 32 bits unknown length
sox INFO sox: effects chain: synth	  48000Hz  1 channels (multi) 32 bits 00:00:01.00
sox INFO sox: effects chain: gain	  48000Hz  1 channels	      32 bits 00:00:01.00
sox INFO sox: effects chain: channels	  48000Hz  2 channels (multi) 32 bits 00:00:01.00
sox INFO sox: effects chain: output	  48000Hz  2 channels (multi) 25 bits 00:00:01.00
sox DBUG sox: automatically entering interactive mode
sox DBUG sox: start-up time = 0.076597
In:0.00% 00:00:01.00 [00:00:00.00] Out:48.0k [ =====|===== ]	    Clip:0
sox DBUG input: output buffer still held 128 samples; dropped.
Done.


	Jan



_______________________________________________
Sox-users mailing list
Sox-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/sox-users



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux