OpenWrt Forum Archive

Topic: why kmod-alsa for kernel 2.4 only ?

The content of this topic has been archived on 3 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

in package/alsa/Makefile I find:
DEPENDS:=@USB_SUPPORT @LINUX_2_4

I have removed @LINUX_2_4 and am using kmod-alsa in 2.6.19.1.

do I miss something with sound modules in 2.6, or is the dependency just not needed ?

Stefan

Index: package/alsa/Makefile
===================================================================
--- package/alsa/Makefile       (revision 6111)
+++ package/alsa/Makefile       (working copy)
@@ -24,7 +24,7 @@

define KernelPackage/alsa
   SUBMENU:=Other modules
-  DEPENDS:=@USB_SUPPORT @LINUX_2_4
+  DEPENDS:=@USB_SUPPORT
   TITLE:=Advanced Linux Sound Architecture
   DESCRIPTION:=
   FILES:=$(PKG_BUILD_DIR)/modules/*.$(LINUX_KMOD_SUFFIX)

The current alsa driver package does not compile on linux 2.6, and linux 2.6 already comes with in-tree alsa drivers.
So there's no need to compile that external package on linux 2.6...

hi,

this is what i would somehow have expected. i am using a usb audio device, but if i only build and load soundcore and usb-audio, then i get /dev/snd/controlC0 and /dev/snd/timer,  but not /dev/sound/dsp, which i get when i load the snd-* modules.
what am i doing wrong?

Thanks
Stefan

/dev/sound/dsp on alsa is part of the oss emulation, so simply loading the core and the audio driver doesn't give you that...

ah, ok, i overlooked that. is there a separate package for oss-emulation on alsa already available?

Thanks

btw, alsa extra package compiled here with 2.6.19.1 without problems.

I don't get this change. I got /dev/sound/dsp just fine before when I compiled kamikaze using the 2.6 kernel and kmod-alsa (plus all the other stuff). Now I get nothing. No driver is associating with my USB sound now. Do I just modify the alsa makefile to what it was before the "DEPENDS:=@USB_SUPPORT @LINUX_2_4" change?

use this makefile https://dev.openwrt.org/browser/trunk/p … e?rev=6036 and the alsa.modules and the patches to build kmod-alsa for 2.6. Works for me. To use it with buildroot put the makefile in trunk/package/alsa/ etc.. then run   

make menuconfig

and select alsa - next run 

make package/alsa-clean V=99

and finally 

make package/alsa-install V=99

- you should have a nice ipk file in your the directory.

Hi

Maybe someone can help clear up my confusion...

I want to compile asterisk to use ALSA to allow phone calls to the 'console' (i.e. using the usb sound card on my wgt634u)

From what I read above, it seems ALSA is built into the kernel; certainly the USB sound modules compile and work fine (with mpd)

But asterisk-1.2.14/channels/chan_alsa.c (and other ALSA-using applications e.g. madplay) want to
#include <alsa/asoundlib.h>

I cant find this anywhere in the distribution? I would have thought  trunk/build_mipsel/linux/include but its not there.

Is there something I am missing?  How can I get ALSA includes and libs to enable other apps to use it?

mpd doesnt use ALSA either, it seems to be using OSS - is this an emulation layer provided by ALSA?

Thanks

John

ps: wgt644u, openwrt r6300, linux 2.6

Hello

An update on getting the 'console phone' of asterisk working.

I still haven't got to the bottom of ALSA on openwrt, but noticed that the asterisk package does actually compile chan_oss.so by default (trunk/build_mipsel/asterisk-1.2.14/channels/chan_oss.so) although it doesnt get included in the ipkg.

copy this library to /usr/lib/asterisk/modules on the openwrt machine and add the line "load => chan_oss.so" into the /etc/asterisk/modules.conf so that asterisk will load it on startup

my openwrt creates the audio dsp in /dev/sound/dsp, but asterisk looks for /dev/dsp so create a symlink :
ln -s /dev/sound/dsp /dev/dsp

you also need to copy or create an oss.conf in the /etc/asterisk directory - there is an example in /trunk/build_mipsel/asterisk-1.2.14/configs/oss.conf.sample

if you start asterisk now it will happily use the console as a phone - you will notice some new commands available in the CLI (dial, hangup, answer etc - try help)

you can now dial your extensions e.g. 'dial 3102' (set the same context in oss.conf) or 'dial 3102@other-context'

in extensions.conf add something like

[internal-context]
exten => 101,1,Dial(CONSOLE/dsp)
exten => 101,2,Hangup

so that if you dial 101 from another extension, the console will ring (actually you probably set it to autoanswer in oss.conf otherwise you need to be logged on the asterisk CLI to issue the answer command)

This is going to work as a baby monitor for me (I hope!)

Would still love to know how alsa is working on openwrt and why oss seems to be working in case anyone can tell me!

Thanks

John

The discussion might have continued from here.