Ducking. When I accept call in my VoIP-softphone, the Volume level in my softphone drops down to 10% , if I use default audio device (Windows 8) - c++

I am working VoIP softphone which used webrtc. And I have meet follow issue:
When I accept call in my softphone, the Volume level in my softphone drops down to 10%.
It is reproduced, when few audio devices are connected to PC and the default audio device (not headset) is used in my softphone.
I tried to disable "ducking" using WASAPI function "SetDuckingPreference", but it not help.
Could you please help me?
Please let me know why the volume is dropped down. How can I fix this?
Thanks

Related

How to programatically route audio from any Recording device to any Playback device

I want to create a virtual audio mixer that allows me to route the audio signal coming from any input (recording) device to any output (playback) device.
I.E.: lets say I have 2 virtual input devices (IN-A and IN-B) and 2 output devices (OUT-C and OUT-D), so I want to
Spotify playing to IN-A -> OUT-C
MIC -> OUT-D
Chrome playing to IN-B -> OUT-C
Also, I want to be able to set devices volume or gain, mute a device and monitor signal or volume level in real time.
Question:
I dont know even where to start. I'm guessing I will have to go for C++, but I dont know if there is an existing library that allows me to do so.
I have been researching and I found portaudio (and others), but before investing more time, I want to know from experst which would be a good starting point to continue my research and POCs development.
NOTE: windows, or any OS native mixer does not cover my needs. I need to achieve this programmatically.
Thanks in advance!
Take a look in this wikipedia artice:
https://en.wikipedia.org/wiki/Windows_legacy_audio_components
There are several ways to achieveing this.
I personally did not wrote an audio mixer tool, but i did a synthesizer project based on winmm.lib functionality.
If you want low-latency mixer you have to write a software driver, which i would not recommend doing.

Any possible way to directly write on Bluetooth Device (from C++/Qt)?

I've read some parts of the Qt 5.10 Bluetooth documentation and follow the Scan tutorial to discover the services, characteristics and descriptors of my device.
It works nice but I need to wait few seconds between each interaction (like, move into a service to list every characteristics).
My question is, can I directly access to a descriptor or a characteristic to write/read directly the data ? And how ?
I have static addresses and I will always use them on every bluetooth devices. I need to write just with the Service/Characteristic/Descriptor combination.
On Ionic, I'm doing it with the Cordova BluetoothLE Plugin and it works fine.
Can anyone help me ? Thank you very much !

Removing and attaching USB audio Jabra headset on Windows 7 SP1 can cause problems with network. How to investigate it?

I work on specialized voip application.
It uses TLS as signalling channel and (S)RTP as media channel in calls.
There is a audio output module written that uses DirectSound to play & capture.
Audio module is resistant to audio errors. If it detects smth wrong -
1) the problem audio device is closed
2) main application is notified about problem
3) customer can select another audio device.
Works good most of time.
But sometimes the sequence "remove / wait 10-20 seconds / insert USB Jabra headset" results in interest thing. There is no more incoming RTP packets or they are corrupted.
OS can send ICMP reports about non available port to remote peer even.
I checked with DevPartner and DrMemory error checkers - but there weren't hints in their reports.
I think it can be driver or Windows issue. It is reproducible on other systems sometimes.
The question - how can I investigate this issue? Maybe there are tools that show audio driver activity inside Windows?
Thank you :)

Detecting arrival/disconnection of audio device

I would like to add feature to my app that will allow detecting arrival and disconnection of playback/capture devices on Windows OS. Like in Skype - when you unplug the device - it show notification that device is lost and e.g. asks you to choose another one.
I'm using DirectSound. I think there can be two ways of solving this problem.
In a separate thread call EnumerateDevices callback and manually detect changes.
Somehow handle WM_DEVICECHANGE message. But AFAIK WM_DEVICECHANGE has some limitations. Btw, It doesn't work with the "smart" audio cards - that allow plugging any kind of device into any sink. If I disable device in device manager - WM_DEVICHANGE arrives. If I manualy unplug my headphones jack - nothing happens. But I need to handle such situation.
Please, advice the proper approach.
Thanks in advance.
You can register for add/remove audio device notifications in Windows Vista and newer using Core Audio SDK
IMMDeviceEnumerator::RegisterEndpointNotificationCallback
See http://msdn.microsoft.com/en-us/library/windows/desktop/dd371403(v=vs.85).aspx

Data transmission through USB

I want to develop code to transmit data from system to PIC through USB.
Can anybody give good link regarding data transmission through USB.
because i am new to this.
NOTE: Very simple is code is enough to me.
Thanks in Advance
The PIC16F877 does not have a USB peripheral built in. I assume that the product that you are building is a "USB Device" and that the "system" that you are referring to will provide the USB host functionality. If this is the case then you will have to add a USB interface chip to your hardware to provide async serial to USB connectivity. Suitable devices are made by TI (TUSB series) or FTDI. You then connect one of these to the PIC internal USART and pretend that you are transferring the data over a simple serial port. If you are using a pc then the connected device will appear as a standard COMn: port.
I totally agree with the FTDI route, however if you're not looking for a UART tunnel over USB then you have to get a bit more in-depth.
You'll have to write the USB routines yourself or find libraries/projects for your processor. What you will definitely have to have is a fast clock - 12MHz is necessary More is better because on small uC's like these you'll spend most of your time just handling the basics of USB - signaling and so forth. You'll also need a fair bit of memory because the USB code takes up around 1.5K I think. Then you need room afterwards for your own code.
I've seen the V-USB (http://www.obdev.at/products/vusb/index.html). It's for AVR not PIC, but it says it provides all of the USB functionality you'll need and even provides vendor and product IDs for you to use (non-commercial I believe). There's also a PIC project for USB that doesn't run on the same hardware as yours here: http://www.alanmacek.com/usb/
To make the driver you'll have to use libusb - here's a link for the win32 version: http://libusb-win32.sourceforge.net/
It's surprisingly more simple than I had expected, but I just looked at example code and not actually made anything. Good luck!
As your task will involve Windows Device Driver development, I do recommend to downlaod and install the WDK and look through the contained sample USB drivers.
This might get you some hints about the complexity of the topic. Device driver development is not the easiest thing to start with.
Maybe you can start with UART communication (RS232).
check http://www.beyondlogic.org/usbnutshell/pic16f876.gif will surely help u
also
ttp://www.beyondlogic.org/usbnutshell/usb7.htm , type h in front of 2nd link.