[jitsi-dev] [libjitsi] libjitsi - selection of audio device in Linux (pulseaudio) doesn't work (#49)


#1

As for Rolf Hamburg, I have the same issue on Ubuntu 14.04 LTS

···

-----------------------------------------------------------------------------------------------------------

Hi,

We are using libjitsi (569) to develop a java8-scala-application with a VoIP-component for Linux (pulseaudio).
Our problem is the correct selection of the audio-device.

At startup we show a selection-window of the active devices (capDevicesList), which we get from:
deviceConfiguration = mediaService.getDeviceConfiguration()
capDevicesList = deviceConfiguration.getAudioSystem.getDevices(AudioSystem.DataFlow.CAPTURE)

The user selects a device (selectedDevice) from capDevicesList, which we set into the AudioSystem:
deviceConfiguration.getAudioSystem.setDevice(AudioSystem.DataFlow.CAPTURE, selectedDevice, true)

The MediaDevice is build like this:
mediaDevice = new AudioMediaDeviceImpl(selectedDevice)

Then we create a MediaStream:
mediaStream = mediaService.createMediaStream(mediaDevice)

If mediaDevice is the only device connected to the computer, everything works fine. But if there's
another device connected, the mediastream doesn't use necessarily mediaDevice. The above procedure of
selecting the device doesn't has any influence on which device will be used.
What we are doing wrong?

Thanks,
Rolf

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/issues/49


#2

Here is the solution I found to workaround the problem....

  AudioSystem audioSystem = ((MediaServiceImpl) LibJitsi.getMediaService()).getDeviceConfiguration().getAudioSystem();

  List<CaptureDeviceInfo2> list = audioSystem.getDevices(DataFlow.PLAYBACK);
  //....... select the one you want and then
  audioSystem.setDevice(DataFlow.PLAYBACK, selectedDevice, true);

  list = audioSystem.getDevices(DataFlow.CAPTURE);
  //....... select the one you want and then
  audioSystem.setDevice(DataFlow.CAPTURE, selectedDevice, true);

I hope it will help...

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/issues/49#issuecomment-114390461


#3

Closed #49.

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/issues/49#event-337508864