Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
TIP: Make ALSA work with Kernel 2.6
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
net_keeper
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jul 2003
Posts: 108
Location: Earth

PostPosted: Sun Jul 20, 2003 8:15 am    Post subject: TIP: Make ALSA work with Kernel 2.6 Reply with quote

Well,
Ie got a lot of problems with ALSA and Kernel 2.6 .

I've acieved a solution,

Compile the sound card not as modul , but as BUILT-IN.

No more problems, no more dealing with sound, no more /dev/dsp disapper or invisible devices.. :D
Back to top
View user's profile Send private message
floam
Veteran
Veteran


Joined: 27 Oct 2002
Posts: 1067
Location: Vancouver, WA USA

PostPosted: Mon Jul 21, 2003 5:26 am    Post subject: Reply with quote

Alsa will make your kernel pretty big, and despite what the poster said, you can still compile it as a moudle. The alsasound init script probably won't work, but its not a biggie, just add the modules to your /etc/modules.autoload.d/kernel-2.[56]. Also add alsactl store to local.stop and alsactl restore to your local.start so that your volume settings get saved over a reboot.

Here's the sound part of my /etc/modules.autoload.d/kernel-2.[56] for reference:
Code:
snd-emu10k1
snd-pcm-oss

snd-emu10k1 is for my card, snd-pcm-oss turns on the oss compatability layer.
Note while I only have those two modules in my moudles.autoload file, they will load other modules, shown here in the relevant part of my lsmod ouput:
Code:
Module                  Size  Used by
snd_pcm_oss            48548  0
snd_mixer_oss          16768  1 snd_pcm_oss
snd_emu10k1            63364  0
snd_rawmidi            20256  1 snd_emu10k1
snd_pcm                86244  2 snd_pcm_oss,snd_emu10k1
snd_timer              21700  1 snd_pcm
snd_seq_device          6536  2 snd_emu10k1,snd_rawmidi
snd_ac97_codec         48132  1 snd_emu10k1
snd_page_alloc          7876  2 snd_emu10k1,snd_pcm
snd_util_mem            3328  1 snd_emu10k1
snd_hwdep               6816  1 snd_emu10k1
snd                    44708  10 snd_pcm_oss,snd_mixer_oss,snd_emu10k1,snd_rawmidi,snd_pcm,snd_timer,snd_seq_device,snd_ac97_codec,snd_util_mem,snd_hwdep
soundcore               7168  1 snd
Back to top
View user's profile Send private message
Ant
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2002
Posts: 129
Location: Australia

PostPosted: Wed Jul 23, 2003 10:05 pm    Post subject: Reply with quote

Here is my version of the alsavolume script for use with kernel 2.6 instead of alsasound. Basically it is just a cut down version of alsasound.

I added it to my default runlevel. This seemed a good place for it based on my fairly limited runlevel knowledge. If someone thinks it should go into a different runlevel let me know.

Code:

#!/sbin/runscript
# $Header:  $
#
# Gentoo users: add this script to 'default' run level.
# ==================================================
#
# alsavolume     This shell script takes care of restoring and storing
#                the ALSA mixer sound settings.
#
# This script requires the /usr/sbin/alsactl program from the alsa-utils package.
#
# Paraphrased by Anthony Higgins from the alsasound init.d script
# Copyright (c) by Jaroslav Kysela <perex@suse.cz>
#
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA


alsactl=/usr/sbin/alsactl
asoundcfg=/etc/asound.state

depend() {
  need bootmisc localmount
  after modules
}

start() {
  # Restore sound.
  if [ -d /proc/asound ]; then
    if [ ! -r $asoundcfg ]; then
      ewarn "No mixer config in $asoundcfg, you have to unmute your card manual!"
    else
      if [ -x $alsactl ]; then
         num_cards=`modprobe -c|awk -F= '/options snd cards_limit/ {print $2;}'`
   if [ "$num_cards" == "" ]; then
          $alsactl -f $asoundcfg restore
        else
          let num_cards--
          for i in `seq 0 $num_cards`; do
            $alsactl -f $asoundcfg restore $i
          done
        fi
      else
        eerror -e "ERROR: alsactl not found!"
      fi
    fi
  fi
}

stop() {
  if [ ! -d /proc/asound ]
  then
    eerror "ALSA driver is not loaded."
    return 0
  fi

  #
  # store driver settings
  #
  if [ -x $alsactl ]; then
    $alsactl -f $asoundcfg store
  else
    ewarn -n "WARNING: !!!alsactl not found!!! "
  fi
}



Regards,

Ant.
Back to top
View user's profile Send private message
Opteron
n00b
n00b


Joined: 09 Mar 2003
Posts: 54
Location: Sweden, Husqvarna

PostPosted: Thu Jul 24, 2003 12:27 pm    Post subject: Reply with quote

Hmm after I had compiled my kernel (2.6.0_test1) and did emerge alsa-drivers it complains about something, I guess that The alsa that comes with 2.6.0_test1 is newer than the one in portage?
_________________
Make and Pray baby!
Back to top
View user's profile Send private message
Ant
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2002
Posts: 129
Location: Australia

PostPosted: Thu Jul 24, 2003 3:01 pm    Post subject: Reply with quote

Yes. In ye old days, alsa had to install it's own kernel modules (drivers) since it was a separate package to the kernel. Now alsa is merged in with the kernel so you will no longer need the alsa-drivers.

Woot!! I've been waiting for years.

If it really wants to install alsa-drivers because of a dependancy you could fake it with the.. hmmm.. I think it's emerge -i alsa-drivers?? Check man emerge as I'm on a debian machine at the moment.

Ant.
Back to top
View user's profile Send private message
Squinky86
Retired Dev
Retired Dev


Joined: 25 Mar 2003
Posts: 309
Location: Alabama, USA

PostPosted: Thu Jul 24, 2003 6:34 pm    Post subject: Reply with quote

Ant wrote:
If it really wants to install alsa-drivers because of a dependancy you could fake it with the.. hmmm.. I think it's emerge -i alsa-drivers??

Code:

emerge --inject media-sound/alsa-driver-0.9.5-r2

replace the version of the alsa-driver if you want to fake a different version
_________________
Me
Back to top
View user's profile Send private message
Vache
n00b
n00b


Joined: 17 Oct 2002
Posts: 45
Location: Springboro, Ohio

PostPosted: Sun Jul 27, 2003 7:37 pm    Post subject: XMMS Reply with quote

Two issues using kernel 2.6.0 + XMMS + ALSA (compiled in). alsa-xmms's ebuild needs alsa-driver (can I just inject?), and when I am using XMMS + ALSA for output, none of my visual plugins for XMMS react to the music, nor does the EQ work Any ideas?
_________________
Fool me once, shame on you. Fool me twice... you can't fool me again
Back to top
View user's profile Send private message
SonetSST
n00b
n00b


Joined: 17 Jan 2003
Posts: 46

PostPosted: Mon Jul 28, 2003 6:36 am    Post subject: ALSA Reply with quote

dunno whats up with you guys... I've always wanted to be able to build alsa into the kernel instead of as a module. I did that, and it works great... Though i still have alsa-driver installed for my 2.4 series kernel... anyway, why use the ebuild when it's right there in the kernel?
Back to top
View user's profile Send private message
b0fh
Guru
Guru


Joined: 16 Jun 2003
Posts: 426

PostPosted: Mon Jul 28, 2003 8:37 am    Post subject: Reply with quote

I've got also for my card in the kernel, but when I start xmms for example and try to play, I get no sound and the app hangs... Any ideas?
Back to top
View user's profile Send private message
Yinchie
Apprentice
Apprentice


Joined: 05 Mar 2003
Posts: 179
Location: The Netherlands

PostPosted: Tue Jul 29, 2003 5:19 am    Post subject: Reply with quote

- inccorrect soundcard module?
- you forgot to unmute alsa?
Back to top
View user's profile Send private message
bsolar
Bodhisattva
Bodhisattva


Joined: 12 Jan 2003
Posts: 2764

PostPosted: Tue Jul 29, 2003 5:30 am    Post subject: Reply with quote

I have problem with permissions with ALSA built-in (and I'm sure with 2.5.something I had no problems).

Everything in /dev/sound and /dev/snd misses rw permissions for the audio group so only root is able to use it. After a massive chmod 660 also users member of audio are ok but I haven't found a way to set the permissions automatically (short a chmod script starting at boot).

As modules ALSA works like it did with 2.4.21.
_________________
I may not agree with what you say, but I'll defend to the death your right to say it.
Back to top
View user's profile Send private message
Vache
n00b
n00b


Joined: 17 Oct 2002
Posts: 45
Location: Springboro, Ohio

PostPosted: Tue Jul 29, 2003 8:22 am    Post subject: Reply with quote

I have 2.6.0-test1.

I'm using XMMS for mp3 playback, but without xmms-alsa emerged (which needs alsa-driver, which I don't really want to have if the kernel has alsa anyway) I can't get any audio out. Grip won't play CDs (?), but Xine will (using gxine). Xmms won't play either. Agh.

It boils down to... do I need alsa-driver emerged or can I just inject it? (I can live without XMMS for mp3/audio playback).
_________________
Fool me once, shame on you. Fool me twice... you can't fool me again
Back to top
View user's profile Send private message
b0fh
Guru
Guru


Joined: 16 Jun 2003
Posts: 426

PostPosted: Tue Jul 29, 2003 8:35 am    Post subject: Reply with quote

I think xmms doesn't support alsa from its own.
You could try emerging alsa-xmms and configure alsa to use this output plugin.

Or:

emerge alsa-oss, this is sort of oss-emulator for alsa. Rember to re-emerge alsa after that with +oss in USE.
Back to top
View user's profile Send private message
st.john
Tux's lil' helper
Tux's lil' helper


Joined: 25 Nov 2002
Posts: 126
Location: Melbourne, Australia

PostPosted: Sat Aug 02, 2003 10:44 am    Post subject: Reply with quote

bsolar wrote:
I have problem with permissions with ALSA built-in (and I'm sure with 2.5.something I had no problems).

Everything in /dev/sound and /dev/snd misses rw permissions for the audio group so only root is able to use it. After a massive chmod 660 also users member of audio are ok but I haven't found a way to set the permissions automatically (short a chmod script starting at boot).

As modules ALSA works like it did with 2.4.21.


Have a look in /etc/security/console.perms you might need to change the line

<console> 0600 <sound> 0600 root.audio
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum