[sip-comm-dev] Sound Input on Linux fails


#1

Hi,

I have created a special applet version of SC. Everything works quiet
well, until I try to run the applet a second time in the browser:
I open the applet for the first time, and everything is OK. I navigate
to another website and then I open the applet again. In this second
case, SC always fails to open the audio input device:

08.07.2008 10:17:29 net.java.sip.communicator.util.Logger info
INFO: Creating datasource for:javasound://44100
Cannot open audio device for input:
javax.sound.sampled.LineUnavailableException: line with format
PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not
supported.
Cannot open audio device for input:
javax.sound.sampled.LineUnavailableException: line with format
PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not
supported.
java.io.IOException: line with format PCM_SIGNED 44100.0 Hz, 16 bit,
stereo, 4 bytes/frame, little-endian not supported.
08.07.2008 10:17:29 net.java.sip.communicator.util.Logger error
SCHWERWIEGEND: Could not create data source for javasound://44100
javax.media.NoDataSourceException: Error instantiating class:
com.sun.media.protocol.javasound.DataSource : java.io.IOException: line
with format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame,
little-endian not supported.
  at javax.media.Manager.createDataSource(Manager.java:1012)
  at
net.java.sip.communicator.impl.media.MediaControl.createDataSource(MediaControl.java:697)
  at
net.java.sip.communicator.impl.media.MediaControl.initCaptureDevices(MediaControl.java:373)
  at
net.java.sip.communicator.impl.media.MediaControl.initialize(MediaControl.java:213)
  at
net.java.sip.communicator.impl.media.MediaServiceImpl$DeviceConfigurationThread.run(MediaServiceImpl.java:395)
  at
net.java.sip.communicator.impl.media.MediaServiceImpl.start(MediaServiceImpl.java:224)
  at
net.java.sip.communicator.impl.media.MediaActivator.start(MediaActivator.java:60)
  at
org.apache.felix.framework.util.SecureAction$Actions.run(SecureAction.java:853)
  at java.security.AccessController.doPrivileged(Native Method)
  at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:580)
  at org.apache.felix.framework.Felix._startBundle(Felix.java:1536)
  at org.apache.felix.framework.Felix.startBundle(Felix.java:1470)
  at org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1065)
  at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:258)
  at java.lang.Thread.run(Thread.java:619)

