Giter Site home page Giter Site logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
I do not agree with the solution.
It might work for you, but busy looping on a read is never efficient.
If the machine is fast enough it might loop many times without reading a single 
byte, as machines get faster you must increase your loop counter.... bad design

If you must disconnect the sound card ? Why do it ?
Then use other solution please, check return value of read() must be -1 and 
check errno for problems
Also use select() to wait for data to become ready or timeout at about 0.2 
second, if nothing available then assume the device failed.
Just my opinion...

Original comment by oetelaar.automatisering on 16 Mar 2011 at 11:50

from darkice.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
[deleted comment]

from darkice.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
USB sound cards (tuner) sometimes just resets and device is lost for about 5 
seconds, sometimes it change /dev/dspX to /dev/dspY after reseting USB device.

System jusg hangs while reading from device in non-blocking mode, so I can't 
check return value, becasue read is running forever, the same behaviour is for 
NON BLOCKING reading, normal reading has for example 10 null readings 11. is 
data and reading whit disconnected device hase for example 30 null readings, 
31. is system crash (so there is time to catch it).

I wrote my own program for recording and streaming in C and it is stable, there 
is no system crash, but it doesn't using more threads.

I don't know why darkice crashed, can someone else test this issue?

Original comment by [email protected] on 16 Mar 2011 at 8:46

from darkice.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Using select() could be a good choice.
I don't think we really have a problem here...

Original comment by [email protected] on 16 Jan 2012 at 9:34

from darkice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.