Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » My Windows->Linux Switch

Credits go to BAF, CGamesPlay, Evert, Goalie Ca, HoHo, Kitty Cat, Michael Faerber, miran, Peter Wang, Simon Parzer, and Thomas Fjellstrom for helping out!
This thread is locked; no one can reply to it. rss feed Print
My Windows->Linux Switch
Kitty Cat
Member #2,815
October 2002
avatar

Quote:

So I can't have XMMS running when I start FireFox, for example?

It depends on your sound card. If you only have one hardware voice, you'll want programs to use ALSA with the 'dmix' device (this will give you software mixing and allow multiple programs to share the sound card). If you have multiple hardware voices, just switching as many thing s to use ALSA as possible would be your best bet.

To properly kill aRTs, open Control Center, and go to Sound & Multimedia->Sound System, and click to disable the sound system. This will effectively stop KDE itself (eg. notifications, KDE apps that use notifications, etc) from making any sound.

Another option might be to just turn down the auto-suspend idle time (which will cause aRTs to release the sound card after a period of inactivity).

Quote:

Why would anyone want to run arts in the first place?

Because KDE doesn't really like using anything else. :P Although you could tell it to use an external app, you'd need to find one that can play an array of multiple formats (from .wav, to .ogg, to .flac, etc), is fast, and can be invoked multiple times at once.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

kentl
Member #2,905
November 2002

Quote:

It depends on your sound card. If you only have one hardware voice, you'll want programs to use ALSA with the 'dmix' device (this will give you software mixing and allow multiple programs to share the sound card). If you have multiple hardware voices, just switching as many thing s to use ALSA as possible would be your best bet.

It sounds a bit hard to. I need to switch each individual program to "use ALSA with the 'dmix' device"? There isn't any global setting? Any tip on how to do this for XMMS, mplayer and FireFox? Will I also need to do this for "the system" so that the KDE notifications also work this way?

Quote:

To properly kill aRTs, open Control Center, and go to Sound & Multimedia->Sound System, and click to disable the sound system. This will effectively stop KDE itself (eg. notifications, KDE apps that use notifications, etc) from making any sound.

Well I like the notifications I use today and wish to keep them. It sounds like uninstalling aRTs would seriously screw up my system. (To me who don't know much.)

Quote:

Another option might be to just turn down the auto-suspend idle time (which will cause aRTs to release the sound card after a period of inactivity).

Is this a real solution? What if I play an mp3 using XMMS and KDE wants to sound a notification at the same time?

Peter Wang
Member #23
April 2000

Apparently for ALSA 1.0.9rc2 and higher you don't need to setup dmix. Assuming that's right, you can make XMMS use ALSA from the preferences (output plugin). mplayer might choose ALSA automatically, but you can force it by putting this in ~/.mplayer/config:

ao=alsa

And Firefox has sound? I guess you mean flash.

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

I need to switch each individual program to "use ALSA with the 'dmix' device"? There isn't any global setting?

Well.. theoretically, you could create a ~/.asoundrc file to map the default device to dmix automatically, then you can just switch the programs to use ALSA, and it should Just Work(tm). This page should help (ignore the part about setting applications to use the sound server/aRTs if you have it; aRTs isn't something you really want to use if you can help it).

Quote:

Any tip on how to do this for XMMS, mplayer and FireFox? Will I also need to do this for "the system" so that the KDE notifications also work this way?

For XMMS, it should have an ALSA output plugin. Been a while since I used XMMS though, so I'm not sure of the exact process. For mplayer, edit/create ~/.mplayer/config and put in the line:
ao=alsa:device=dmix (if you have an older version of mplayer, you may need to use 'alsa1x' instead of 'alsa')
For FireFox, I'm not so sure. I don't believe it itself will try to access the card, but its plugins may. If you're still having trouble with Flash at this point, try starting FireFox with the aoss script (eg. 'aoss firefox').

You'll need to tell aRTs to use ALSA too, yes. The option for that is in the Sound System setup (Control Center->Sound & Multimedia), in the Hardware tab. Select 'Advanced Linux Sound Architecture' as the audio device, and Override device location with 'dmix'.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

kentl
Member #2,905
November 2002

First of all, I really appreciate all the help guys! ;D

I would guess that my sound card ( ALC850 ) has hardware mixing. It says on the specification page that it has "flexible mixing" anyway. :) This means that I don't need to / shouldn't specify the dmix device?

Kubuntu comes with an open source-driver for my sound. RealTek provides proprietary sound drivers for my card in Linux. Perhaps I should switch to using their driver? Is it hard to change from the default driver to theirs?

What I have at the moment:

  • XMMS was already set to use the ALSA output plugin. I saw it by checking its preferences. Is there a way to be 100% that it's the sound system it actually uses? (I'm paranoid.)

  • I have told aRTs to use ALSA. Accrording to your instructions in your post! :)

  • When I start XMMS (no FireFox running) and play an mp3, then start FireFox and go to this game I get no sound in the Flash-game.

  • When I start FireFox (no XMMS running) and go to the game I get sound. When I then start XMMS and try to play an mp3 I get a dialog saying: "Please check that: Your sound card is properly configured. You have the correct output plugin selected. No other program is blocking the sound card.".

Kitty Cat
Member #2,815
October 2002
avatar

What if you start XMMS to play an MP3, and try to play a sound through KDE? The sound system setup has a button to test digital audio. If that works, then try starting FireFox with the aoss script and see if that fixes it.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

kentl
Member #2,905
November 2002

It works great now! I made FireFox use alsa by installing the alsa-oss and setting FIREFOX_DSP="aoss" in /etc/firefox/firefoxrc. You've really helped me! Big thanks! ;D

I'm sure I'll run into another problem pretty soon though. :-) So far it's going pretty smooth and I'm really liking KDE. I'm documenting everything using Zim (which I recommend you trying, it's not magical but nice) so that I have a structured installation documentation.

Also. What do you all think about using the proprietary sound drivers which RealTek provides for Linux here. Is it possible that I would get better sound output using their driver? Is it hard to change from the default driver to theirs without messing everything up? (I'm on my third install, hopefully my last for a while. ;) )

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

Also. What do you all think about using the proprietary sound drivers which RealTek provides for Linux here [realtek.com.tw]. Is it possible that I would get better sound output using their driver?

I looked at alsaa-project.org's driver list and didn't see Realtek or your card in it, so it seems like you wouldn't have much choice. Though if your sound's working, you may want to rethink playing around with it, for now. It could help with your OSS sound issue, or it might make things worse if they conflict with anything.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

kentl
Member #2,905
November 2002

My sound works at the moment. However I'm not 100% happy with the sound quality, especially when I play loud sounds. It might be as simple as configuring ALSA mixer (I think it's called that anyway. :)) though.

If it was simple to try I would do it. But if I risk messing up the system and having possibly another re-installed then it doesn't feel that important anymore. :)

Kitty Cat
Member #2,815
October 2002
avatar

If sounds distort when they're full volume, even if your speakers are quiet, then run alsamixer and play with the Master and PCM volume settings. If you have powered speakers, turn them up to compensate, and use them to adjust the volume afterwards, instead of the hardware mixer (and make sure programs are configured to use software volume control when possible). If they're not powered, then you'll just have to find a comfort zone between possible distortion, and being able to hear it.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

BAF
Member #2,981
December 2002
avatar

This is one of my main gripes with linux... it's sound system sucks. Requires too much hacking to get working :P

It should be more like windows, something provides universal sound stuff and all the apps use it. Not all this chose the right mixer and (try to) configure everything to use it. :P

CGamesPlay
Member #2,559
July 2002
avatar

Yeah, that is true. Fortunately, everything is moving towards that, although due to API incompatibility it still doesn't quite work that way.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

BAF
Member #2,981
December 2002
avatar

This is why you need a good API/Architecture at the start, that way later on you don't have to deal with crap like that. :P

CGamesPlay
Member #2,559
July 2002
avatar

A case where the Cathedral method wins...

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

kentl
Member #2,905
November 2002

My current mission is to disable / uninstall the IPV6 module, as the network I'm on uses V4. I'm not there yet, but I've asked for help on the Ubuntu forums. There are already a lot of threads on the forum dealing with this, but the suggestions given are often different and users report locked up systems etc after following advice. So I am tryĆ­ng to sort of which method to use.

Next things on my to do list (at the moment) are:

  • Check if I should use the properiatey driver for my sound card. And if so, how.

  • Make .torrent-files open in KTorrent when I click on them in FireFox.

  • Install Thunderbird and restore all my previous mail. (easy)

  • I'm using mplayer with its FireFox plugin. It works for almost all files except certain WMV-files, check if that is solvable. I have installed the windows codecs using this advice, some WMV-files do work. It's also annoying that when I've played a file using the mplayer plugin the tab isn't "normal" efter finishing playing the video clip. Which makes All-in-one-gestures not work so I can't close the tab using mouse gestures.

Simon Parzer
Member #3,330
March 2003
avatar

As for the Linux audio quality thing, just start up alsamixer (console: "alsamixer") and set all the volumes to 71. Anything above 71 will distort the sound (except for the global volume control).

BAF
Member #2,981
December 2002
avatar

Quote:

My current mission is to disable / uninstall the IPV6 module, as the network I'm on uses V4.

Recompile the kernel. It's not anything big to worry about... it doesn't really affect anything.

Evert
Member #794
November 2000
avatar

Unless something is really bothering you, I would leave it enabled or installed.
While you can tailor Linux specifically for your hardware (making it load very fast and possibly use less resources), that also makes it unflexible, which means that plugging in new hardware won't work as it otherwise would.
This can become annoying, for instance, when you replace hardware or upgrade your computer (I tend to keep my old harddisk and OS installation on the new machine personally).

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

However I'm not 100% happy with the sound quality, especially when I play loud sounds.

If your sound is anything like mine, you actually have two sound devices, one plain old CRAPPY 2.0 (stereo) codec, and one fancy new awesome surround codec, and its the surround one that sounds the best, I have to make sure that everything is using the surround device, especially since it supports multiple stereo hardware voices (yay for hardware mixing \o/).

So make sure you chcek.

Oh, and to explain what I mean by "crappy", the 2.0 codec distorts and sounds really really bad, even at low volume. Its completely unusable, and what you'd expect from onboard sound.

Quote:

As for the Linux audio quality thing, just start up alsamixer (console: "alsamixer") and set all the volumes to 71. Anything above 71 will distort the sound (except for the global volume control).

I'd just use kmix ;) and I find 80% or 85% is a good number. I think it depends on your card/chip though. If I put my stereo codec above 50% is sounds even worse >:(

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

kentl
Member #2,905
November 2002

Quote:

Unless something is really bothering you, I would leave it enabled or installed.
While you can tailor Linux specifically for your hardware (making it load very fast and possibly use less resources), that also makes it unflexible, which means that plugging in new hardware won't work as it otherwise would.

What I have heard is: Applications try to connect using IPV6 first when it's installed, then IPV4. This makes a new connection a bit slower. And it's the reason I would like to get rid of it.

Quote:

Recompile the kernel. It's not anything big to worry about... it doesn't really affect anything.

I'll do it ASAP then! :) As it's a module, do I need to recompile the kernel?

Quote:

If your sound is anything like mine, you actually have two sound devices, one plain old CRAPPY 2.0 (stereo) codec, and one fancy new awesome surround codec, and its the surround one that sounds the best, I have to make sure that everything is using the surround device, especially since it supports multiple stereo hardware voices (yay for hardware mixing \o/).

Good to know! I'll check it out. Reading up a lot on ALSA will give me the relevant knowledge I guess?

Quote:

As for the Linux audio quality thing, just start up alsamixer (console: "alsamixer") and set all the volumes to 71. Anything above 71 will distort the sound (except for the global volume control).

Quote:

I'd just use kmix ;) and I find 80% or 85% is a good number. I think it depends on your card/chip though. If I put my stereo codec above 50% is sounds even worse >:(

It sounds much better since I set them to 71. I'll keep fiddling with them when I get some free time and also check out that other codec Thomas is mentioning. (And also check out the proprietary driver for my sound card.)

Side project
Is there a way to map a path like /haha/boho/mysite to an FTP-directory? This would be nice and make it easier for me to work with Bluefish / SciTE on my new web page design "live" (it's in a secret path though ;) ). (I use KDE if it's of importance.)

Specter Phoenix
Member #1,425
July 2001
avatar

I just have my new laptop with Windows XP (where I do most of my work) and my desktop is Debian Linux where I do most of nothing on lately due to college.

relpatseht
Member #5,034
September 2004
avatar

If IPv6 is a module, just have it not load at boot, which it probably isn't doing already.

To answer the side project question:
ln -sf /haha/boho/mysite /ftp/directory

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

As it's a module, do I need to recompile the kernel?

if its just a module, just don't load it ;) then you dont have ipv6 support :D but yeah, just disable it, make, and make modules_install, and you have no more ipv6 support.

Quote:

Is there a way to map a path like /haha/boho/mysite to an FTP-directory?

You can install an ftp server and just have it export that dir, or if you already have an ftp server you want to use, and just want to make that path mirror it, there is a file system driver for ftp, but I've never used it. Also, all KDE applications support the ftp:// proto. so any kde editor can open documents on an ftp server.

Quote:

Reading up a lot on ALSA will give me the relevant knowledge I guess?

Maybe a little, the first thing to check is if you have more than one /proc/asound/card0/pcm*p directory.

Check this out:

moose@natasha ~ $ ls /proc/asound/card0/pcm*p
/proc/asound/card0/pcm0p:
info  oss  sub0  sub1  sub2  sub3

/proc/asound/card0/pcm1p:
info  oss  sub0

pcm0p on my card is the surround codec, which sounds very nice, especially since its an integrated sound chip, and pcm1p is the crappy stereo codec that I never use.

The number of subN files in the pcmNp folders is the number of individual hardware stereo devices you can use. And to use one in an app, youd use a device name something like: plughw:0,0,0 (first digit is the card number, if you have only one card, like most normal people, its always 0, second digit is the pcm number, here I have 0, and 1, I only use 0 though, and the third is the subN device, if you don't supply a digit for this one, alsa should just use any available subN device, but I usually make artsd use sub3 all the time, and leave the rest for other things.)

Note that I have a via82xx based sound system, these devices support something called "VIA DXS", which lets the surround codec be used as multiple separate stereo devices. I'm not sure if other sound board support the same sort of thing.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

kentl
Member #2,905
November 2002

Quote:

I just have my new laptop with Windows XP (where I do most of my work) and my desktop is Debian Linux where I do most of nothing on lately due to college.

What's your point? :) (I guess you wrote in the wrong thread.)

Quote:

If IPv6 is a module, just have it not load at boot, which it probably isn't doing already.

Well it seems like it is: (I've been told that it is indeed activated by default in (K)Ubuntu 6.06 (Dapper)

kent@kent-desktop:~$ lsmod | grep ipv6
ipv6                  265728  6

kent@kent-desktop:~$ ip a | grep inet6
    inet6 ::1/128 scope host
    inet6 fe80::250:8dff:fed9:b88/64 scope link

Now I just need to find out how to disable a module from loading in the best way. I've heard of editing /etc/modprobe.d/aliases but also that the changes made can be undone if you upgrade. Adding a bad_list was one suggestion in a thread, I tried it without any success though.
[append]

Quote:

if its just a module, just don't load it ;) then you dont have ipv6 support :D but yeah, just disable it, make, and make modules_install, and you have no more ipv6 support.

Gosh! make.. It sounds like I need to recompile then, eh?

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

Gosh! make.. It sounds like I need to recompile then, eh?

one easy way is to do something like this:

# ifdown eth0
# rmmod ipv6
# ifup eth0
# rm /path/to/modules/ipv6.ko

where ifup and ifdown are your distro's specific network interface scripts (mine is /etc/init.d/net.eth0 stop/start)

oh, I know a sure fire way to get it to disable loading automatically!
First, find your modules alias file (mine happens to be /etc/modules.d/aliases)
make an entry like: alias ipv6 off, update your modules (on gentoo update-modules), and restart (or go the long way and kill your interface, unload the module, and restart the interface).

edit: I really need to not skip parts of posts, I just found this in yours:

Quote:

I've heard of editing /etc/modprobe.d/aliases but also that the changes made can be undone if you upgrade.

Tee hee.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730



Go to: