summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opierec/device.cpp
Side-by-side diff
Diffstat (limited to 'noncore/multimedia/opierec/device.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opierec/device.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/noncore/multimedia/opierec/device.cpp b/noncore/multimedia/opierec/device.cpp
index e7e0f4b..a76665e 100644
--- a/noncore/multimedia/opierec/device.cpp
+++ b/noncore/multimedia/opierec/device.cpp
@@ -60,6 +60,7 @@ Device::Device( QObject * parent, bool record )
if( !record){ //playing
- owarn << "setting up DSP for playing" << oendl;
- flags = O_WRONLY;
+ owarn << "New Sound device DSP for playing" << oendl;
+ flags = O_RDWR;
+// flags = O_WRONLY;
} else { //recording
- owarn << "setting up DSP for recording" << oendl;
+ owarn << "New Sound device DSP for recording" << oendl;
flags = O_RDWR;
@@ -71,2 +72,3 @@ Device::Device( QObject * parent, bool record )
bool Device::openDsp() {
+ qWarning("Device::openDsp()");
if( openDevice( flags) == -1) {
@@ -79,6 +81,6 @@ bool Device::openDsp() {
int Device::openDevice( int flags) {
- owarn << "Opening"<< dspstr;
+ owarn << "Opening sound device:"<< DSPSTROUT << oendl;
- if (( sd = ::open( DSPSTROUT, flags)) == -1) {
- perror("open(\"/dev/dsp\")");
+ if (( sd = ::open( DSPSTROUT, O_RDWR)) == -1) {
+ perror("open(\"/dev/dsp\")\n");
QString errorMsg="Could not open audio device\n /dev/dsp\n"
@@ -92,2 +94,3 @@ int Device::openDevice( int flags) {
}
+ qWarning("opened!");
return sd;
@@ -152,2 +155,3 @@ bool Device::selectMicInput() {
bool Device::closeDevice( bool) {
+ if(sd)
::close( sd); //close sound device