[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: please review alsaconf patch

On Tue, Nov 01, 2005 at 01:45:56PM +0100, Roland Stigge wrote:
> Hi,
> Martin Habets wrote:
> > Thanks for the info. I guess you must have an "audio" device on the
> > ebus then, and I failed to check for that in my original patch.
> > Could you try the patch attached in stead of the original one, please?
> Unfortunately, it didn't work out-of-the-box. With a bit of polishing I
> could at least make it run (see attached incremental patch to your changes).
> Some comments to the respective changes:
> (1) $PROCFS was not defined, so I set it manually. I didn't know where
> you intended it to come from so I just set it in the beginning of the
> patch to /proc.

It is set at line 30 of the script. Maybe you are using an old version of

> (2) I guess you meant mounting openpromfs in case /proc/openprom exists?
> Therefore && instead of ||.

I meant to mount it if it has not been mounted yet. Fixed the code for this.

> (3) Under /proc/openprom/pci@40,4700000/ebus@5, I have a directory
> called "audio@1,200000". Therefore, I needed to search for "audio*"
> instead of "audio".
> (4) The file "compatible" contains: "'SUNW,CS4231'" (with single
> quotes). I needed to remove them.
> Now, alsaconf detects the device fine. (Also consider FJP's comments on
> using modprobe.)

Thanks for testing and for the fixes.

> However, there are some issues left with my CS4231: On bootup, the
> modules are not loaded automatically (even hotplug doesn't care about
> them). So I need to put "snd-sun-cs4231" into /etc/modules. Further,
> when I want to play something (e.g., with xmms), I often (unpredictably)
> get (white?) noise. Retrying helps every 3rd or 4th time. Maybe
> alignment or endianess issues. But these are different issues and not
> related to alsaconf I think. If noone else has experienced this yet, I
> will need to dive into the driver myself later.

What kernel version are you on? A number of patches have been submitted
on the sparclinux list in the last 2 months, the last one on october 29th.
If you have those, it is best to follow up with Georg Chini on this.

--- alsaconf.orig	2005-10-31 13:02:07.000000000 +0000
+++ alsaconf	2005-11-02 08:16:08.000000000 +0000
@@ -688,7 +688,8 @@
     # PowerMac
     if grep -q MacRISC $PROCFS/cpuinfo; then
-	/sbin/modprobe -a -l | grep 'snd-powermac' | \
+	MODDIR=/lib/modules/`uname -r`
+	find $MODDIR -name 'snd-powermac' -print | \
 	while read i; do
@@ -701,19 +702,22 @@
     # Sparc
     if grep -q Sparc $PROCFS/cpuinfo; then
-	test -r $PROCFS/openprom || /bin/mount -t openpromfs none $PROCFS/openprom >/dev/null 2>&1
+	test -r $PROCFS/openprom/name || /bin/mount -t openpromfs none $PROCFS/openprom >/dev/null 2>&1
 	# Check for an "audio" device
 	if test -r $PROCFS/openprom; then
-	    audio=`find $PROCFS/openprom -follow -type d -name "audio" -print`
+	    audio=`find $PROCFS/openprom -follow -type d -name "audio*" -print`
 	if test -n "$audio"; then
 	    compat=`cat $audio/compatible`
+	    compat=${compat#\'}
+	    compat=${compat%\'}
 	# Go through all cards we have
-	/sbin/modprobe -a -l | grep 'snd-sun-' | \
+	MODDIR=/lib/modules/`uname -r`
+	find $MODDIR -name 'snd-sun-*' -print | \
 	while read i; do
@@ -1339,7 +1343,8 @@
 if [ -s "$FOUND" ]; then
     while read dev card ; do
-	/sbin/modprobe -a -l | grep -q -E $card'\.(o|ko)' || continue
+	MODDIR=/lib/modules/`uname -r`
+	find $MODDIR -type f | grep -q -E $card'\.(o|ko)' || continue
 	cardname=`find_device_name $dev | cut -c 1-64`
 	if [ -z "$cardname" ]; then

Reply to: