LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-09-2006, 12:26 AM   #1
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Automatic sound detection in Slack?


I'm putting together a Slackware live CD which needs to work out of the box with most computers. I have a generic Slack install which auto detects all of my hardware but the sound. The knoppix CD I have can detect it just fine, so I was wondering what goes into detecting and configuring sound devices. I know I can just run 'alsaconf' but this will not be an option since it will configure the sound to my specific hardware. What kind of files get created by 'alsaconf', and is there a way to make them generic like the xorg.conf is?

On the flip side, has anyone had their sound work out of the box? Maybe Slackware just doesn't like my specific hardware?

Intel AC97 w/ 2.4.31 (default) kernel.

thanks!
...aaron

**edit**
great, I typo'd the title. oh well, I'll just pretend I don't know english very well

Last edited by drkstr; 07-12-2006 at 11:23 AM.
 
Old 07-09-2006, 02:18 AM   #2
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
Intel AC 97 can be detected by alsaconf, but you still have to execute the command first.
 
Old 07-09-2006, 02:35 AM   #3
Daga
Member
 
Registered: Apr 2006
Location: A comfy chair...
Distribution: Slackware
Posts: 111

Rep: Reputation: 15
I have a live-cd that I release (100+ downloads in the last month ), and have allowed the kernel and standard Slackware startup scripts to detect the soundcard -- which they seem to do a decent job of. All that is left after that is to unmute the sound channels. To achieve that, I created a quick startup script to run these commands:

Code:
/usr/bin/amixer -q set Master 50%,50% unmute 2>/dev/null
/usr/bin/amixer -q set PCM 100% unmute 2>/dev/null
/usr/bin/amixer -q set Headphone 100% unmute 2>/dev/null
Some laptops only have "Headphone" instead of "PCM," so it is a good idea to hit both.
 
Old 07-09-2006, 11:59 AM   #4
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
Quote:
have a live-cd that I release (100+ downloads in the last month ), and have allowed the kernel and standard Slackware startup scripts to detect the soundcard -- which they seem to do a decent job of.
This is exactly what I am looking for; glad to know it's possible! So are you saying that the standard Slackware scripts should auto-detect most sound devices?

Quote:
To achieve that, I created a quick startup script to run these commands:
This will definatly be usefull, thanks!

Quote:
Intel AC 97 can be detected by alsaconf, but you still have to execute the command first.
What does alsaconf do when it auto-detects the device? What files does it modify, and what commands does it use to figure out the correct device? I think Daga is claiming that the default Slackware startup files should automatically detect and configure the sound device, why does the AC97 require the extra step?

Thanks for the help everybody!
...aaron
 
Old 07-09-2006, 01:56 PM   #5
chrisortiz
Member
 
Registered: Nov 2005
Distribution: Slackware, and of course the super delux uber knoppix universal live recovery cd
Posts: 429

Rep: Reputation: 30
Quote:
What does alsaconf do when it auto-detects the device? What files does it modify, and what commands does it use to figure out the correct device? I think Daga is claiming that the default Slackware startup files should automatically detect and configure the sound device, why does the AC97 require the extra step
as far as i know it only modifies /etc/modules.conf

Last edited by chrisortiz; 07-09-2006 at 01:59 PM.
 
Old 07-09-2006, 02:35 PM   #6
Daga
Member
 
Registered: Apr 2006
Location: A comfy chair...
Distribution: Slackware
Posts: 111

Rep: Reputation: 15
Quote:
Originally Posted by drkstr
What does alsaconf do when it auto-detects the device? What files does it modify, and what commands does it use to figure out the correct device? I think Daga is claiming that the default Slackware startup files should automatically detect and configure the sound device, why does the AC97 require the extra step?
The AC97 driver has worked correctly on the systems I've tested my live-cd on. I don't think any extra setup should be required... alsaconf is a bash script, but it does make for some fun reading

I believe it sets the order of sound cards in /etc/modules.conf (as chrisortiz said) to the order it found sound devices, and then it unmutes the main sound channels. There could be more, but that should be the gist of the script. It has been a little while since I've taken a look at it
 
Old 07-09-2006, 05:25 PM   #7
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
I see, I didn't realize it was a script; I just assumed it was a binary. Reading it will defiantly answer my questions! Well I think I have enough information to try and get something going here. Thank you everybody for the help!

...aaron
 
Old 07-09-2006, 10:39 PM   #8
Daga
Member
 
Registered: Apr 2006
Location: A comfy chair...
Distribution: Slackware
Posts: 111

Rep: Reputation: 15
That's why we love Bash
 
Old 07-11-2006, 02:16 AM   #9
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
Well I am still pretty new to bash scripting, but for the most part, I was able to understand it all. The only part that I didn't really get was when the list of found devices is displayed and the user picks one from a list. I am trying to eliminate all dialog so I need it to just pick the first one (or configure all of them if possible). Here is the code to display the dialog and pick the device to configure:

Code:
#from /usr/sbin/alsaconf
<snip>
devs_found=("${devs_found[@]}" "legacy" "Probe legacy ISA (non-PnP) chips")
    title=$(gettext "Soundcard Selection")
    msg=$(gettext "
         Following card(s) are found on your system.
         Choose a soundcard to configure:
")
    $DIALOG --title "$title" --menu "$msg" 17 76 8 "${devs_found[@]}" 2> $FOUND || acex 0
    card=`head -n 1 $FOUND`
    if [ "$card" = "legacy" ]; then
	ac_config_legacy
    else
	ac_config_card "$card"
    fi
    exit 0
else
<snip>
Any suggestions on the best way to remove the dialog from this and to automatically assign $card?

thanks for your time!
...drkstr
 
Old 07-12-2006, 01:51 AM   #10
Daga
Member
 
Registered: Apr 2006
Location: A comfy chair...
Distribution: Slackware
Posts: 111

Rep: Reputation: 15
Quote:
Originally Posted by drkstr
I am trying to eliminate all dialog so I need it to just pick the first one (or configure all of them if possible). Here is the code to display the dialog and pick the device to configure:

Code:
#from /usr/sbin/alsaconf
<snip>
devs_found=("${devs_found[@]}" "legacy" "Probe legacy ISA (non-PnP) chips")
    title=$(gettext "Soundcard Selection")    msg=$(gettext "
         Following card(s) are found on your system.
         Choose a soundcard to configure:
")
    $DIALOG --title "$title" --menu "$msg" 17 76 8 "${devs_found[@]}" 2> $FOUND || acex 0
    card=`head -n 1 $FOUND`
    if [ "$card" = "legacy" ]; then
	ac_config_legacy
    else
	ac_config_card "$card"
    fi
    exit 0
else
<snip>
If you scroll up from this (I love using '/' and '?' in vim), you will find that $devs_found[] is set up as an array -- the first element is the device, the second is a description of it, the third is another device, the fourth a description of it, etc. $devs_found[@] expands the array to all of the elements in it. This might help you understand a little better what is going on:


Code:
dialog --title "example" --menu "Some random menu text" 17 76 8 "one" "First element" "two" "second element" "three" "Et cetera" 2>choice
cat choice
Now, for practicality, in the adoption you might as well skip the "card description" and just iterate through the array.

HTH, and I'd like to see the finished script when you are done
 
Old 07-12-2006, 10:56 AM   #11
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Title edit

Quote:
Originally Posted by drkstr
**edit**
great, I typo'd the title. oh well, I'll just pretend I don't know english very well
Just edit your post, go to advanced and change the title. Problem solved
 
Old 07-13-2006, 11:23 AM   #12
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
Quote:
If you scroll up from this (I love using '/' and '?' in vim), you will find that $devs_found[] is set up as an array -- the first element is the device, the second is a description of it, the third is another device, the fourth a description of it, etc. $devs_found[@] expands the array to all of the elements in it. This might help you understand a little better what is going on:
Thanks, I see it now! I've haven't had the chance to work on this since I need to finish a project by friday, but I'll give it another go this weekend and post back with the results.

Quote:
Just edit your post, go to advanced and change the title. Problem solved
This only changes it in the thread. The title displayed in the forum will not change unless you ask a moderator to do it.


regards,
...drkstr
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic detection of Sound Card did not work !!! casper_nid Linux - Newbie 2 05-30-2006 03:56 PM
Automatic openoffice presentations with sound xzc Linux - Software 0 04-06-2006 07:45 AM
Automatic detection of the sound card did not work mulan Linux - Networking 8 09-14-2005 09:04 PM
Automatic detection of the sound card did not work ravihadimani Linux - Hardware 1 01-28-2005 10:58 AM
Automatic updating of slack? riddlebox80 Slackware 1 12-24-2002 05:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration