diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/AudioInput.rdb b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/AudioInput.rdb index 4805ad9..96c4236 100644 Binary files a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/AudioInput.rdb and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/AudioInput.rdb differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/AudioOutput.npa00 b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/AudioOutput.npa00 new file mode 100644 index 0000000..3b07880 Binary files /dev/null and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/AudioOutput.npa00 differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/AudioOutput.npd b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/AudioOutput.npd new file mode 100644 index 0000000..88d8979 Binary files /dev/null and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/AudioOutput.npd differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/AudioOutput.rdb b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/AudioOutput.rdb new file mode 100644 index 0000000..0534a41 Binary files /dev/null and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/AudioOutput.rdb differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/GlobalFileTable.000 b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/GlobalFileTable.000 index 4aacac5..45c3edf 100644 Binary files a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/GlobalFileTable.000 and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/GlobalFileTable.000 differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/GlobalFileTable.001 b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/GlobalFileTable.001 index 8ff2e44..12ed4dd 100644 Binary files a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/GlobalFileTable.001 and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/GlobalFileTable.001 differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/RtAudio.rdb b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/RtAudio.rdb new file mode 100644 index 0000000..67115dd Binary files /dev/null and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/RtAudio.rdb differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/SoapyHifiBerrySettings.npa00 b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/SoapyHifiBerrySettings.npa01 similarity index 56% rename from .visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/SoapyHifiBerrySettings.npa00 rename to .visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/SoapyHifiBerrySettings.npa01 index 5be2384..5525dba 100644 Binary files a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/SoapyHifiBerrySettings.npa00 and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/SoapyHifiBerrySettings.npa01 differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/SoapyHifiBerrySettings.npd b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/SoapyHifiBerrySettings.npd index 74dd650..9d720ed 100644 Binary files a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/SoapyHifiBerrySettings.npd and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/SoapyHifiBerrySettings.npd differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/SoapyHifiBerrySettings.rdb b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/SoapyHifiBerrySettings.rdb index 970cfea..a2b2de9 100644 Binary files a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/SoapyHifiBerrySettings.rdb and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/SoapyHifiBerrySettings.rdb differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/codedb.lck b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/codedb.lck index 3837aea..88366bd 100644 --- a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/codedb.lck +++ b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/codedb.lck @@ -1 +1 @@ -This file was last opened by PID 17852 +This file was last opened by PID 33640 diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000001.npa00 b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000001.npa00 new file mode 100644 index 0000000..2b6e71c Binary files /dev/null and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000001.npa00 differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000003.npa01 b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000003.npa01 new file mode 100644 index 0000000..35c29c6 Binary files /dev/null and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000003.npa01 differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000003.npd b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000003.npd new file mode 100644 index 0000000..8068453 Binary files /dev/null and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000003.npd differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000003.rdb b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000003.rdb new file mode 100644 index 0000000..7ba5849 Binary files /dev/null and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000003.rdb differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000006.npa00 b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000006.npa00 new file mode 100644 index 0000000..65c195a Binary files /dev/null and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000006.npa00 differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000006.npd b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000006.npd new file mode 100644 index 0000000..690d99c Binary files /dev/null and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000006.npd differ diff --git a/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000006.rdb b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000006.rdb new file mode 100644 index 0000000..c71f191 Binary files /dev/null and b/.visualgdb/CodeDB/SoapyHifiBerry-Release-VisualGDB/tmp00000006.rdb differ diff --git a/.visualgdb/VisualGDBCache/SoapyHifiBerry-Release/SysprogsSyncCache/00.dat b/.visualgdb/VisualGDBCache/SoapyHifiBerry-Release/SysprogsSyncCache/00.dat index e152821..f0d5655 100644 Binary files a/.visualgdb/VisualGDBCache/SoapyHifiBerry-Release/SysprogsSyncCache/00.dat and b/.visualgdb/VisualGDBCache/SoapyHifiBerry-Release/SysprogsSyncCache/00.dat differ diff --git a/AudioOutput.cpp b/AudioOutput.cpp index 8e91524..6424fa6 100644 --- a/AudioOutput.cpp +++ b/AudioOutput.cpp @@ -123,6 +123,7 @@ bool AudioOutput::open(std::string device) } } info = this->getDeviceInfo(parameters.deviceId); + alsa_device = parameters.deviceId - 1; parameters.nChannels = info.outputChannels; printf("audio device = %d %s samplerate %d channels %d\n", parameters.deviceId, device.c_str(), m_sampleRate, parameters.nChannels); err = this->openStream(¶meters, NULL, RTAUDIO_FLOAT64, m_sampleRate, &bufferFrames, &Audioout, (void *)databuffer, NULL); @@ -269,7 +270,7 @@ int lookup_id(snd_ctl_elem_id_t* id, snd_ctl_t* handle) return 0; } -int controle_alsa(int device, int element, int ivalue) +int AudioOutput::controle_alsa(int element, int ivalue) { char str[80]; int err; @@ -279,7 +280,7 @@ int controle_alsa(int device, int element, int ivalue) snd_ctl_elem_id_alloca(&id); snd_ctl_elem_value_alloca(&value); - sprintf(str, "hw:%d", device); + sprintf(str, "hw:%d", alsa_device); if ((err = snd_ctl_open(&handle, str, 0)) < 0) { fprintf(stderr, "Card open error: %s\n", snd_strerror(err)); return err; diff --git a/AudioOutput.h b/AudioOutput.h index 2490f28..f623ed6 100644 --- a/AudioOutput.h +++ b/AudioOutput.h @@ -34,6 +34,7 @@ class AudioOutput : unsigned int get_samplerate() { return m_sampleRate; } unsigned int getDevices(); unsigned int get_device() { return parameters.deviceId;} + int controle_alsa(int element, int ivalue); protected: void samplesToInt16(const SampleVector& samples, @@ -48,6 +49,7 @@ class AudioOutput : double m_volume; string m_error; atomic underrun; + int alsa_device; map device_map; }; diff --git a/SoapyHifiBerrySettings.cpp b/SoapyHifiBerrySettings.cpp index c07ce92..5e24d35 100644 --- a/SoapyHifiBerrySettings.cpp +++ b/SoapyHifiBerrySettings.cpp @@ -197,7 +197,7 @@ void SoapyHifiBerry::setGain(const int direction, const size_t channel, const do SoapySDR_log(SOAPY_SDR_INFO, "SoapyHifiBerry::setGain called"); if (direction == SOAPY_SDR_RX) - controle_alsa(3, 21, (int) value); // numid = 21, iface = MIXER, name = 'ADC Capture Volume' + uptr_audiooutput->controle_alsa(21, (int) value); // numid = 21, iface = MIXER, name = 'ADC Capture Volume' }