No microphone input in flash apps.

OSS specific Linux discussion (x86/amd64)

Moderators: cesium, dev, kodachi, hannu

No microphone input in flash apps.

Postby fly-away » Sun Feb 20, 2011 1:09 pm

Archlinux, kernel 2.6.32, OSS 4.2, flashplugin-prerelease 10.2.161.23-3

http://vyew.com/s/browsertest/ - test application
Level meter in 'mic' tab of flash configuration applet shows me nothing
ossrecord - | ossplay - works great, sound output in flash nice too.
Last edited by fly-away on Sun Feb 20, 2011 10:30 pm, edited 1 time in total.
fly-away
New Member
 
Posts: 6
Joined: Sun Feb 20, 2011 1:05 pm

Re: No microphone input in flash apps.

Postby igorzwx » Sun Feb 20, 2011 1:29 pm

fly-away wrote:Archlinux, kernel 2.6.32, OSS 4.2, flashplugin-prerelease 10.2.161.23-3

http://vyew.com/s/browsertest/ - test application
Level meter in 'mic' tab of flash configuration applet show me nothing
ossrecord - | ossplay - work great, sound output in flash nice too.


You may try something like this:
viewtopic.php?f=3&t=3981
igorzwx
Known Member
 
Posts: 1001
Joined: Sun Jun 28, 2009 9:31 pm

Re: No microphone input in flash apps.

Postby fly-away » Sun Feb 20, 2011 1:48 pm

igorzwx wrote:
fly-away wrote:Archlinux, kernel 2.6.32, OSS 4.2, flashplugin-prerelease 10.2.161.23-3

http://vyew.com/s/browsertest/ - test application
Level meter in 'mic' tab of flash configuration applet show me nothing
ossrecord - | ossplay - work great, sound output in flash nice too.


You may try something like this:
viewtopic.php?f=3&t=3981


Try exactly what?
OSS works great for all applications exclude adobe flash (just in, out ok) so may be I dont need this cosmic tools at all.
Last edited by fly-away on Sun Feb 20, 2011 10:30 pm, edited 1 time in total.
fly-away
New Member
 
Posts: 6
Joined: Sun Feb 20, 2011 1:05 pm

Re: No microphone input in flash apps.

Postby igorzwx » Sun Feb 20, 2011 2:18 pm

Some apps do not work with OSS4.
see also: viewtopic.php?f=3&t=4201
igorzwx
Known Member
 
Posts: 1001
Joined: Sun Jun 28, 2009 9:31 pm

Re: No microphone input in flash apps.

Postby cesium » Sun Feb 20, 2011 3:31 pm

Flash uses libflashsupport wrapper for OSS, but macromedia/adobe never included any ability to wrap the input functions, and since it's closed source, it's difficult to add.... There might be ways to bypass that, but they're messy. A flash open-source alternative might work here better...
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: No microphone input in flash apps.

Postby fly-away » Sun Feb 20, 2011 4:59 pm

Ok, may be I can get it works via alsa emulation

Now I put this to my ~/.asoundrc

Code: Select all
pcm.!default
{
   type oss
   device /dev/dsp
}
mixer.!default
{
   type oss
   device /dev/dsp
}


aplay works good, but arecord -f cd -d 5 -t wav -N - | ossplay - gives me nothing

Is it something wrong with input emulation in alsa?
Also, is libsalsa works at all? I cant play something via it in any app.
Last edited by fly-away on Sun Feb 20, 2011 10:33 pm, edited 1 time in total.
fly-away
New Member
 
Posts: 6
Joined: Sun Feb 20, 2011 1:05 pm

Re: No microphone input in flash apps.

Postby cesium » Sun Feb 20, 2011 6:10 pm

ALSA's oss plugin has a bug in input handling.

Try this patch to alsa-plugins:

Code: Select all
--- pcm_oss.c   2010-04-16 14:11:10.000000000 +0300
+++ pcm_oss.c   2011-02-20 20:07:15.768440182 +0200
@@ -90,9 +90,12 @@
static int oss_start(snd_pcm_ioplug_t *io)
{
   snd_pcm_oss_t *oss = io->private_data;
-   int tmp = io->stream == SND_PCM_STREAM_PLAYBACK ?
-      PCM_ENABLE_OUTPUT : PCM_ENABLE_INPUT;
+   int tmp;

+   tmp = 0;
+   ioctl(oss->fd, SNDCTL_DSP_SETTRIGGER, &tmp);
+   tmp = io->stream == SND_PCM_STREAM_PLAYBACK ?
+      PCM_ENABLE_OUTPUT : PCM_ENABLE_INPUT;
   if (ioctl(oss->fd, SNDCTL_DSP_SETTRIGGER, &tmp) < 0) {
      fprintf(stderr, "*** OSS: trigger failed\n");
      if (io->stream == SND_PCM_STREAM_CAPTURE)


As for libsalsa, perhaps you didn't set LD_PRELOAD right and apps pick up the original libasound2.so (you need to rename it, and then LD_PRELOAD with full path, and maybe some permissions?). Anyhow, it's far from complete.
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: No microphone input in flash apps.

Postby fly-away » Sun Feb 20, 2011 10:19 pm

cesium wrote:ALSA's oss plugin has a bug in input handling.

Try this patch to alsa-plugins:


Thanks a lot. This patch works just amazing! =)
Now I have sound recording in flash.

BTW, arecord gives me sound for first 2 seconds and then
Code: Select all
$ arecord -f cd -d 5 -t wav  -N - | aplay
Recording WAVE '-' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
arecord: pcm_read:1692: read error: Operation not permitted
$

Anyway arecord is not important for me.

I hope this fix will be included in the next alsa release, else maybe I should send it to Arch alsa-plugins maintainer.

cesium wrote:As for libsalsa, perhaps you didn't set LD_PRELOAD right and apps pick up the original libasound2.so (you need to rename it, and then LD_PRELOAD with full path, and maybe some permissions?). Anyhow, it's far from complete.


In Arch libsalsa makes link for libasound2.so to themself, so I guess it is not the case.
fly-away
New Member
 
Posts: 6
Joined: Sun Feb 20, 2011 1:05 pm

Re: No microphone input in flash apps.

Postby igorzwx » Mon Mar 14, 2011 10:17 pm

Many thanks!!!

I have already applied the magic patch and recompiled alsa-plugins.

WARNING: In Arch Linux, alsa-plugins are already infected with PulseAudio.

In short, PulseAudio was removed, alsa-plugins were patched and recompiled, ALSA emulation was enabled.

Now microphone works with Flash. The test was successful
http://vyew.com/s/browsertest/

However, this failed to fix GMail Voice Chat with google-talkplugin.
ERROR: "We couldn't detect a proper audio setup. Please ensure your speakers are working and try again."

google-talkplugin seems to be "closed source". It is likely to have PulseAudio inside, or a sort of things.

WORKAROUND:

Code: Select all
$ yaourt yate-svn
1 aur/yate-svn 2872-1 [installed: 4171-1] (Out of Date) (3)
    next-generation telephony engine
==> Enter n° of packages to be installed (ex: 1 2 3 or 1-3)
==> -------------------------------------------------------
==>


Yate is "open source" and "cross-platform"
http://yateclient.yate.ro/index.php/Use ... CallGVoice
http://yate.null.ro/pmwiki/

Step 1: Register Yate with your GMail account.

Step 2: Register Yate with several SIP providers.

Step 3: Call your friends.

"Voice, video, data and instant messanging can all be unified under Yate's flexible routing engine".
"video" is not yet implemented, but "voice" and "chat" seems to work well.

You can easily run conferences, for example:
(n + 1) participants with GMail account + (k + 1) participants with SIP Phones.

Yate voice conferencing is well designed and easy to use.
1. you can add a new participant with a mouse click (during the conference).
2. you can remove a participant in a similar way (during the conference).

Such a conference can be easily encrypted with ZFone http://en.wikipedia.org/wiki/Zfone

Yate does not work with OSS4 without ALSA emulation, although it has a sort of "OSS support" inside:

alsachan - this module supports almost any ALSA driven sound card
osschan - this module supports almost any OSS driven sound card
http://yate.null.ro/pmwiki/index.php?n=Main.Features


I have already tested YateClient with ALSA. It is not usable, because of sound interruptions.
EDIT: It is a bug in Yate (module alsachan):

Code: Select all
$ yate-qt4.conf
<WARN> ALSA write underrun occurred
<WARN> ALSA write underrun occurred
<WARN> ALSA write underrun occurred


WORKAROUND:
1. remove ~/.asoundrc
2. Set Yate to "alsa/default"

Code: Select all
$ sudo gedit /etc/yate/yate-qt4.conf

[client]
device=alsa/default


Any other "device" (e.g. device=alsa/plughw:0,0 ) causes "underruns", i.e. sound interruptions.
Total CPU load is insignificant: 8% on a very old computer.

-------------------------
Yate works well with OSS4 and ALSA emulation on the same computer inside the same Arch Linux.

The sound quality of Yate voice conferences with OSS4 and ALSA emulation is comparable with that of Skype with OSS4. It is a normal quality. But it may work much better with pure OSS4.

EDIT: It turned out that Yate works with OSS4 (without ALSA emulation).

To make Yate Client work with OSS4, you have to configure it.
In Arch Linux, you should have /etc/yate/yate-qt4.conf :

Code: Select all
; This minimal file is here just to set the default skin.
; You can replace it with a more complete version from yate.conf.sample

[modules]
; This section should hold one line for each module whose loading behaviour
;  is to be changed from the default specified by modload= in section [general]
; Each line has to be of the form:
;   modulename.yate=boolean
; Note that modules can be located only in the module directory so no path
;  information should be specified
osschan.yate=yes
alsachan.yate=no

[localsym]
h323chan.yate=yes

[client]
;skin=default
;style=
device=oss//dev/dsp
;greeting=Yate ${version} - ${release}


In Arch Linux, configuration files for Yate Client/Server are located in /etc/yate/
For example: /etc/yate/yate-qt4.conf
igorzwx
Known Member
 
Posts: 1001
Joined: Sun Jun 28, 2009 9:31 pm


Return to Linux

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 1 guest

cron