Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:setting_up_sound [2012/10/17 04:35] – [HDMI or .asoundrc users] expand sub-device aus9wiki:setting_up_sound [2018/10/04 20:21] (current) – [Rich setup guide] aus9
Line 1: Line 1:
-under re-construction Now 2 pages will fix up contents later 
- 
 ======ALSA====== ======ALSA======
 Sound is NOT built into base CorePlus, MicroCore or TinyCore, sound is implemented via extensions. I assume you are reading this because you a newbie.  Sound is NOT built into base CorePlus, MicroCore or TinyCore, sound is implemented via extensions. I assume you are reading this because you a newbie. 
- 
- 
- 
  
 =====OSS versus ALSA===== =====OSS versus ALSA=====
Line 12: Line 7:
   * If you need to change sound devices on-the-fly gui –> Pulseaudio (front end to ALSA) \\   * If you need to change sound devices on-the-fly gui –> Pulseaudio (front end to ALSA) \\
   * If you need to change sound devices no gui –> ALSA \\   * If you need to change sound devices no gui –> ALSA \\
-  * If you need easier surround sound –> ALSA \\+  * If you need easier surround sound –> Pulseaudio \\
   * If you like command mode surround sound –> Try OSS \\   * If you like command mode surround sound –> Try OSS \\
   * If you have an ISA sound device –> Try OSS then ALSA \\   * If you have an ISA sound device –> Try OSS then ALSA \\
Line 23: Line 18:
  
 good luck and [[sound_setup_using_oss| click here for OSS wiki]] good luck and [[sound_setup_using_oss| click here for OSS wiki]]
 +
 +=====Remove OSS=====
 +If you have previously installed OSS remove those packages from onboot
 +
 +{{wiki:twid_70_mob.jpg}}
 +
 +</code>
 +
 +
 +
 +=====Rich setup guide=====
 +Install alsa-config.tcz and alsa.tcz
 +
 +Install alsamixergui.tcz (optional)
 +
 +Set the volume control on the front of the speaker about 1/3 of the way up
 +
 +Run:
 +<code>alsactl init</code>
 +
 +This produced a slight thump as the card was found and initialized. That command
 +also unmuted the speakers and set the mixer volumes at sane levels.
 +
 +Run:
 +<code>speaker-test [-Ddefault:1] -c2 -t wav -l1</code>
 +
 +If all went well, you should hear the phrases  "Front Left"  and  "Front Right"  from
 +your left and right speakers respectively.
 +
 +Run:
 +<code>sudo alsactl store</code>
 +
 +Run:
 +<code>echo alsactl restore >> /opt/bootlocal.sh</code>
 +
 +Run:
 +<code>echo usr/local/etc/alsa/asound.state >> /opt/.filetool.lst</code>
 +
 +Run a backup to save your setup.
 =====Hearing sound using ALSA===== =====Hearing sound using ALSA=====
  
Line 56: Line 90:
  
 =====HDMI or .asoundrc users ===== =====HDMI or .asoundrc users =====
 +
 +Although I use HDMI as the main theme in this section, it applies to all users that need it and model=string in other sections or index strings does not resolve sound issues for you.
  
 If your mixer does not show up your HDMI device, you are likely to need an /home/tc/.asoundrc file If your mixer does not show up your HDMI device, you are likely to need an /home/tc/.asoundrc file
Line 61: Line 97:
 Note its dot asoundrc, if you don't have one, we are going to create one now. But I don't have a HDMI sound device so will pretend to have one. Note its dot asoundrc, if you don't have one, we are going to create one now. But I don't have a HDMI sound device so will pretend to have one.
  
-First run the commands and look at my results and guess what you I might have it+First run the command and look at my results and pretend you see mention of HDMI
 <code> <code>
 tc@box:~$ aplay -l tc@box:~$ aplay -l
Line 83: Line 119:
 But lets pretend you see output for digital and it reads But lets pretend you see output for digital and it reads
  
-card 1, device   (hdmi)+card , device   (hdmi)\\
 ---subdevice 0 ---subdevice 0
 +
 +as the first subdevice tends to be hdmi, we can drop reference to it in the asoundrc but if you need it, add the extra line below device (number)
 +^subdevice (number)^
 +
 +We next create a file to be saved as /home/tc/.asoundrc with contents in a code box for display purposes only
 +
 +<code>
 +pcm.!default { 
 +type hw 
 +card 0
 +device 1
 +
 +
 +ctl.card0 {
 +type hw
 +card 0
 +device 1
 +}
 +</code>
 +
 +The first string pcm......!default is telling alsa....try this device first for any application wanting to use sound.
 +
 +Now as we newbies, instead of learning how to stop and restart alsa, we cheat and logout and choose "Exit to Prompt", then run your mixer to see if you have HDMI showing up. If it does do a reboot and retest.
 +
 +Now if you need to change any mixer level, [[wiki:alsa_part2#persistence|click here for persistence]]
 +
 +=====asoundrc wiki=====\\
 +http://alsa.opensrc.org/.asoundrc
  
      
Line 127: Line 191:
  
 If you have multiple sound devices or the mixer channels are not correct or still no sound continue reading please. If you have multiple sound devices or the mixer channels are not correct or still no sound continue reading please.
 +
 =====Technical details for Newbies if no sound===== =====Technical details for Newbies if no sound=====
 To hear sound, you need a sound tcz to load called alsa.tcz (this also loads dependencies)\\ To hear sound, you need a sound tcz to load called alsa.tcz (this also loads dependencies)\\
Line 183: Line 248:
    * modules exist, but a system setting such as the bootcode has "blacklisted" the loading of the module\\    * modules exist, but a system setting such as the bootcode has "blacklisted" the loading of the module\\
    * modules exist, but a module "option" disables sound outputs     * modules exist, but a module "option" disables sound outputs 
 +
 =====alsaconf when the aplay list is empty===== =====alsaconf when the aplay list is empty=====
 If you downloaded alsa and its in your onboot list and you rebooted, you should have sound devices configured. You may need to adjust the mixers to **hear** sound. However, if  If you downloaded alsa and its in your onboot list and you rebooted, you should have sound devices configured. You may need to adjust the mixers to **hear** sound. However, if 
Line 195: Line 261:
  
 Users with ISA sound devices may need alsaconf. If the only changes were to mixer levels or running alsaconf you can now jump to [[alsa_part2#persistence|persistence]] Users with ISA sound devices may need alsaconf. If the only changes were to mixer levels or running alsaconf you can now jump to [[alsa_part2#persistence|persistence]]
 +
 ===== blacklist ===== ===== blacklist =====
 This option needs edit of your boot loader config with root powers. This is **unofficial** recommended way for all users where:\\ This option needs edit of your boot loader config with root powers. This is **unofficial** recommended way for all users where:\\
Line 212: Line 279:
 If you have multiple modules to blacklist you can use the formula If you have multiple modules to blacklist you can use the formula
 ^blacklist=sound_module_name,module_2,module_3 etc^ ^blacklist=sound_module_name,module_2,module_3 etc^
 +
 =====Blacklist for permanent disable of internal sound device===== =====Blacklist for permanent disable of internal sound device=====
 So if you have a computer where the internal sound, onboard or isa or pci is faulty or deficient, blacklist the internal sound module. So if you have a computer where the internal sound, onboard or isa or pci is faulty or deficient, blacklist the internal sound module.
Line 234: Line 302:
 </code> </code>
 In other words, what we test live, is roughly what we show in bootlocal but drop the word sudo In other words, what we test live, is roughly what we show in bootlocal but drop the word sudo
 +
 =====Reasons for changing===== =====Reasons for changing=====
 In this section, the blacklist is the same as the modprobe -r command. But we are doing it, because you find that the mixer channels or switches or options are not a match to your actual hardware. This is true for my intel device and may be true of a number of intel devices but also affects some other sound module users such as AC97. In this section, the blacklist is the same as the modprobe -r command. But we are doing it, because you find that the mixer channels or switches or options are not a match to your actual hardware. This is true for my intel device and may be true of a number of intel devices but also affects some other sound module users such as AC97.
Line 261: Line 330:
 </code> </code>
 If this is too much info for newbies, ignore the modinfo command. If this is too much info for newbies, ignore the modinfo command.
 +
 =====Research your sound device===== =====Research your sound device=====
 lsmod shows what your sound module is. Now use that information to check the list of files for {{http://www.kernel.org/doc/Documentation/sound/alsa/|sound module options and tweaks}} lsmod shows what your sound module is. Now use that information to check the list of files for {{http://www.kernel.org/doc/Documentation/sound/alsa/|sound module options and tweaks}}
Line 293: Line 363:
 </code> </code>
 This information may be seen in alsamixer command or in alsamixergui, if it works. Then for Intel users, read HD-Audio-Models.txt and for my sound module I note the following options This information may be seen in alsamixer command or in alsamixergui, if it works. Then for Intel users, read HD-Audio-Models.txt and for my sound module I note the following options
-<code> + 
-STAC9220/9221 +But I have just had to change while testing PA and the new preferred method for intel users is this link 
-============= +http://voices.canonical.com/david.henningsson/2012/07/13/top-five-wrong-ways-to-fix-your-audio
-  ref Reference board + 
-  3stack D945 3stack +and so we now use model=auto. 
-  5stack D945 5stack + SPDIF +
-  intel-mac-v1 Intel Mac Type 1 +
-  intel-mac-v2 Intel Mac Type 2 +
-  intel-mac-v3 Intel Mac Type 3 +
-  intel-mac-v4 Intel Mac Type 4 +
-  intel-mac-v5 Intel Mac Type 5 +
-  intel-mac-auto Intel Mac (detect type according to subsystem id) +
-  macmini Intel Mac Mini (equivalent with type 3) +
-  macbook Intel Mac Book (eq. type 5) +
-  macbook-pro-v1 Intel Mac Book Pro 1st generation (eq. type 3) +
-  macbook-pro Intel Mac Book Pro 2nd generation (eq. type 3) +
-  imac-intel Intel iMac (eq. type 2) +
-  imac-intel-20 Intel iMac (newer version) (eq. type 3) +
-  ecs202 ECS/PC chips +
-  dell-d81 Dell (unknown) +
-  dell-d82 Dell (unknown) +
-  dell-m81 Dell (unknown) +
-  dell-m82 Dell XPS M1210 +
-  auto BIOS setup (default) +
-  </code> +
-See 5stack? It means 5 color connectors for audio. So as alsasound was showing only 2 channel mixer settings, I need to make the following change to bootlocal.+
 =====bootlocal.sh tweaks - Part two -- to change mixer controls or settings===== =====bootlocal.sh tweaks - Part two -- to change mixer controls or settings=====
  
Line 326: Line 376:
 ^/sbin/modprobe sound_module model=string^ ^/sbin/modprobe sound_module model=string^
  
-eg I use /sbin/modprobe snd_hda_intel model=5stack+eg I use /sbin/modprobe snd_hda_intel model=auto 
 ====Part 2 where you have not blacklisted==== ====Part 2 where you have not blacklisted====
 You will need a remove module and re-insert module command, using formula You will need a remove module and re-insert module command, using formula
Line 340: Line 391:
 {{wiki:twid_66_surround1.jpg?400x250}} {{wiki:twid_66_surround1.jpg?400x250}}
  
-=====index issues=====+=====index or sound device number issues=====
 As a general rule, most software applications, wanting to play or record sound, prefer to use the first detected sound device. We call this index=0 even if you have not setup any index value.  Its the same as saying the card number and ALSA counts devices from zero not from one. As a general rule, most software applications, wanting to play or record sound, prefer to use the first detected sound device. We call this index=0 even if you have not setup any index value.  Its the same as saying the card number and ALSA counts devices from zero not from one.
  
Line 358: Line 409:
 =====Page 2===== =====Page 2=====
 [[wiki:alsa_part2|click here to next page]] [[wiki:alsa_part2|click here to next page]]
- 
- 
- 
- 
- 
  
  
Print/export
QR Code
QR Code wiki:setting_up_sound (generated for current page)