Why can't Flash play nice with aRts like everything else?
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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?
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.
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.
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.
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?
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
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.
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?
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.