As far as I remember, this also happened to me on the standard
(non-applet) version (but there I didn't know exactly when it happened).

Now the real problem is: SC starts, recognizes this error (as shown by
the logs above), but the normal user is not aware of this problem. The
whole gui is just as normal. The point when the user finds out about the
problem (indirect) is when he tries to place a call: The phone of the
callee rings, but as soon as he picks up the phone, SC will show
"failed", as the input device fails.

I think a better solution could be to inform the user already at startup
about the sound input device failure - and maybe even disable actions
where this sound input would be needed for.

Sebastian

···

--
/**
* Sebastian Heib
* Software Developer
*
* Synyx GmbH & Co. KG
* Business in Components
* Karlstr. 68
* 76137 Karlsruhe
*
* phone +49(0)721 66 24 866
* fax +49(0)721 66 48 877
* eMail heib@synyx.de
* www http://www.synyx.de
* irc irc.synyx.de
*
* Sitz der Gesellschaft: Karlsruhe
* Registergericht: Mannheim
* Handelsregisternummer: HRA 4793
* USt-IdNr.: DE249264296
*
* Komplement�rin: Elatech Verwaltungs GmbH
* Sitz der Gesellschaft: Karlsruhe
* Gesch�ftsf�hrer: Markus Daniel
* Registergericht: Mannheim
* Handelsregisternummer: HRB 7250
*/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Hey Sebastian,

Could it be that your first applet is still hogging on the mike?

Emil

Sebastian Heib написа:

···

Hi,

I have created a special applet version of SC. Everything works quiet
well, until I try to run the applet a second time in the browser:
I open the applet for the first time, and everything is OK. I navigate
to another website and then I open the applet again. In this second
case, SC always fails to open the audio input device:

08.07.2008 10:17:29 net.java.sip.communicator.util.Logger info
INFO: Creating datasource for:javasound://44100
Cannot open audio device for input:
javax.sound.sampled.LineUnavailableException: line with format
PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not
supported.
Cannot open audio device for input:
javax.sound.sampled.LineUnavailableException: line with format
PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not
supported.
java.io.IOException: line with format PCM_SIGNED 44100.0 Hz, 16 bit,
stereo, 4 bytes/frame, little-endian not supported.
08.07.2008 10:17:29 net.java.sip.communicator.util.Logger error
SCHWERWIEGEND: Could not create data source for javasound://44100
javax.media.NoDataSourceException: Error instantiating class:
com.sun.media.protocol.javasound.DataSource : java.io.IOException: line
with format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame,
little-endian not supported.
  at javax.media.Manager.createDataSource(Manager.java:1012)
  at
net.java.sip.communicator.impl.media.MediaControl.createDataSource(MediaControl.java:697)
  at
net.java.sip.communicator.impl.media.MediaControl.initCaptureDevices(MediaControl.java:373)
  at
net.java.sip.communicator.impl.media.MediaControl.initialize(MediaControl.java:213)
  at
net.java.sip.communicator.impl.media.MediaServiceImpl$DeviceConfigurationThread.run(MediaServiceImpl.java:395)
  at
net.java.sip.communicator.impl.media.MediaServiceImpl.start(MediaServiceImpl.java:224)
  at
net.java.sip.communicator.impl.media.MediaActivator.start(MediaActivator.java:60)
  at
org.apache.felix.framework.util.SecureAction$Actions.run(SecureAction.java:853)
  at java.security.AccessController.doPrivileged(Native Method)
  at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:580)
  at org.apache.felix.framework.Felix._startBundle(Felix.java:1536)
  at org.apache.felix.framework.Felix.startBundle(Felix.java:1470)
  at org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1065)
  at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:258)
  at java.lang.Thread.run(Thread.java:619)

As far as I remember, this also happened to me on the standard
(non-applet) version (but there I didn't know exactly when it happened).

Now the real problem is: SC starts, recognizes this error (as shown by
the logs above), but the normal user is not aware of this problem. The
whole gui is just as normal. The point when the user finds out about the
problem (indirect) is when he tries to place a call: The phone of the
callee rings, but as soon as he picks up the phone, SC will show
"failed", as the input device fails.

I think a better solution could be to inform the user already at startup
about the sound input device failure - and maybe even disable actions
where this sound input would be needed for.

Sebastian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

I seem to recall having a similar problem on my Linux box, but it happened every time, not just the 2nd time, and I was able to get it to go away by commenting out this code in MediaControl:

            Control ctl = (Control)
                dataSource.getControl("javax.media.control.BufferControl");

            if(ctl != null)
            {
                ((BufferControl)ctl).setBufferLength(60);//buffers in
            }

Ken

Emil Ivov wrote:

···

Hey Sebastian,

Could it be that your first applet is still hogging on the mike?

Emil

Sebastian Heib написа:
  

Hi,

I have created a special applet version of SC. Everything works quiet
well, until I try to run the applet a second time in the browser:
I open the applet for the first time, and everything is OK. I navigate
to another website and then I open the applet again. In this second
case, SC always fails to open the audio input device:

08.07.2008 10:17:29 net.java.sip.communicator.util.Logger info
INFO: Creating datasource for:javasound://44100
Cannot open audio device for input:
javax.sound.sampled.LineUnavailableException: line with format
PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not
supported.
Cannot open audio device for input:
javax.sound.sampled.LineUnavailableException: line with format
PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not
supported.
java.io.IOException: line with format PCM_SIGNED 44100.0 Hz, 16 bit,
stereo, 4 bytes/frame, little-endian not supported.
08.07.2008 10:17:29 net.java.sip.communicator.util.Logger error
SCHWERWIEGEND: Could not create data source for javasound://44100
javax.media.NoDataSourceException: Error instantiating class:
com.sun.media.protocol.javasound.DataSource : java.io.IOException: line
with format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame,
little-endian not supported.
  at javax.media.Manager.createDataSource(Manager.java:1012)
  at
net.java.sip.communicator.impl.media.MediaControl.createDataSource(MediaControl.java:697)
  at
net.java.sip.communicator.impl.media.MediaControl.initCaptureDevices(MediaControl.java:373)
  at
net.java.sip.communicator.impl.media.MediaControl.initialize(MediaControl.java:213)
  at
net.java.sip.communicator.impl.media.MediaServiceImpl$DeviceConfigurationThread.run(MediaServiceImpl.java:395)
  at
net.java.sip.communicator.impl.media.MediaServiceImpl.start(MediaServiceImpl.java:224)
  at
net.java.sip.communicator.impl.media.MediaActivator.start(MediaActivator.java:60)
  at
org.apache.felix.framework.util.SecureAction$Actions.run(SecureAction.java:853)
  at java.security.AccessController.doPrivileged(Native Method)
  at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:580)
  at org.apache.felix.framework.Felix._startBundle(Felix.java:1536)
  at org.apache.felix.framework.Felix.startBundle(Felix.java:1470)
  at org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1065)
  at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:258)
  at java.lang.Thread.run(Thread.java:619)

As far as I remember, this also happened to me on the standard
(non-applet) version (but there I didn't know exactly when it happened).

Now the real problem is: SC starts, recognizes this error (as shown by
the logs above), but the normal user is not aware of this problem. The
whole gui is just as normal. The point when the user finds out about the
problem (indirect) is when he tries to place a call: The phone of the
callee rings, but as soon as he picks up the phone, SC will show
"failed", as the input device fails.

I think a better solution could be to inform the user already at startup
about the sound input device failure - and maybe even disable actions
where this sound input would be needed for.

Sebastian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Emil Ivov schrieb:

Hey Sebastian,

Could it be that your first applet is still hogging on the mike?

I just checked: the method javax.media.protocol.DataSource.stop() is
called while the applet is shutting down (without any exception). So I
think that the sound resource should normally be available again,
shouldn't it?

As I had the same problem on the non-applet version, I think it is a
general problem, maybe related to Linux (and JMF).

But anyway whether it is specifically related to the applet or not, I
think that the user should be informed that his sound input device is
currently not working, and not just recognize it while he tries to place
a call (where this information is a bit late).

Sebastian

···

Sebastian Heib написа:

Hi,

I have created a special applet version of SC. Everything works quiet
well, until I try to run the applet a second time in the browser:
I open the applet for the first time, and everything is OK. I navigate
to another website and then I open the applet again. In this second
case, SC always fails to open the audio input device:

08.07.2008 10:17:29 net.java.sip.communicator.util.Logger info
INFO: Creating datasource for:javasound://44100
Cannot open audio device for input:
javax.sound.sampled.LineUnavailableException: line with format
PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not
supported.
Cannot open audio device for input:
javax.sound.sampled.LineUnavailableException: line with format
PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not
supported.
java.io.IOException: line with format PCM_SIGNED 44100.0 Hz, 16 bit,
stereo, 4 bytes/frame, little-endian not supported.
08.07.2008 10:17:29 net.java.sip.communicator.util.Logger error
SCHWERWIEGEND: Could not create data source for javasound://44100
javax.media.NoDataSourceException: Error instantiating class:
com.sun.media.protocol.javasound.DataSource : java.io.IOException: line
with format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame,
little-endian not supported.
  at javax.media.Manager.createDataSource(Manager.java:1012)
  at
net.java.sip.communicator.impl.media.MediaControl.createDataSource(MediaControl.java:697)
  at
net.java.sip.communicator.impl.media.MediaControl.initCaptureDevices(MediaControl.java:373)
  at
net.java.sip.communicator.impl.media.MediaControl.initialize(MediaControl.java:213)
  at
net.java.sip.communicator.impl.media.MediaServiceImpl$DeviceConfigurationThread.run(MediaServiceImpl.java:395)
  at
net.java.sip.communicator.impl.media.MediaServiceImpl.start(MediaServiceImpl.java:224)
  at
net.java.sip.communicator.impl.media.MediaActivator.start(MediaActivator.java:60)
  at
org.apache.felix.framework.util.SecureAction$Actions.run(SecureAction.java:853)
  at java.security.AccessController.doPrivileged(Native Method)
  at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:580)
  at org.apache.felix.framework.Felix._startBundle(Felix.java:1536)
  at org.apache.felix.framework.Felix.startBundle(Felix.java:1470)
  at org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1065)
  at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:258)
  at java.lang.Thread.run(Thread.java:619)

As far as I remember, this also happened to me on the standard
(non-applet) version (but there I didn't know exactly when it happened).

Now the real problem is: SC starts, recognizes this error (as shown by
the logs above), but the normal user is not aware of this problem. The
whole gui is just as normal. The point when the user finds out about the
problem (indirect) is when he tries to place a call: The phone of the
callee rings, but as soon as he picks up the phone, SC will show
"failed", as the input device fails.

I think a better solution could be to inform the user already at startup
about the sound input device failure - and maybe even disable actions
where this sound input would be needed for.

Sebastian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

--
/**
* Sebastian Heib
* Software Developer
*
* Synyx GmbH & Co. KG
* Business in Components
* Karlstr. 68
* 76137 Karlsruhe
*
* phone +49(0)721 66 24 866
* fax +49(0)721 66 48 877
* eMail heib@synyx.de
* www http://www.synyx.de
* irc irc.synyx.de
*
* Sitz der Gesellschaft: Karlsruhe
* Registergericht: Mannheim
* Handelsregisternummer: HRA 4793
* USt-IdNr.: DE249264296
*
* Komplementärin: Elatech Verwaltungs GmbH
* Sitz der Gesellschaft: Karlsruhe
* Geschäftsführer: Markus Daniel
* Registergericht: Mannheim
* Handelsregisternummer: HRB 7250
*/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#5

Could it be that your first applet is still hogging on the mike?

Seems like like the "Java Sound Event Dispatcher" thread is still
running, although the applet is stopped. I think that's the reason why
it fails to open the sound input device when it starts for the second time.

Is there a way to stop this thread? Just calling System.exit(0) is no
option in the applet, as it kills your browser as well...

Sebastian

···

--
/**
* Sebastian Heib
* Software Developer
*
* Synyx GmbH & Co. KG
* Business in Components
* Karlstr. 68
* 76137 Karlsruhe
*
* phone +49(0)721 66 24 866
* fax +49(0)721 66 48 877
* eMail heib@synyx.de
* www http://www.synyx.de
* irc irc.synyx.de
*
* Sitz der Gesellschaft: Karlsruhe
* Registergericht: Mannheim
* Handelsregisternummer: HRA 4793
* USt-IdNr.: DE249264296
*
* Komplementärin: Elatech Verwaltungs GmbH
* Sitz der Gesellschaft: Karlsruhe
* Geschäftsführer: Markus Daniel
* Registergericht: Mannheim
* Handelsregisternummer: HRB 7250
*/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#6

Hey Sebastian,

Just remembered that this is actually a known bug for javasound. If
Ken's suggestion doesn't work then you may want to have a look here:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4735740

They propose a number of workarounds and some of them might fit your needs.

Cheers
Emil

Sebastian Heib написа:

···

Could it be that your first applet is still hogging on the mike?

Seems like like the "Java Sound Event Dispatcher" thread is still
running, although the applet is stopped. I think that's the reason why
it fails to open the sound input device when it starts for the second time.

Is there a way to stop this thread? Just calling System.exit(0) is no
option in the applet, as it kills your browser as well...

Sebastian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net