Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input Overflow Error when stream is not read from #34

Open
Aric1088 opened this issue Aug 3, 2019 · 2 comments
Open

Input Overflow Error when stream is not read from #34

Aric1088 opened this issue Aug 3, 2019 · 2 comments

Comments

@Aric1088
Copy link

Aric1088 commented Aug 3, 2019

Is there a way to ignore the input overflow error thrown by a stream such that the stream is not closed, and continues to work?

My application records system audio and broadcasts it over a network; sometimes due to network issues or no clients listening in, the stream is not emptied quickly enough, and it overflows and closes, necessitating a server restart for it to work again.

Can the exception be ignored? I remember older versions of naudiodon not closing the stream when an input overflow error occurred, allowing the program to continue running

@arisgk
Copy link

arisgk commented Aug 6, 2019

I have a similar problem when recording audio but only on macOS (tried Ubuntu and I don't have the problem there).

System Information

  • OS: macOS Mojave Version 10.14.5
  • Node.js version: 12.7.0 (also tried 10.16.1 with the same result)

In order to replicate, you can run the following code:

const portAudio = require("naudiodon");

const ai = new portAudio.AudioIO({
  inOptions: {
    channelCount: 2,
    sampleFormat: portAudio.SampleFormat16Bit,
    sampleRate: 44100,
    deviceId: -1
  }
});

ai.on("data", data => {
  console.log(data);
});

ai.start();

After getting a few data (buffer) logs, I get:

AudioIO: portAudio status - input overflow 
AudioIO end

Finally, this is what portAudio.getDevices() logs, in case it is helpful:

[
  {
    id: 0,
    name: 'Built-in Microphone',
    maxInputChannels: 2,
    maxOutputChannels: 0,
    defaultSampleRate: 44100,
    defaultLowInputLatency: 0.0029478458049886623,
    defaultLowOutputLatency: 0.01,
    defaultHighInputLatency: 0.01310657596371882,
    defaultHighOutputLatency: 0.1,
    hostAPIName: 'Core Audio'
  },
  {
    id: 1,
    name: 'Built-in Output',
    maxInputChannels: 0,
    maxOutputChannels: 2,
    defaultSampleRate: 44100,
    defaultLowInputLatency: 0.01,
    defaultLowOutputLatency: 0.007800453514739229,
    defaultHighInputLatency: 0.1,
    defaultHighOutputLatency: 0.017959183673469388,
    hostAPIName: 'Core Audio'
  }
]

martinblech added a commit to martinblech/naudiodon that referenced this issue Nov 17, 2019
scriptorian added a commit that referenced this issue Jan 10, 2020
@EwanRoycroft
Copy link

I have the same problem on Ubuntu 20.04. I'm trying to use PortAudio to record and stream audio. I can see that a few overflows are reported and handled, but then one is reported after about 7 hours and the stream stops. The program doesn't stop running or trigger any kind of error/EOS, but the Icecast server will close and all recordings will be empty.

I had already had this problem when trying to use arecord, and have switched to PortAudio as I thought it might handle xruns/xflows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants