ALSA/ta

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page ALSA and the translation is 54% complete.
Outdated translations are marked like this.


இந்த கட்டுரை ALSA (Advanced Linux Sound Architecture) வின் உதவியோடு ஒலி அட்டையை எவ்வாறு நிறுவுவது என்பதைப் பற்றி விவரிக்கிறது.

நிறுவல்

வன்பொருளை கண்டறிதல்

சரியான இயக்குநிரலை தேர்ந்தெடுப்பதற்கு பயன்பாட்டில் உள்ள ஒலி கட்டுப்படுத்தியை முதலில் கண்டறியவும். இதற்கு lspci என்னும் கட்டளையை பயன்படுத்தவும்:

user $lspci | grep -i audio

கட்டுப்படுத்தியின் பெயரை அறிந்தவுடன் அதற்கு தேவையான இயக்குநிரல் ALSA sound card matrix என்னும் இடத்தில் கிடைக்கும்.

கருநிரல்

பின்வரும் கருநிரல் விருப்பத்தேர்வுகளை இயக்கவும்:

கருநிரல்
Device Drivers --->
    <*> Sound card support
        <*> Advanced Linux Sound Architecture --->
            [*] PCI sound devices  --->
                Select the driver for your audio controller.
            HD-Audio  --->
                Select a codec or enable all and let the generic parse choose the right one:
                [*] Build Realtek HD-audio codec support
                [*] ...
                [*] Build Silicon Labs 3054 HD-modem codec support
                [*] Enable generic HD-audio codec parser
            [*] USB sound devices  --->
                Must have as some cards are presented as USB devices.
                [*] USB Audio/MIDI driver
General setup --->
    [*] System V IPC

lsmod கட்டளை இதற்கு உதவியாக இருக்கும்.

முறைமையில் எட்டிற்கும் அதிகமான வெளியீடுகள் இருந்தால் (GPU வில் உள்ள ஒவ்வொரு HDMI வெளியீடும் ஒரு வெளியீடாகக் கருதப்படும்) அதிகபட்ச ஒலி அட்டை அளவை அதிகரிக்க வேண்டும்:

கருநிரல்
Device Drivers --->
    <*> Sound card support
        <*> Advanced Linux Sound Architecture --->
            [*] Dynamic device file minor numbers
            (32) Max number of sound cards

மென்பொருள்

Portage ல் உள்ள alsa என்னும் உலகளாவிய USE கொடியின் மூலம் மற்ற தொகுப்புகளில் ALSA விற்கான ஆதரவைச் செயல்படுத்த முடியும். இந்த USE கொடியைச் செயல்படுத்திய உடன் media-libs/alsa-lib என்னும் தொகுப்பு தானாக நிறுவல் பட்டியலில் சேர்க்கப்பட்டு விடும் (x86 மற்றும் amd64 என்னும் திரைப்பலக விவரத்தில் இது முன்னிருப்பாக இருக்கும்).

root #euse -E alsa

euse கட்டளை app-portage/gentoolkit என்னும் தொகுப்பின் ஒரு பகுதியாகும்.

USE flags for media-libs/alsa-lib Advanced Linux Sound Architecture Library

alisp Enable support for ALISP (ALSA LISP) interpreter for advanced features.
debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
python Add optional support/bindings for the Python language

எல்லாவற்றையும் அமைத்தப்பின் மாற்றங்கள் நடைமுறைக்கு வர முறைமையை மறவாமல் இற்றைப்படுத்தவும்:

root #emerge --ask --changed-use --deep @world

media-sound/alsa-utils தொகுப்பு பிழை நீக்குவதற்கு மற்றும் ஒலி முறைமையைச் சோதனை செய்வதற்குரிய சில சாதனங்களை அளிக்கிறது. ஏற்கனவே இதை merge செய்யவில்லை என்றால் இப்போது நிறுவிக்கொள்வது நல்லது.

root #emerge --ask media-sound/alsa-utils

உள்ளமைவு

கோப்புகள்

  • /etc/asound.conf - உலகளாவிய (முறைமை முழுமைக்கும்) உள்ளமைவுக் கோப்பு.
  • ~/.asoundrc - உள்ளூர் (ஒவ்வொரு பயனருக்கும்) உள்ளமைவுக் கோப்பு.

~/.asoundrc

இந்த கோப்பை விருப்பப்பட்டால் பயன்படுத்திக்கொள்ளலாம். இதன்மூலம் ALSA முன்னிருப்புகளை மேலெழுதிக் கொள்ளலாம். ஏனெனில் சிறப்பு வன்பொருட்களை பயன்படுத்தும் முறைமைகளில் அட்டை 0 மற்றும் சாதனம் 0 என்னும் முன்னிருப்புகள் உதவ வாய்ப்பில்லை.

எளிய மாற்றங்களுள் ஒன்று அட்டை மற்றும் சாதனம். எனக்கு Realtek ALC88* கேட்பொலி சாதனத்தோடு இணைக்கப்பட்ட Nvidia அட்டையில் இருந்து HDMI வரும் சூழலில் நான் இவ்வாறு உணர்கிறேன்.

கோப்பு ~/.asoundrc
defaults.pcm.!card 1
defaults.pcm.!device 7

உங்கள் ஒலி அட்டைக்கு இடப்பட்ட அட்டை எண் தென்படவில்லை என்றால் அச்சம் கொள்ளத் தேவையில்லை — அட்டை எண் இதனுள் ஒரு பெயராகும். உங்கள் அட்டை இவ்வாறு பட்டியலிடப்பட்டிருந்தால்...

user $aplay -L
front:CARD=Generic,DEV=0
HD-Audio Generic, ALC282 Analog
Front speakers

... எனில் ~/.asoundrc கோப்பு இவ்வாறு இருப்பதாக பொருள்:

கோப்பு ~/.asoundrc
defaults.pcm.!card Generic
defaults.pcm.!device 0
defaults.ctl.!card Generic
எச்சரிக்கை
These settings disable all software mixing. To output everything at 96kHz, add defaults.pcm.dmix.rate 96000 to the ~/.asoundrc file.

When multiple sound cards are in use, the device numbers could be reordered across boots, such that using a name is advantageous.

If the correct name is unclear, a list of valid names can be easily obtained with:

user $cat /sys/class/sound/card*/id

இங்கு பல ஒலி அட்டைகளை கொண்டுள்ள ஒரு உருவாக்குனரின் முறைமையில் இருந்து வந்த வெளியீட்டை காணலாம்:

user $cat /sys/class/sound/card*/id
Q1U
HDMI
PCH
C930e

இங்கு Q1U ஒலிவாங்கி Q1U எனவும், உள்ளமைந்த HDMI HDMI எனவும், அலைமருவி ஒலி Jack குகள் PCH எனவும், உள்ளமைந்த இணையப் படக்கருவி C930e எனவும் உள்ளன. எல்லாம் செல்லுபடியாகக்கூடிய அட்டை பெயர்களாகும்.

எச்சரிக்கை
ஒன்றிற்கும் மேற்பட்ட ஒலி அட்டைகளை பயன்படுத்தும்போது அட்டை பெயர்களுக்கு பதிலாக எண்களை குறிப்பிடும்போது முறைமை தொடக்கத்தில் சாதனங்கள் மறுவரிசை அடையலாம். இதன்மூலம் மாறிய அட்டை எண்ணை உள்ளமைவு கோப்பில் திருத்தாத வரை ஒலி சரியாக கேட்க வாய்ப்பில்லை

S/PDIF அல்லது HDMI .asoundrc

பின்னணி

Most sound cards allow passing through audio to an external consumer receiver or DAC using S/PDIF digital coaxial or optical cables. Doing so, preserves sound quality and compressed Dolby/DTS encoded material. Uncompressed Dolby/DTS or Bluray material require a HDMI connection. The more common mono or analog stereo cables cannot carry Dolby/DTS signals.

With a default installed ALSA installation, it is possible for a S/PDIF or HDMI connection to work out of the box (no .asoundrc file alterations). While only some applications, such as the web browser's Adobe Flash plugin will fail playing sound. As such, the below .asoundrc is usually required for most S/PDIF and HDMI connections. Also, any media applications open will need to be restarted for the .asoundrc files to take affect (i.e. web browsers using the Adobe Flash plugin).

Preference for connections versus media types

அடிப்படை அலைமருவி

அடிப்படை அலைமருவி (அதாவது RCA) தொடர்புகள் - அடிப்படை பயனர். DAC ஒலி அட்டையின் தரத்தை சார்ந்துள்ளது. அதிக SNR db அளவுள்ள ஒலி அட்டையை தேர்ந்தெடுக்கவும்.

S/PDIF

S/PDIF provides good quality audio for music, videos, and DVD quality movies containing Dobly/DTS compressed signals. Most sound cards and motherboards, these days, provide some sort of S/PDIF port. Nowadays, it is more common to see S/PDIF Toslink ports on motherboards. Many computer games provide compressed Dolby/DTS signals.

S/PDIF எண்மின் (அச்சொன்றிய)

S/PDIF எண்மின் (அச்சொன்றிய) யில் மின்னழுத்த குறுக்கு பேச்சில் சில சிக்கல்கள் இருப்பினும் சிறிய Jack அல்லது RCA அச்சொன்றிய கம்பிவடம் மட்டும் இதற்கு போதும் என்பதால் பொதுவான விருப்பமாக இது உள்ளது.

S/PDIF ஆப்டிகல் (Toslink)

S/PDIF (TOSLINK) optical cable completely avoids possible electrical cross talk or interference among cables since it is fiber optic, however it is susceptible to signal degradation if the cable is bent too much. Audiophiles tend to favor this type of cable.

HDMI

HDMI (High-Definition Multimedia Interface) cable can carry compressed Dolby/DTS and uncompressed (i.e. Blu-ray) Dolby/DTS signals. The audio market has favored this connection, but still preserves S/PDIF connections. One concern being, HDMI cables are copper wire, still susceptible to electrical cross talk or interference, similar to S/PDIF Digital Coaxial connections.

HDMI optical cables are produced, but they are generally too expensive for the consumer market. If audiophiles have S/PDIF Optical ports, they will use the S/PDIF connections for other media such as music and DVD movies, while only using HDMI when needed for processing uncompressed Dolby/DTS encoded material such as Blu-ray media. Again, the basic user will likely just use HDMI, avoiding the fuss of changing configuration files.

உள்ளமைவு

எண்மின் வெளியீட்டு சாதனத்தை தேடவும்:

user $aplay --list-devices

அட்டை/சாதன எண்ணை பயன்படுத்தும் வகையில் கீழுள்ள கோப்பை சரிசெய்யவும்.

{{FileBox|filename=~/.asoundrc|1= pcm.!spdif {

    type hw
    card 0
    device 1

}

குறிப்பு
The above will not allow sound to be played from more than one sound application, or more than two sounds played at once through one sound card. In order to perform this task, the sounds are remixed with a slight degradation with sound quality. Most people listening to music, prefer not to allow this due to interruptions and decreased sound quality. However, for those that desire this, the above commented section of code will achieve this.
குறிப்பு
When playing sound files using aplay, the beginning of the playback will be clipped because the digital S/PDIF or HDMI connection is not held open and needs to be started each time a sound file is played. Notice Microsoft Windows both, holds open the receiver or DAC and remixes media on playback.

A/52, AC3, Dolby, DTS

Sound cards providing S/PDIF output can pass through lossy compressed multichannel audio. To my ears, the high bit rate compressed media has little loss in comparison to two channel CD or DVD audio. I surmise this is because we now have multichannels feeding multiple speakers. Hence, the more hardware, the equivelant or better sounding?

If a sound card states it has S/PDIF, it will likely pass through Dolby or DTS even though it does not specifically show a Dolby or DTS icon or listed within its features. This is because, when they do list Dolby or DTS, it is because they're providing software for upmixing, or providing the decoded signal through analog output.

HDMI will pass through uncompressed multichannel audio, but a video feed is interleaved as required by the HDMI specification. In comparison to DVD video and audio, I see and hear very little quality difference, if any! About the only thing I noticed between S/PDIF Toslink and HDMI, HDMI seems to amplify the signal by a few watts or 5db. (I conclude this is because of the higher bit rate?)

As such, S/PDIF is still quite popular, even today.

குறிப்பு
மேம்பட்ட குறிமுறையேற்றங்களை கடந்து செல்வதற்கு ஒரு S/PDIF அல்லது HDMI இணைப்பு தேவைப்படுகிறது. RCA மற்றும் minijacks போன்ற அலைமருவி இணைப்புகள் எந்தவொரு மேம்பட்ட குறிமுறையேற்றங்களையும் ஆதரிப்பதில்லை.

Decoding or encoding to Dolby or DTS requires a license. If you have already purchased a sound card with this multichannel support, then you likely already have a license. See this article for more information.

A/52 (pcm.a52encode) உட்செருகு உடன் கூடிய ffmpeg USE கொடியைச் சேர்ப்பதற்காக ALSA media-plugins/alsa-plugins தொகுப்பானது மறு-தொகுக்கப்பட வேண்டும்.

root #USE="ffmpeg" emerge -q media-plugins/alsa-plugins

குறிமுறையுணர்தல் மற்றும் மறுஇயக்கம்

ALSA நிரலகங்களை சேர்க்க mplayer அல்லது வேறு விரும்பிய ஒலி இயக்கியை மறு-தொகுக்கவும்.

root #USE="a52 dts" emerge -q media-video/mplayer

mplayer.conf இல் பன்முக-அலைத்தட புரிப்பிகளை சேர்க்கவும், இதனால் இயக்கப்படும் ஊடகத்திற்குக் கீழ்-கலக்குதல் அல்லாது முதலில் வன்பொருள் கடந்துசெல் விருப்பத்தேர்வுகளை அளிக்கிறது.

கோப்பு /etc/mplayer/mplayer.conf
ac=hwac3,hwdts,hwmpa,spdifac3,spdifeac3,spdifaac,spdifdts,spdifmpa,spdifthd,dts,ffaac,

இப்போது உங்களால் பெறுநருக்கான S/PDIF மூலம் ஏறத்தாழ எல்லா Dolby அல்லது DTS குறிப்பலைகளை கடந்து சென்று ஒலியைக் கேட்டு மகிழ இயலும்.

A/52 க்கு குறிமுறையேற்றுதல்

இரு அலைத்தட ஒலியை A/52 பன்முக-அலைத்தட ஒலியோடையாக மேல்-கலக்குதல்

To simulate A/52 encoded audio from normal one or two channel audio streams or files, ALSA can upmix using its A/52 plugin. (A/52 is also known as AC-3 or Dolby Digital encoding.)

A/52 upmixing preferred when playing computer games or watching video without Dolby/DTS encoded material, such as older Movies. Many sound card manufacturers provide their applications with a feature for software upmixing to Dolby Digital, and recommend enabling this upmixing when listening to such media, except for Music.

Upmixing to A/52 is frowned upon by audiophiles. As such, it is a user's preference to upmix all the sounds to A/52 before sending the stream to the consumer stereo receiver or DAC. Matter of fact, audiophiles prefer simple stereo, and further state stereo is still better quality than Dolby/DTS material or other audio encoded with gimmicks. Also, the consumer stereo or DAC likely possibly includes a feature for upmixing audio into five channel audio.

{{FileBox|filename=~/.asoundrc| pcm.!default {

   type plug:surroundaudio

}

user $speaker-test -Dsurroundaudio -c 6
PCM 5.1 24-இருமி ஒலியை A/52 16-இருமி ஒலியோடையாக குறிமுறையேற்றுதல் (S/PDIF மூலம் ஒலியை கேட்டு மகிழ்வதற்கு)

Also known as, encoding PCM 5.1 audio stream into a compressed Dolby Digital stream for playing over S/PDIF. No real need to use this if you're using HDMI, as HDMI can handle the bandwidth of a PCM 5.1 audio stream. S/PDIF Toslink has also supposedly been upgrade to do so also, but most hardware has yet to be upgraded to the new specifications, and some doubt it will ever happen.

For some reason, the previous .asoundrc section previously mentioned doesn't work with PCM 5.1 streams. Another issue I run into with 24 bit PCM 5.1 audio streams, they require downmixing from S24_LE to S16_LE bit format. Reason being, 24 bit is a common format for most media, however receivers can sometimes only decode 16 or 32 bit audio. Also, the S/PDIF can only handle 16 bit audio when encoding to multi-channel formats such as A/52, for the time being until S/PDIF TosLink hardware specifications are upgraded.

The following .asoundrc excerpt will encode a PCM 5.1 24 bit stream into a 16 bit A/52 stream, for streaming over S/PDIF.

கோப்பு ~/.asoundrc
#####
# விளக்கம்: இது a52 வை PulseAudio உடன் பயன்படுத்துவதை வாய்ப்புள்ளதாக
#          செய்கிறது. இது மற்ற பயன்பாட்டு வழக்குகளுக்கும் பயனுள்ளதாக அமையும்.
#          இதை ~/.asoundrc கோப்பில் சேர்க்கவும்.
&lt;/div&gt;

{{Cmd|aplay -D pcm.a52 /home/me/Music/Led_Zeppelin/Celegration_Day/PCM51-24bit/*.wav}}

=== 2 அல்லது அதற்கு மேற்பட்ட சாதனங்களுக்கு ஒலியை குளோன் செய்தல் ===

&lt;div lang="en" dir="ltr" class="mw-content-ltr"&gt;
Sometimes you need to clone audio (example using 2 cloned screens with different inputs (first screen HDMI and second screen DVI + Analog audio)).
This is a simple script that you can use as global or local configuration for clone 2 (or more) channels.
You must adjust to your system the lines below commented lines.
More information of the author of the script and forum discussion [https://forums.gentoo.org/viewtopic-t-902670-start-0.html here.]
&lt;/div&gt;

&lt;div class="mw-translate-fuzzy"&gt;
{{FileBox|filename=/etc/asound.conf|&lt;nowiki&gt;
ctl.!default {
   type hw
   #உங்கள் முன்னிருப்பு அட்டையை அமைக்கவும்
   card 0
}
&lt;/div&gt;

=== JACK ஒலி இணைப்பு கருவிப்பெட்டி ===

&lt;div lang="en" dir="ltr" class="mw-content-ltr"&gt;
Jack provides an additional layer, to the already low latency ALSA drivers and applications, and further it guarantees a constant sound latency and synchronous operation of all its clients. Jack can only use one sound card at a time, and will provide separated outputs and inputs for each audio channel of the sound card. Jack further provides the ability to view, manipulate or pipe audio streams, both hardware and software streams, in a similar manner we use cables to interface different audio equipment. As example, [http://jamin.sourceforge.net JAMin] can intercept an audio stream before exporting the stream to another audio application and/or through analog or S/PDIF outputs.  The Jack user owned daemon, is usually started using [https://qjackctl.sourceforge.io/ qjackctl]. The qjackctl utility provides many other functions including audio stream connections.
&lt;/div&gt;

&lt;div lang="en" dir="ltr" class="mw-content-ltr"&gt;
What Jack does not do, is handle A/52 encoded (AC-3 or Dolby/DTS) material on input; it is just a sound server that deal with separated channels of audio streams. And it has the capability to connect simultaneously and synchronously any output stream on any input, and any input to any output stream, that on any hardware and software audio component, and with a constant latency. This make JACK an outstanding tool for audio production and creation. The [https://sonosaurus.com/ac3jack/ ac3jack] tool can be used for encoding multiple separated audio channels to AC-3 streams.
&lt;/div&gt;

&lt;div lang="en" dir="ltr" class="mw-content-ltr"&gt;
When playing an A/52 encoded media, the player will request as many outputs from JACK than audio channels in the media. This will fail if your sound card doesn't have the requested amount of audio outputs, but will be fine otherwise. As example, you can use {{c|mplayer}} as usual, and configure it to output a 5.1 stream on a 7.1 output configuration, or a 7.1 stream on a 2 channels stereo output.
&lt;/div&gt;

&lt;div lang="en" dir="ltr" class="mw-content-ltr"&gt;
One solution is to configure your kernel and ALSA according to Jack installation instructions for providing low latency audio. Since ALSA is said to be already very efficient and low latency, providing very good quality playback with no additional mixing when stated within its {{Path|.asoundrc}} file, unlike MS Windows, Jack probably isn't needed for most. The main audience of JACK is audio producers and musicians (in studio, live performances, DJ, ...). (The ac3jack package is currently hosted by the pro-audio overlay available with eselect-repository.)
&lt;/div&gt;

&lt;div lang="en" dir="ltr" class="mw-content-ltr"&gt;
It is possible to interconnect JACK and ALSA. At that time of writing, the best solution is via the snd-loopback module and zita-*2* bridge. For that, see [https://web.archive.org/web/20220314041206/https://proaudio.tuxfamily.org/wiki/index.php?title=DAW_Digital_Audio_Workstation#Using_an_ALSA_Loopback_device_and_zita-ajbridge Using an ALSA Loopback device and zita-ajbridge] on the ProAudio Gentoo overlay wiki.
&lt;/div&gt; 

&lt;div lang="en" dir="ltr" class="mw-content-ltr"&gt;
Using zita-ajbridge, it is also possible to add additional real sound cards into JACK. (Example needed)
&lt;/div&gt;

&lt;div lang="en" dir="ltr" class="mw-content-ltr"&gt;
Those who want to try JACK must know one thing: if you are happy with pulseaudio, you don't need to setup a realtime kernel for JACK. You will need rt operations only if you want to make a Digital Audio Workstation (DAW) with your computer, which necessitate something pulseaudio is not able to achieve: constant sound latencies as low or lower than 20 msec (pulseaudio is not able to provide constant sound latency at all), and synchronous operations. But if you want to make a DAW, JACK is definitely the way to go, and you will never look back.
&lt;/div&gt;

&lt;div lang="en" dir="ltr" class="mw-content-ltr"&gt;
Hopefully this small brief section about Jack will give some quick insight about Jack's features, while reserving the details of Jack to a Wiki page specifically focused on Jack.
&lt;/div&gt;

&lt;div lang="en" dir="ltr" class="mw-content-ltr"&gt;
In the meantime, you can take a look at the [https://web.archive.org/web/20220325210326/https://proaudio.tuxfamily.org/wiki/index.php?title=Main_Page Pro-Audio Gentoo Overlay Wiki].
&lt;/div&gt;

=== அனுமதிகள் ===

&lt;div class="mw-translate-fuzzy"&gt;
&lt;code&gt;acl&lt;/code&gt; USE கொடியானது உலகளாவிய வகையில் செயல்படுத்தப்பட்டு, ஒரு உள்நுழை மறைநிரல் (எ.கா. systemd-logind அல்லது elogind) பயன்படுத்தப்பட்டிருந்தால் (அதாவது, ஒரு ''பணித்தள'' [[Profile (Portage)|தனியமைப்பை]] முறைமை பயன்படுத்திக்கொண்டிருந்தால்), ஒலி அட்டைகளுக்கான அனுமதிகள் தானியக்கமாகக் கையாளப்படும். {{c|getfacl}} மூலம் அனுமதிகளைச் சரிபார்த்துக் கொள்ளலாம்:
&lt;/div&gt;

{{Cmd|getfacl /dev/snd/controlC0 {{!}} grep larry|output=
 &lt;code&gt;user:'''larry''':rw-&lt;/code&gt;
}}

ஒலி அட்டையை அணுக விரும்பும் பயனரை ''audio'' குழுவில் சேர்ப்பது ஒரு சிறந்த தீர்வாகும்:

{{RootCmd|gpasswd -a larry audio}}
{{Cmd|grep audio /etc/group|output=                                                                                                         
&lt;code&gt;'''audio'''::18:larry&lt;/code&gt;
}}

{{Warning|{{c|alsamixer}} ஆனது வேலை செய்ய நீங்கள் வெளி சென்று பின் மீண்டும் உள்நுழைய வேண்டும். இவ்வாறு செய்யவில்லை என்றால் {{c|alsamixer}} ஐ இயக்கும்போது "cannot open mixer: No such file or directory" என்னும் பிழையை நீங்கள் காண நேரிடும்}}

=== சேவைகள் ===

==== OpenRC ====

OpenRC பயனர்கள் ALSA வை உடனே துவக்க {{c|service}} கட்டளையை பயன்படுத்தவும்:

{{RootCmd|rc-service alsasound start}}

ALSA வை முறைமை துவங்கும்போது துவக்க, {{c|rc-update}} என்னும் கட்டளையை பயன்படுத்தி துவக்க ஓடுநிலையில் சேர்க்கவும்:

{{RootCmd|rc-update add alsasound boot}}

==== systemd ====

systemd யில் ALSA வின் நிலை பாதுகாக்கப்பட்டு ஒவ்வொரு முறைமை துவக்கத்திலும் தானியக்கமாக மீட்டமைக்கபடுகிறது.

{{c|systemctl}} என்னும் கட்டளையை பயன்படுத்தி ALSA வின் நிலையை அறிந்து கொள்ளலாம்:

{{RootCmd|systemctl status alsa-restore}}

=== கலப்பி ===

உங்களால் எதுவும் கேட்க முடியவில்லை என்றால், வெளியீடு தடங்களில் ஒலி முடக்கப்பட்டிருக்கலாம். ஒலி முடக்கத்தை நீக்க வரைகலைப் பணிச்சூழலில் உள்ள கலப்பியைப் பயன்படுத்தலாம் அல்லது {{c|alsamixer}} இல் தேவையான தடங்களைத் தேர்ந்தெடுத்து {{Key|M}} விசையை அழுத்துவதன் மூலம் ஒலியை முடக்கவோ முடங்கிய ஒலியை மீட்கவோ செய்யலாம்:

{{Cmd|alsamixer}}

== பயன்பாடு ==

=== ஒலிபெருக்கியை சோதித்தல் ===

&lt;div lang="en" dir="ltr" class="mw-content-ltr"&gt;
If everything above is perfect, it should now be able to test the sound card and the speakers. The {{c|speaker-test}} command-line tool from package {{Package|media-sound/alsa-utils}} (this should already be installed as per the previous recommendation).
&lt;/div&gt;

{{Cmd|speaker-test -t wav -c 2}}
 
5.1 சுற்று ஒலி முறைமைக்கான உள்ளமைவு:

{{Cmd|speaker-test -t wav -c 6 -D surround51}}

சோதனையை இடைநிறுத்த {{Key|Ctrl}}+{{Key|C}} என்னும் விசை சேர்க்கையை அழுத்தவும்.

=== ஒலிவாங்கியை சோதித்தல் ===

&lt;div lang="en" dir="ltr" class="mw-content-ltr"&gt;
If needed, select the audio device if no default one is provided and add the &lt;code&gt;--device=hw:0,0&lt;/code&gt; to the incantation of {{c|arecord}}, substituting the CardNumber,DeviceNumber in the integer fields.
&lt;/div&gt;

பின்வரும் கட்டளை வாய்ப்புள்ள சாதனங்களை பட்டியலிடும்.

{{Cmd|arecord --list-devices}}

&lt;div lang="en" dir="ltr" class="mw-content-ltr"&gt;
{{Note|You may also need to unmute the line or microphone channel. Open {{c|alsamixer}} and first select the sound card (i.e. {{Key|F6}}), then press {{Key|F4}} to show the Capture Channels, "left/right cursor keys" to select the "Mic" channel and press {{Key|Space}} to toggle CAPTURE the channel.}}
&lt;/div&gt;

&lt;div lang="en" dir="ltr" class="mw-content-ltr"&gt;
The following will record indefinitely until {{Key|CTRL}}+{{Key|C}} is depressed and provide a default 8000 Hz mono quality recording:
&lt;/div&gt;

{{Cmd|arecord /tmp/test.wav}}

&lt;div lang="en" dir="ltr" class="mw-content-ltr"&gt;
The following will provide will record for two seconds (--duration=2) using DAT 48000 Hz quality (&lt;code&gt;--format=dat&lt;/code&gt;) and display the curses vumeter in stereo (&lt;code&gt;--vumeter=stereo&lt;/code&gt;) and save to {{Path|/tmp/test.wav}}.
&lt;/div&gt; 

{{Cmd|&lt;nowiki&gt;arecord --channels=1 --duration=2 --format=dat --vumeter=stereo /tmp/test.wav

அல்லது விரும்பினால்:

{{FileBox|filename=~/.bashrc|lang=bash|1=

  1. ஒரு தற்காலிக ஒலி கோப்பை பதிவு செய்து பின் பதிவு மீட்பொலிக்க வைப்பதற்கான எளிமையான மேலுறை நிரலாகும்.
  2. பயன்பாடு: arecord-mic இன் காலவளவு

function arecord-mic {

   [[ $1 == *[![:digit:]]* ]] || return
   typeset tmpFile
   tmpFile=$(mktemp --suffix .wav) || return

Notice, arecord cannot record in S24_LE, and is only capable of recording using S16_LE or S32_LE formats. For the human ear, any audio resolutions greater than 24 bit (S24_LE) or 48000Hz are said to be indistinguishable to differentiate using the human ear. Reference Sampling (signal processing) Wikipedia, Audio sampling. Users should also specify channels=1, as all recordings are performed in mono/monaural when typically using the Microphone Input unless recordings are using the stereo Line Input. In order to further encourage arecord to record monaural or only one channel, using the device=plughw:0,0 is further specified. (Alleviates a common problem, microphone/mic playback only occurs on the right or left channels.)

சேமிக்கப்பட்ட கோப்பை மீட்பொலிக்க வைக்க mplayer அல்லது aplay ஐ பயன்படுத்தவும். பொதுவாக நான் "dat" அல்லது குறைந்தது "cd" வடிவத்திலாவது ஒலியைப் பதிவு செய்வேன். திறனை அளவிடும்போது DAT சிறந்ததாக இருக்கும்.

உதவிக்குறிப்புகள்

PaulBredbury's asoundrc file இதில் உள்ள பல உள்ளமைவு விருப்பத்தேர்வுகளுள் ஒன்றை பயன்படுத்தி பார்க்கவும்.

பழுது இடமறிதல்

தனிபயனாக்கப்பட்ட .asoundrc ஆல் Firefox, Chromium மற்றும் YouTube தவிர்த்து மற்ற செயலிகளில் ஒலி கேட்கிறது

உலாவிகள் சில நேரம் ~/.asoundrc இன் அமைப்புகளைப் பற்றிக் குறை கூறலாம். முன்னிருப்பு ஒலி சாதனத்தை நீங்கள் குறிப்பிட்டால் (இப்போதுள்ள பெரும்பாலான கணினிகள் HDMI ஒலி/ஒளி வெளியீட்டைக் கொண்டிருந்து, அலைமருவி மற்றும் HDMI ஒலி வெளியீடுகளை இரு தனி ஒலி அட்டைகளாகக் கருதப்படவும் வாய்ப்புள்ளது என்பதால்), பின்வருவதைச் செய்து பார்க்கவும்:

கோப்பு ~/.asoundrc
defaults.pcm.card <முன்னிருப்பு ஒலி அட்டையின் எண்>
defaults.ctl.card <முன்னிருப்பு ஒலி அட்டை>
குறிப்பு
Since version 52, Firefox has made PulseAudio a hard requirement and dropped support for direct output to ALSA. To enable sound in these versions of Firefox enable the pulseaudio USE flag. See PulseAudio requirement breaks Firefox on ALSA-only systems. This limitation does not affect Firefox (version 52 only) built from sources (www-client/firefox). Chromium is also not immune to problem. Both browsers either depend on pulseaudio to set up correct sample rate or in absence of pulseaudio set sample rate to 48000 as defacto standard in sound card world. So if you have 96000 hz sample rate, downgrade it to 48000 and sound will work once again.

ஒலி அட்டை ஒரு செயலிக்கு தான் கிடைக்கிறது

சில சமயங்களில் ஒரு செயலி எல்லா ஒலி சாதனங்களையும் எடுத்துக்கொள்ளும். இது செயல்திறன் காரணங்களாலும் நிகழலாம்.

Force the use of dmix instead of direct audio output (which is what most things use by default, such as Adobe Flash [which really means the browser] and Wine).

சாதனமானது அட்டை 1 மற்றும் சாதனம் 7 ஆக இருந்தால் (என்னுடைய நிலையில் இது Nvidia HDMI க்கான வழக்காகும்):

{{FileBox|filename=~/.asoundrc| pcm.dmixed {

       type asym
       playback.pcm {
               type dmix
               ipc_key 5678293
               ipc_perm 0660
               ipc_gid audio

Use of ~/.asoundrc is immediate and as long as you are not forcing the use of specific devices in any applications, they either will require a restart or will begin working immediately. One of the best tests is to run Chrome, go to YouTube, open a terminal, run mplayer with an audio or video file and see that you do not get an error about audio (such an error might be 'Device or resource busy').

4.0 ஒலிப்பெருக்கிகளில் உரையாடல் (ஒலிகள்) விடுபடுதல்

If you're using a 4.0 sound card (like an old SB Live!) or 4.0 speakers in general, you may notice that in some games or movies the dialogues are very quiet or even missing. This is because most of those applications/movies support only either 2.0 (stereo) or 5.1 output. In order to achieve surround sound, the 5.1 audio track is used but the two excessive channels are discarded — the center channel (which usually carries dialogues) and subwoofer channel.

The above issue can be circumvented through creating a virtual device which will downmix 5.1 to 4.0, mixing the center and subwoofer channels with other audio channels.

{{FileBox|filename=~/.asoundrc|1= pcm.downmix {

   type route

HDMI/SPDIF 5.1 மற்றும் 7.1 ஒலிப்பெருக்கி சோதனை

It is stated ALSA's speaker-test utility will not test more then two channel audio over HDMI or SPDIF. For this, you need to use mplayer, as quoted from ALSA's documentation.

Download either a 5.1 channel (FLAC) or 7.1 channel (FLAC) speaker test file:

Play the provided sound file; specifying the HDMI or SPDIF device, PCM file, and number of channels which will likely be either 6 (for 5.1 surround) or 8 (for 7.1 channel surround).

5.1 அலைத்தடத்தை mplayer உடன் சோதிப்பதற்கு:

user $mplayer -channels 6 "/பதிவிறக்கப்பட்ட/இருப்பிட/பாதை/flac_கோப்பு.flac" -channels 6

7.1 அலைத்தடத்தை சோதிப்பதற்கு:

user $mplayer -channels 8 "/பதிவிறக்கப்பட்ட/இருப்பிட/பாதை/flac_கோப்பு.flac" -channels 8
குறிப்பு
To test mplayer with a none default device, pass the additional option -ao alsa:device=hw=0.7 where the hw= value is aligned with the appropriate device.

மாற்றாக, VLC ஊடக இயக்கியை கொண்டு சோதித்தல்:

user $cvlc /பதிவிறக்கப்பட்ட/இருப்பிட/பாதை/flac_கோப்பு.flac

APlay SPDIF/HDMI வெளியீடு தவறான ஒலிப்பெருக்கி தடங்களை கொண்டுள்ளது

Now that you know how to use MPlayer to play a speaker test PCM WAV file per "HDMI/SPDIF 5.1 and 7.1 Speaker Testing" above, you now find APlay doesn't output to the speaker channels properly when using SPDIF/HDMI. With HDMI, this is likely caused by the snd_hda_intel HDMI audio module/driver which is used by other manufacturers such as NVidia HDMI aside from just Intel's HDMI hardware. As to why MPlayer does use the correct channels, MPlayer is usually under constant development and manually corrects this issue?

Another problem this solution pertains to, trying to play a 24-bit PCM 2.0 or PCM5.1 WAV files and finding APlay constantly refuses to play the stream, due to incorrect bit rate, etc.

To correct this for ALSA (APlay) with minimal alterations to the PCM streams, we'll need to remap the speaker channels within a ${HOME}/.asoundrc file. Add the following to the bottom of your ${HOME}/.asoundrc file. Also note, the below configuration is for both 5.1 and 7.1 audio, or you could further map/copy the two extra channels to your 5.1 channels incase you do not want to omit the audio from a 7.1 stream.

கோப்பு .asoundrc
pcm.myHDMI {
        type plug slave {
            pcm "hw:1,7"
            format S32_LE
            channels 6 }
        ttable {
            0.0= 1
            1.1= 1
            2.4= 1
            3.5= 1
            4.2= 1
            5.3= 1
            6.6= 1
            7.7= 1
        }
}

It seems that most HDMI to Stereo Receiver connections only stream 16 and 32 bit formats, skipping 24 bit. The above configuration up-mixes any PCM stream to 32 bit when using the pcm.myHDMI profile, as it is quite common to see PCM 2.0 and 5.1 24 bit audio files. It just doesn't seem right to down-mix everything to 16 bit, or use Float as the latter uses more processing power. (Users can also set an alias within their bashrc file for 16 bit or 24 bit incantations as well.)

Test the speaker routing using a surround test PCM file. (See the above previously mentioned "8 Channel Speaker Test".)

user $aplay -D my.HDMI 8Channel.wav

Weak center channel on PCM 5.1 live music

If you have a multi-channel sound track or music with an apparently weak center channel, and the sound track is a live recording; it is possible to map the center channel to the rear channels. Note, the rear channels on live recordings usually contain only the audiance screaming with very little music.

The following incantation of mplayer specifies; your HDMI device of hw:1.7, your PCM 5.1 file, number of channels, the format (not needed if your receiver can natively handle 24 bit and in my case I need to upmix as my Yamaha HDMI receiver can only natively handle 16 or 32 bit audio), and then the mapping. Mapping as follows; specify this is a 6 channel audio stream, with 6 mappings immediately following, copy left front channel to left speaker, copy right channel to right speaker, copy center channel to left rear speaker, copy center channel to right rear speaker, copy center channel to center speaker, and finally copy the subwoofer channel to the subwoofer speaker.

user $mplayer -ao alsa:device=hw=1.7 Music/MyAlbum/PCM51-24bit/01.MyMusic.wav -channels 6 -format s32le -af channels=6:6:0:0:1:1:4:2:4:3:4:4:5:5

MPlayer இன் அலைத்தட கையாளுதலை காணவும்.

Need to view more detailed information per ALSA stream?

If you need to look at an in-depth illustration of how your program is connecting to ALSA, use the /proc interface. You will need to substitute your relevant card/device details into the command below.

user $cat /proc/asound/card2/pcm0p/sub0/*

You should see a dump of information regarding the program and useful things like its sample rate(rate) and PID(owner_pid).

access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 5513
buffer_size: 22050
card: 2
device: 0
subdevice: 0
stream: PLAYBACK
id: USB Audio
name: USB Audio
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 0
state: RUNNING
owner_pid   : 934
trigger_time: 86393.193574796
tstamp      : 86540.250594985
delay       : 17714
avail       : 4602
avail_max   : 7379
-----
hw_ptr      : 6485052
appl_ptr    : 6502500
tstamp_mode: NONE
period_step: 1
avail_min: 5513
start_threshold: 2147483647
stop_threshold: 22050
silence_threshold: 0
silence_size: 0
boundary: 6206523236469964800
user $cat /proc/asound/card2/pcm0p/sub0/*
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 5513
buffer_size: 22050
card: 2
device: 0
subdevice: 0
stream: PLAYBACK
id: USB Audio
name: USB Audio
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 0
state: RUNNING
owner_pid   : 934
trigger_time: 86393.193574796
tstamp      : 86540.250594985
delay       : 17714
avail       : 4602
avail_max   : 7379
-----
hw_ptr      : 6485052
appl_ptr    : 6502500
tstamp_mode: NONE
period_step: 1
avail_min: 5513
start_threshold: 2147483647
stop_threshold: 22050
silence_threshold: 0
silence_size: 0
boundary: 6206523236469964800

உலாவியில் HTML5 இயங்கவில்லை

If there is no sound in any browser used (Firefox, SeaMonkey, Otter Browser, etc.) and ALSA generally works, there is a workaround that might solve this particular issue: try removing the /etc/asound.conf file.

root #mv /etc/asound.conf /etc/asound.conf.old

Restart the browser and test the sound output for HTML5. It might just work now after applying this workaround.

Firefox உலாவியில் HTML5 இயங்கவில்லை

Some system motherboards (i.e. Asus Z87-EXPERT) cause Card 0 to be a MID device instead of a PCM device. The same driver module snd_hda_intel is used for both the MID and PCM cards on this motherboard. For some reason Firefox HTML 5 requires Card 0 of the snd_hda_intel no matter how you change it with asoundrc. You can make flash work using the asoundrc file, but HTML 5 audio is silent.

You must remap the PCM device in Linux as card 0 and remove the changes to asoundrc that were added to make Flash work. This wiki page indicates that you should compile the snd_hda_intel driver into the kernel. Using this configuration you must remap the card 0 and card 1 devices using boot parameters instead of a /etc/modprobe.d/alsa.conf file. For example the following kernel command line option will swap the MID and PCM card indicies so that the default card 0 is the PCM card:

snd-hda-intel.index=1,0

குறிப்பு
The module is named snd_hda_intel, but the boot parameter name is snd-hda-intel.

Laptops with HDMI audio output

Some laptops with an HDMI audio output will map /proc/asound/card0 as HDMI and therefore makes it default output device for applications as stated above in the Firefox section. Another way to remap is to add these two lines to /etc/modprobe.d/alsa.conf

கோப்பு /etc/modprobe.d/alsa.conf
# Set this to the correct number of cards.
options snd cards_limit=2
options snd-hda-intel index=1,0

Verify the order change by checking this command

user $cat /proc/asound/cards
 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xf2534000 irq 45
 1 [HDMI           ]: HDA-Intel - HDA Intel HDMI
                      HDA Intel HDMI at 0xf2530000 irq 46

This method only works if snd-hda-intel is compiled as a module not built-in

IPC semaphore - function not implemented

If you try to run the test procedure, and speaker-test returns an error about a function IPC semaphore not implemented, that is the option to activate in your Kernel :

கருநிரல்
General setup --->
    [*] System V IPC

Headphones jack not working

Sometimes to get headset jack working, additional model information is needed for audio driver. For example, in case of Dell Latitude E7470 laptop with snd-hda-intel driver, this needs to be added to /etc/modprobe.d/alsa.conf:

கோப்பு /etc/modprobe.d/alsa.conf
options snd-hda-intel model=headset-mic

More setup information can be found in Linux kernel documentation Documentation/sound/hd-audio/models.rst.

State restoring udev/alsactl errors on boot

Due to partitioning, encryption, or having a split /usr system, these errors may appear on boot:

root #journalctl -b | grep alsa
 
(udev-worker)[2594]: controlC2: Process '/usr/sbin/alsactl restore 2' failed with exit code 2.
 
(udev-worker)[2611]: controlC0: Process '/usr/sbin/alsactl restore 0' failed with exit code 2.
 
(udev-worker)[2579]: controlC1: Process '/usr/sbin/alsactl restore 1' failed with exit code 2.

To fix the issue, add TEST=="@sbindir@/alsactl" to the following lines of this file like so:

கோப்பு /lib/udev/rules.d/90-alsa-restore.rules
TEST!="/etc/alsa/state-daemon.conf", TEST=="@sbindir@/alsactl", RUN+="/usr/sbin/alsactl restore $attr{device/number}"
TEST=="/etc/alsa/state-daemon.conf", TEST=="@sbindir@/alsactl", RUN+="/usr/sbin/alsactl nrestore $attr{device/number}"

See these references for further details and discussion.[1][2]

இதையும் காண்க

வெளிப்புற வளங்கள்

References