Comments (4)
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.
[deleted comment]
from darkice.
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.
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)
- Liquidsoap Harbor support HOT 6
- Can't use multiple "special characters" in password with multiple stream IDs HOT 2
- code.google.com -> github.com
- Error when building DarkSnow on Manjaro XFCE
- Changing Stream from Live input to a MP3 playback
- Cannot connect to IPv6 icecast server HOT 1
- Enable using Icecast2 with custom username
- aacplus not working on Ubuntu 20.04.2 LTS
- *** stack smashing detected ***: <unknown> terminated HOT 1
- controlling audio delay
- Shoutcast is not working, without further information HOT 2
- Ring buffer full, skipping data
- Darkice List is blocked in China HOT 4
- Flac format HOT 2
- compiling fails on raspberry pi bullseye 64 bit HOT 2
- darkice stops processing ALSA input and hangs HOT 10
- Shoutcast not streaming with no error
- C++17 does not allow dynamic exception specifications HOT 9
- Help with a soundcard connected to a Pi zero via the Pi pins
- How do you supply a feed to two servers? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from darkice.