=====bootlocal.sh tweaks - other options===== In this section, I assume you have blacklisted your sound module. This section covers all other options that are relevant to your sound module. They include:\\ * quirks * irq (interrupts) and some related settings * This affects normal sound cards and also ISA devices (an older sound device architecture) * power save modes * Message Signaled Interrupts (msi) * DMA pointer read method (position_fix) * AND OTHER modinfo outputs relevant to your card My intel card can't be tested for quirks as my sound is good. But if you read various docs under http://www.kernel.org/doc/Documentation/sound/alsa/ you will see there are some quirks especially for AC97 cards. For example it might be….. ^/sbin/modprobe snd_intel8x0 ac97_quirk=hp_only^ Common quirks are shown here http://www.kernel.org/doc/Documentation/sound/alsa/ALSA-Configuration.txt Intel users may have an issue with wrong codecs or message handling. See http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio.txt. Example ^/sbin/modprobe snd_hda_intel enable_msi=0^ =0 means turn off instead of default which is on for most models. Example (made up) of irq and related options ^/sbin/modprobe snd-azt1605 irq=9 mpu_irq=7 wss_port=0xe80^ =====Persistence ===== Newbies may like to [[start#persistence|read the other pages on what persistence means]] Also I assume that you are using Mount Mode of Operation from {{http://distro.ibiblio.org/tinycorelinux/concepts.html|concepts}}. Specifically I assume only tce is named as the persistent folder in your bootloader. Note you need root powers to edit /opt/.filetool.lst or bootlocal.sh. Use a command to get root powers for your preferred gui or try the commands below. Newbies may like to consider installing lxterminal for easy copy and paste? And in the echo commands the \n means create a newline and not append to any existing line. Your sound persistence may fit more than one category below. **All users**\\ add line to /opt/.filetool.lst ^opt/alsa^ **Note** we drop the first / for each file in filetool.lst. **Mixer volumes or mute changed for single device users**\\ First use your mixer to adjust the mute/umute, volumes and input active/de-active settings. Next we save those settings to a file by running command sudo alsactl store Add extra line to filetool.lst ^usr/local/etc/asound.state^ Next add the following line to bootlocal.sh ^/usr/local/sbin/alsactl restore^ **alsaconf users**\\ Add extra line ^etc/modprobe.conf^ **sound device model changed to fix up controls or options**\\ Best not to use "default" mixer pathway, instead use an unique pathway to save borking your mixer levels. sudo alsactl -f /home/tc/mysound.state store Change the filename mysound.state to whatever you like, eg surround.state but then reflect that name in the next bit please. First use root powers to edit /opt/bootlocal.sh sudo echo -e '\n/usr/local/sbin/alsactl -f /home/tc/mysound.state restore' >> /opt/bootlocal.sh There is no need to add the home file mysound.state to filetool.lst as it goes into mydata.tgz on shutdown or reboot. **Switching sound devices at boot**\\ I have kept their persistence issues within that section, below. **blacklist module users**\\ Need to know what their bootloader is, and use root powers to edit that config file.\\ Typically, the file is likely to be under /boot folder and /boot is outside the rootfs (the unpacked core.gz). boot folder is often at same partition as the tce folder but its not necessary that it is. **/home/tc/.asoundrc users **\\ This file is backed up to mydata.tgz so no further action need for it. Be aware that you may have changed mixer levels. =====Persistence - LIVE TEST and CHECKLIST===== Some users may like to test that their saved mixer level files are good before reboot? Try sudo alsactl -f /home/tc/mysound.state restore Change name of file if you used /usr/local/etc/asound.state or some other name. Before reboot, I suggest you click on control panel and click on backup.\\ To verify that all files needed, have landed in mydata.tgz modify the following command to your pathway please sudo tar tzf /mnt/sda1/tce/mydata.tgz | less I won't show my output as I may not have the same persistence as my assumptions heh heh. Next check your filetool.lst less /opt/.filetool.lst Next, for those who I suggested, blacklist sound modules check your bootloader entries eg less /mnt/sda1/boot/grub/menu.lst (or grub.cfg) If upon review it looks good, good luck and reboot then check your mixer levels and desired sound is actually happening. =====Surround sound===== Most people know what this means already, otherwise consider reading http://en.wikipedia.org/wiki/Surround_sound On first reboot, ALSA may detect a surround sound device, but not have all settings correct? YMMV {{wiki:twid_66_surround1.jpg?350x250}} This is a tower, so you may not have Front channel. Visit /usr/local/share/sounds/alsa and play each relevant sound file and enable or disable each channel to see what effect it has. TIP= enable all. For me, enabling all gives me the surround effect with a 2 channel desktop speaker system. {{wiki:twid_67_surround3.jpg}} Here, the padlock becomes more relevant as you may not be in the centre of the room so need to offset some sliders? YMMV Note: if you needed to adjust mixer levels or mutings you may need to revisit persistence =====alsamixer===== You may need to use alsamixer, if you need to change your inputs. This is because I found alsamixergui unable to unmute (make active) my mic input. If you want to learn alsamixer, make as many changes as you like but remember not to save them with the alsactl command. That is the power and convenience of the TinyCore design to get you back to a pristine state or a saved state. Open a terminal and run command alsamixer Press F1 for help with keyboard inputs, there are no mouse inputs. {{wiki:twid_68_help1.jpg?300x300}} These left or right arrows are critical to get you to the correct selection. There is no padlock to lock or unlock balances together. See the images in page one or two to get an idea what I did, its not that hard? YMMV The above help is not helpful for microphone or capture devices, these input devices need the SPACE BAR to activate or de-active. The default seems to be de-active. I have hidden the mic sections below as most users tend not to use mics. =====Choose sound devices at boot===== Why do it? Mainly used by people who want to use an USB sound mixer at home because their onboard device is junky. But when they take portable to coffee shop etc, they want an easy way to get onboard sound automatically tweaked for mixer settings. **__Are you exceptional?__** You may not have to do all this stuff if the following works for you;\\ swap to device 2, no tweaks required\\ swap to device 2, no mixer levels need changing\\ ditto swap to device 1. In which case, you just need simple bootloader entries so to use device one, you blacklist sound module for device 2 and for device 2, blacklist the module for sound device 1. **PART 1 - TEST LIVE SWAP** Firstly you can use test out your commands live to see if they work, but there is a gremlin in removing one sound module. It may not remove all. Formula is /sbin/modprobe -r (current sound module) /sbin/modprobe (second device module) If second device is USB, no need for second command if you leave your USB out of your computer until first module is removed. Before you remove your current sound module, check if you need to change mixer levels, if you do, then set up an unique mixer file. sudo alsactl -f /home/tc/device1.state store After running the modprobe commands, check mixer levels and if you need to change mixer levels **only**, create its unique mixer file sudo alsactl -f /home/tc/device2.state store Now swap the sound module names, in the modprobe command formula, to get back to device 1 sound. If the mixer levels are not correct, then you truly need a mixer file for device 1 so assuming you made one earlier, now load it by command sudo alsactl -f /home/tc/device1.state restore Now swap again to device 2 but change that restore command to device2. You are not forced to use those formula names for the mixer files. But whatever you call them, reflect those names into your commands and the other steps below please. eg If you have an intel onboard and some USB device the names might be onboard.state and usb.state. **Part 2 - CREATE NEW BOOTLOADER ENTRIES**\\ We blacklist all sound modules. While editting, we create 2 entries one for each sound device. So your bootloader config editted with root powers becomes\\ bootloader extra entry 1 ^blacklist=sound_module1, sound_module2 snd=/opt/1.sh^ bootloader extra entry 2 ^blacklist=sound_module1, sound_module2 snd=/opt/2.sh^ If you are using grub remember to run command sudo update-grub **PART 3 - CREATE PERSONAL BOOTCODE** Use root powers to edit bootlocal.sh to do the following:\\ * remove all mentions of sound modules or tweaks * add bootcode formula The reason why we can't have any sound tweaks etc in bootlocal, is we creating 2 unique bootcode scripts (another stage) and we can't afford to have interference from duplicate entries. Add this please, in a code box for display purposes only RUNME="" for i in `showbootcodes` do case $i in snd*) RUNME=${i#*=} ;; esac done [ -n "$RUNME" ] && $RUNME Now reboot, and test out extra entry 1. Your system should boot and you will be missing sound for both devices. Note that I am not a real coder, that code was created by the TC dev team and I am grateful they are smarter than me. I removed the space from the code and it still works for me. ** PART 4 - CREATE 1.SH **\\ Use root powers to create a text file, for me, I use sudo leafpad Replace leafpad with any other gui text editor or terminal editor. Contents formula is: (inside a code box for display purposes only) #!/bin/sh /sbin/modprobe sound_module1 (options) /usr/local/sbin/alsactl -f /home/tc/device1.state restore (options) replace with any needed, eg for me, model=5stack for module=snd_hda_intel Now save it to /opt/1.sh. Next make it executable by sudo chmod +x /opt/1.sh Next add that file to our backup file using root powers to edit filetool.lst so it reads ^opt/alsa^ ^opt/1.sh^ Also note, you ignore all of the persistence section as you are creating your own persistence thru these 2 scripts and personal bootcode with blacklist bootloader entries. Now reboot and try out bootloader entry for device 1. If there are errors, you may need to reboot (without backup please) and choose your normal bootloader entry to check for copy and paste errors etc. ** PART 5 - CREATE 2.SH **\\ Once you are happy with Part 4, repeat the process for your second device and add the extra file to filetool.lst ^opt/2.sh^ reboot to test the second bootloader entry. =====Normal microphones===== Check how many inputs you have, in case you did not know, or suspect broken hardware wtih arecord -l (my example) I have front and rear mics in a tower **** List of CAPTURE Hardware Devices **** card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog] Subdevices: 2/2 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 If you want to use command mode those are renamed as hw:0,0,0 and hw:0,1,1 Now lets explain that.\\ first number is the card index number\\ second number is subdevice\\ third is sub-component If you have normal 3.55 mm orange colour connector microphone, you may still need to do some tweaking.\\ Firstly record a sample through your mic and then play it back. Naturally ensure you hear sound (out) before posting you have faulty mic settings please. There is a catch in alsamixer. When you press the TAB key to go to input devices = capture devices.....you may see the word mic or not. For my hardware, the setting can be changed //from// mic (= back connector) //to// front mic //to// line\\ and I have 2 sliders and 2 settings in my alsamixer. image to be updated later In above image, I have paired slider 1 with setting one and slider 2 with setting 2 so it reads\\ ...the first capture device is raised volumes for input to max and is set to front mic....with its mux set to zero\\ ...the second capture device is zeroed for back mic with dmux set to zero. =====How to activate your mic===== If your alsamixer mic control does not dispaly the word CAPTURE above the bottom capture control, then press the **SPACE BAR** in alsamixer to unmute or activate the mic. Next, use the page up or down or arrow up or down to set the volume levels. TIP, distortion is more likely at max volume try somewhere between 80-90% and consider doing record and playbacks to confirm. {{wiki:mic.jpg}} The mux setting is like a kind of mic amplifier and I suggest you do not use it unless with volumes maxed etc, you can not hear sufficient volume. Note when raised mux is more likely to lead to distortion. If your alsamixer image has a slider and one named digital then you have an advantage over most sliders. The non-digital slider can be volume zero but kept active, and your mic volume is controlled by the digital slider. TIP If you have a headset mic and ear pieces use that to avoid getting speaker feedback through your mic. =====Volume guidelines===== As a general rule, never set volume for inputs at 100%. The amplifier called mux for my card only allows 0,50 or 100 amplification. And 50 and 100 cause too much distortion to even my ears to bear. ===== How to change setting for mic ===== Press the right hand arrow until you get to either input source (0) or input source (1).......then press the up key or the down key to change. Note that these keys are one way and do not offer the ability to cycle thru all the optins....so try going all the way up and all the way down (using arrow keys) to know your options please. ===== Recording and testing voice mic inputs ===== Try using terminal commands to record and replay your mic recording. eg arecord -d 10 /tmp/test.wav aplay /tmp/test.wav The -d 5 means duration of 5 seconds, feel free to alter. You can also see options arecord --help but I am mainly interested in the fact that you can hear your voice not the quality, and that volume is reasonable. Normal feedback to mic due to having your mic close to speakers or by having the input slider too high can be tweaked by repeating the same set of commands.....interspersed with running alsamixer and tweaking the settings. If you intend to do snazzy or sophicated voice recordings, please check out http://linux.die.net/man/1/arecord http://linux.die.net/man/1/aplay =====Webcam microphones===== I have an usb lead connected to a desktop pc that has a webcam. It has no sound out, but a mic in. Run alsamixer in a terminal or another mixer if you prefer. I then press F6 to show a range of sound devices and select by arrow my webcam. Press F4 or press TAB key cycle thru to get to the input or capture section. {{wiki:twid_30_webmic.jpeg?400x250}} Depending on whether you are using skype or video recording, you may need to save a backup of your mixer levels for that webcam. For problems with microphones see Forums, e.g. http://forum.tinycorelinux.net/index.php?topic=2083.msg16436#msg16436 =====Modems===== If you happen to have a modem supported by alsa, then you may find some settings for it in alsamixer, showing as a distinct sound device, e.g. Off-hook and Caller ID. =====Other web resources and credits===== TC maintainers for OSS and Alsa * Jason W, Juanito, Curaga * Moderator Rich for setup guide http://alsa.opensrc.org/index.php/Main_Page http://alsa.opensrc.org/index.php/TroubleShooting http://alsa.opensrc.org/index.php/AlsaTips (Above good for naming devices like PCM etc) http://alsa.opensrc.org/index.php/Sound_Cards:_Introduction http://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture (Above covers a multitude of stuff including poor sound, sound pops, stutters etc) =====Page 1===== [[setting_up_sound|page 1]]