LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 06-10-2004, 12:49 AM   #1
squirrels
LQ Newbie
 
Registered: Jun 2004
Location: Baltimore, MD USA
Distribution: Slackware 9.1 right now...
Posts: 15

Rep: Reputation: 0
Why can't Flash play nice with aRts like everything else?


I just installed Slackware 9.1 and have gotten ALSA up and running. I'm running the KDE desktop manager and I'm getting sound under multiple user IDs. Since configuring the aRts server to use ALSA I can play stuff from multiple programs at once and the aRts server seems to do a pretty good job of mixing it.

Except Flash.

When I try to load a Flash website while I've got XMMS or some other sound device playing in the background, the video works fine, but the sound does not. It waits on the device. Once I close everything and reload the Flash website, the sound plays fine. But it looks like the Flash plugin wants exclusive control of the sound device. I can get XMMS, Kaboodle, and the KBounce game all playing sound at the same time, but Flash just doesn't seem to want to play at the same time as any other sound.

This only occurs in Netscape and Mozilla. Konqueror appears to be compatible with aRts, but it causes the video and sound from the Flash to lag...badly. I tried turning aRts off and I can still play using ALSA directly, but if I try to play sound from more than one source, I either get a device busy window or no sound from the other task.

Any ideas? I've got an Nforce motherboard with on-board sound but I'm not using the nvaudio driver because it kept giving me trouble when it tried to load the kernel module. So I just used ALSA because it was loading up anyway.

Thanks
-Mark
 
Old 06-10-2004, 03:04 AM   #2
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
Well I know aRTs is dodgy to the max. You can try to use just plain ALSA with the dmix plugin. That mixes sound just fine. However it only does so reliably for ALSA-aware apps. I don't think mozilla or netscape (or even konqueror) are ALSA-aware.
 
Old 06-10-2004, 07:42 AM   #3
squirrels
LQ Newbie
 
Registered: Jun 2004
Location: Baltimore, MD USA
Distribution: Slackware 9.1 right now...
Posts: 15

Original Poster
Rep: Reputation: 0
Are there any browsers that ARE ALSA-aware?

It looks from that link you gave me like it will also mix sound for OSS if you "trick" it into using ALSA in place of the /dev/dsp0 OSS device. Where can I find that .asoundrc file? Is that in /etc somewhere?
 
Old 06-10-2004, 08:11 AM   #4
motub
Senior Member
 
Registered: Sep 2003
Location: The Netherlands
Distribution: Gentoo (main); SuSE 9.3 (fallback)
Posts: 1,607

Rep: Reputation: 46
Do you have OSS emulation enabled for ALSA? What kernel are you using (meaning, is ALSA part of the kernel as it would be if you're using a 2.6 series kernel, or did you install it yourself, as you must if you're using a 2.4 series kernel)?

ALSA OSS emulation works very well, so if you were using it, and Flash was looking for OSS, it should be working fine, so I suspect that you are not using OSS emulation.
 
Old 06-10-2004, 08:36 AM   #5
squirrels
LQ Newbie
 
Registered: Jun 2004
Location: Baltimore, MD USA
Distribution: Slackware 9.1 right now...
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by motub
Do you have OSS emulation enabled for ALSA? What kernel are you using (meaning, is ALSA part of the kernel as it would be if you're using a 2.6 series kernel, or did you install it yourself, as you must if you're using a 2.4 series kernel)?

ALSA OSS emulation works very well, so if you were using it, and Flash was looking for OSS, it should be working fine, so I suspect that you are not using OSS emulation.
2.4.22 kernel. ALSA is being loaded modularly. If I remember correctly, so is OSS emulation. I'll get back to you with an lsmod as soon as I get home.

When I'm in KDE I can set XMMS to use aRts, ALSA, or OSS and it will work any of the three ways, but it's playing two programs with sound at once that's the issue.
 
Old 06-10-2004, 08:58 AM   #6
shedir
Member
 
Registered: Mar 2004
Location: Dresden, Germany
Distribution: Gentoo
Posts: 31

Rep: Reputation: 15
Hi,

did you try artsdsp to fix your problem?

artsdsp <path to mozilla> should redirect the sound into arts.
 
Old 06-10-2004, 09:31 AM   #7
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
Quote:
Are there any browsers that ARE ALSA-aware?
None that I know of. There may be some extension to firefox.
Quote:
It looks from that link you gave me like it will also mix sound for OSS if you "trick" it into using ALSA in place of the /dev/dsp0 OSS device. Where can I find that .asoundrc file? Is that in /etc somewhere?
You can trick some simple apps. I've only ever managed to get mpg123 to play nice. To be honest haven't really tried, though, so you may have more luck than I do. The .asoundrc is in your home directory (you may have to create it) or you can edit the /etc/asound.conf file for the settings to be global.
 
Old 06-10-2004, 09:46 AM   #8
squirrels
LQ Newbie
 
Registered: Jun 2004
Location: Baltimore, MD USA
Distribution: Slackware 9.1 right now...
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by adz
You can trick some simple apps. I've only ever managed to get mpg123 to play nice. To be honest haven't really tried, though, so you may have more luck than I do. The .asoundrc is in your home directory (you may have to create it) or you can edit the /etc/asound.conf file for the settings to be global.
This is what's bugging me about Linux...the idea that one solution works for some apps and then one solution works for other apps, etc etc...I'm assuming there's not one solution that's been implemented that will allow all programs to share the sound device? I mean, that's not HORRIBLE, I don't run a lot of simultaneous sounds anyway, but it's going to be a pain if I'm on a Flash website and the system needs to play a sound for whatever reason, and I find that it's snatched the sound device from my browser and I need to reload the flash page...or I get one of those nifty "device busy" messages. I know that I can go into Windows and start up WinAmp, get sounds from a website with Flash, and be running an MPEG video and the sound from all 3 mixes flawlessly. There's got to be a way to do this in Linux.

Oh well, I'll give this a try, assuming I can figure out what's what.

Quote:
Originally posted by shedir
Hi,

did you try artsdsp to fix your problem?

artsdsp <path to mozilla> should redirect the sound into arts.
Are you talking about changing the "shortcut" so that it runs artsdsp /whatever/mozilla instead of running /whatever/mozilla? Like a wrapper of some kind?

Last edited by squirrels; 06-10-2004 at 09:51 AM.
 
Old 06-10-2004, 10:21 AM   #9
shedir
Member
 
Registered: Mar 2004
Location: Dresden, Germany
Distribution: Gentoo
Posts: 31

Rep: Reputation: 15
Quote:
Are you talking about changing the "shortcut" so that it runs artsdsp /whatever/mozilla instead of running /whatever/mozilla?
Yes, maybe its faster to try artsdsp /whatever/mozilla an the commandline first.
When I used mozilla together with oss and flash plugin the browser hanged because flash waited vor /dev/dsp to be unlocked - what of course never happens if arts uses /dev/dsp.
The suggested method solved this problem.
As I know there are lot's of people who complained about this bug at macromedia (and even posted bug-fixes) but they simply ignore it.
Now I use the flash-plugin with konqueror and "Use artsdsp to pipe sound through aRts" enabled together with alsa and without oss-emulation - it works.
If you experience a lag between video and audio, you could try to set arts to highest possible priority or change the the size of the soundbuffer

Last edited by shedir; 06-10-2004 at 10:23 AM.
 
Old 06-10-2004, 09:39 PM   #10
squirrels
LQ Newbie
 
Registered: Jun 2004
Location: Baltimore, MD USA
Distribution: Slackware 9.1 right now...
Posts: 15

Original Poster
Rep: Reputation: 0
Well the artsdsp mozilla worked...it looks like aRts is now mixing the Flash sound with output from other stuff, such as XMMS. I can even get Xine to play nice if I use artsdsp.

The problem is I'm getting a LOT of lag between the audio and video. I have "Run Soundserver with real time priority" checked and I monkeyed with the buffer size to no avail. I can get perfectly synched sound if I shut aRts off and just run the browser, but then no mixing.

Any other ideas to keep it from stuttering and lagging? I might try the dmix thing when I have more time...I've been spending too much time in front of the screen as-is, though.

BTW this is what I've got if I lsmod:

Module Size Used by Tainted: P
snd-seq 33584 0 (autoclean)
snd-pcm-oss 37252 1
snd-mixer-oss 11992 0 [snd-pcm-oss]
printer 7040 0 (unused)
usb-ohci 18888 0 (unused)
ehci-hcd 16872 0 (unused)
usbcore 58400 1 [printer usb-ohci ehci-hcd]
snd-intel8x0 17156 1
snd-pcm 55904 0 [snd-pcm-oss snd-intel8x0]
snd-timer 13252 0 [snd-seq snd-pcm]
snd-ac97-codec 37240 0 [snd-intel8x0]
snd-page-alloc 6004 0 [snd-intel8x0 snd-pcm]
snd-mpu401-uart 3136 0 [snd-intel8x0]
snd-rawmidi 12512 0 [snd-mpu401-uart]
snd-seq-device 3920 0 [snd-seq snd-rawmidi]
snd 27460 0 [snd-seq snd-pcm-oss snd-mixer-oss snd-intel8x
0 snd-pcm snd-timer snd-ac97-codec snd-mpu401-uart snd-rawmidi snd-seq-device]
soundcore 3332 4 [snd]
ohci1394 24200 0 (unused)
ieee1394 42436 0 [ohci1394]
nvnet 58368 1
ide-scsi 9424 0
agpgart 39576 0 (unused)
ntfs 51040 1 (autoclean)


snd-intel8x0 is the ALSA module for my soundcard, and I've got the OSS compatibility enabled too. I see the messages at boot.
 
Old 06-11-2004, 06:13 AM   #11
shedir
Member
 
Registered: Mar 2004
Location: Dresden, Germany
Distribution: Gentoo
Posts: 31

Rep: Reputation: 15
www.macromedia.com/support/flash/ts/documents/linux_player_readme.htm
[....]
Known Issues
[...]
Video and Audio get out of sync on long movies.

Maybe it's not due to arts but a bug of the plug-in - i don't know
 
Old 06-11-2004, 09:48 AM   #12
squirrels
LQ Newbie
 
Registered: Jun 2004
Location: Baltimore, MD USA
Distribution: Slackware 9.1 right now...
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by shedir
www.macromedia.com/support/flash/ts/documents/linux_player_readme.htm
[....]
Known Issues
[...]
Video and Audio get out of sync on long movies.

Maybe it's not due to arts but a bug of the plug-in - i don't know
You may be right on that one...even with aRts turned off and using ALSA directly, I still get out of sync. Not as bad, but it's still there. Do they plan on fixin' that?

I guess it's XP/2000 for Flash until they do.

Last edited by squirrels; 06-11-2004 at 09:50 AM.
 
Old 08-15-2004, 01:44 AM   #13
GuidoS
LQ Newbie
 
Registered: Aug 2004
Location: Mesa, Arizona
Distribution: Debian Sarge - custom 2.6.7
Posts: 14

Rep: Reputation: 0
Lightbulb Re: Why can't Flash play nice with aRts like everything else?

I had the same or a similar problem with Flash skipping in the beginning and then being out of sync. Being a hardcore fan of Homestarrunner I had to have my Flash running! Surely I don;t have to re-install XP for that?

So, after a few days I figured out..., well, stumbled over a solution that I thought might be helpful to share. Maybe it can help somebody just like when I found some good nuggets in seemingly unrelated forum replies.

First of all, I spent some days trying to make Flash work with aRTs to no avail. I'm just a four week newbie, but from what I can tell aRTs and Flash don't like each other. Arts will mix the sound fine, but Flash audio either lags or is choppy.
The skipping is, as far as I can tell, caused by artdsp loading for not just the browser session, but for each sound played. Even if you do the artsdsp /path/to/mozilla commandline trick. I found out about that by watching the Arts Audio Manager.
Maybe it would work better if one could configure arts to stay running for the browser session like it does for the KDE Systems Notification sounds.

The thing I tried last and what worked for me is that I avoided arts wherever possible, which is no easy feat in KDE. Anybody know how to disable arts? Apparently I can't just uninstall it, as kdecore depends on it.

If you have nothing open that is using arts, but you still got the arts demon (artsd) running, you need to stop it or kill it. For whatever reason Mozilla (not the flash plugin) favours arts over using alsa/oss. Or maybe KDE is making it do that. I wish that could be configured for Mozilla just like in Konqueror.

After you cleaned your session of arts, run your browser and see if the flash lag disappeared. Good luck! (you still got the sync problem for lengthy (> 3min) flash movies)

That's it.

Guido.


PS: I did not encounter the fight over the snd/dsp device between programs. "I was first!" "No, I was!" "Your're touching meee!"
I think, that is either because I have a sound card (TurleBeach Santa Cruz) which supports hardware mixing or it is mixed using the snd_mixer_oss module that I have running as part of the OSS emulation. I can play music using xmms, gaim sounds and even KDE Notifications by setting it to use an external player (I used aplay). I can't use juK anymore, but that one was skipping anyway so it's not too great a loss.

I also had a crash problem with Mozilla. I tried it in Konqueror (after disabling the "use artsdsp to pipe plugin sound through arts") which worked fine, but Mozilla would crash as soon as Flash tried to play audio. I then installed Firefox which doesn't crash.

BTW, Flash inside Firefox did also skip, when artsd sneaked back into the process table and I had to kill it again. I wish I could just disable artsd.


Hmm, okay, that was my first and very rambling post.
 
Old 10-17-2005, 10:11 AM   #14
jacktheripperis
LQ Newbie
 
Registered: Jul 2004
Location: italy
Distribution: SUSE10
Posts: 13

Rep: Reputation: 0
artsdsp mozilla

i've got the problem of not having sound with mozilla or firefox at all when palying swf files - so i got really happy when i read that you managed to do so with artsdsp (the solution i used for skype to be able to talk over the with telephones) - bu when i execute
Code:
artsdsp /usr/bin/mozilla
my linux box talks me back saying
Code:
artsdsp works only for binaries
- and he is right in that i am referring to a link to an .sh (/usr/bin/mozilla -> /opt/mozilla/bin/mozilla.sh*) - so how to i come around this...how did you?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu and Xorg don't play nice adamb10 Ubuntu 9 07-07-2005 12:25 AM
Sound in Flash with ARTS Forezt Linux - Software 0 05-30-2005 10:23 AM
aRts: KDE won't play sounds BedriddenTech Linux - Software 2 12-17-2004 06:01 PM
httpd and dhcp won't play nice Citizen Bleys Linux - Software 2 11-17-2003 07:44 AM
RedHat 8.0 is nice!BUT i can't play mp3 in it... Leonadia Linux - Software 3 10-12-2002 05:03 AM


All times are GMT -5. The time now is 09:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration