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 09-12-2022, 08:26 AM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,638

Rep: Reputation: 183Reputation: 183
How to check/setup sound from command line


This may be a futile effort ... I have an older 32 bit Sony Vaio VGN-P530H running Slackware 14.2. I use this "computer" as a backup device for several other computers. It also monitors various clients' computers to verify that they're running.

I would like to add speaker output so I get an audible notice when something goes wrong. I've tried "mplayer StarTrekKlaxon.wav" which plays on other system, but on this one I get:
Code:
MPlayer 1.2.1-5.3.0 (C) 2000-2016 MPlayer Team

Playing StarTrekKlaxon.wav.
libavformat version 56.40.101 (internal)
Audio only file format detected.
Load subtitles in ./
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 11025 Hz, 1 ch, u8, 88.2 kbit/100.00% (ratio: 11025->11025)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
AO: [alsa] 11025Hz 1ch u8 (1 bytes per sample)
Video: no video
Starting playback...
A:   0.0 (00.0) of 5.0 (05.0) ??,?% $<50>
Audio device got stuck!
but then it does run the .wav, however no sound. I do have external speakers plugged into the headphone port.

The sound card is
Code:
# lspci
00:1b.0 Audio device: Intel Corporation System Controller Hub (SCH Poulsbo) HD Audio Controller (rev 06)
This device does not have X or KDE running, so I can't use System Settings or pavucontrol. Is there some other way to configure audio? Certainly this device is capable.

THX
 
Old 09-12-2022, 08:50 AM   #2
brobr
Member
 
Registered: Oct 2003
Location: uk
Distribution: Slackware
Posts: 977

Rep: Reputation: 239Reputation: 239Reputation: 239
Have you tried something like `alsamixer`? This might give you some idea where it's stuck.
hth
 
Old 09-12-2022, 01:55 PM   #3
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,638

Original Poster
Rep: Reputation: 183Reputation: 183
For alsamixer I selected card 0 (alsamixer -c 0) which listed:
Code:
Card: HDA Intel MID
Chip: Realtek ALC262
View: F3:[Playback] F4: Capture  F5: All                                                                                          │ Item: Master [dB gain: -12.00]
The bar graphs showed Master: 55%, Headphone 0, Headphone Mic: 0, Headphone Mic Boos: 0, Speaker 100%, PCM: 100%

When I played the .wav again, nothing changed on the bar graphs and no sound.

Does this provide any clues?
 
Old 09-12-2022, 02:01 PM   #4
brobr
Member
 
Registered: Oct 2003
Location: uk
Distribution: Slackware
Posts: 977

Rep: Reputation: 239Reputation: 239Reputation: 239
Do you get a list of options in the top-right: F1 Help; F2: System information; F6: Select soundcard? etc.
If so, maybe you can get some pointers from F2 or F6.
 
1 members found this post helpful.
Old 09-12-2022, 02:12 PM   #5
dhalliwe
Member
 
Registered: Mar 2022
Location: Ontario, Canada
Distribution: Slackware
Posts: 170

Rep: Reputation: 160Reputation: 160
I am on 15.0, so I don't know if 14.2 will react differently, but... For me,

alsamixer -c 0 gets me the HDMI output on my video card.

alsamixer -c 1 gets me the audio on my motherboard's audio chip (Realtek ALC1220).

alsamixer -c 2 gets me an "invalid card index" error.

Do you just have the one sound card showing up if you try different index numbers?

...and lastly, you said "I do have external speakers plugged into the headphone port." How many ports are on the card? Speakers and headphones don't necessarily have the same output voltage specifications and probably should not be mixed. In your alsamixer output, you say that there are headphone channels that are displaying 0 (for both audio output and microphone input), while the "speaker" channel also exists and is at 100%.

Perhaps there is a speaker port that you should be using (best bet)? If not, then perhaps you need to figure out how to get the headphone output increased above 0%?
 
Old 09-12-2022, 02:14 PM   #6
dhalliwe
Member
 
Registered: Mar 2022
Location: Ontario, Canada
Distribution: Slackware
Posts: 170

Rep: Reputation: 160Reputation: 160
I see the F2, F6 options that brobr mentions. F2 will list all cards that exist (not just the one you chose with -c), and F6 will let you switch to any other ones in the system.

...and the bar graphs do not respond to changing audio output - they are just the current settings of the (software) volume control. So 0 means "off".

Last edited by dhalliwe; 09-12-2022 at 02:18 PM. Reason: Additional information.
 
Old 09-12-2022, 04:23 PM   #7
BradReed
Member
 
Registered: Apr 2015
Location: Earth
Distribution: Slackware-current
Posts: 106

Rep: Reputation: 55
If you have external speakers plugged into the headphone jack, and alsamixer says volume for headphone is 0, that could be why you are not hearing anything.
 
Old 09-12-2022, 04:26 PM   #8
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,638

Original Poster
Rep: Reputation: 183Reputation: 183
F2 shows /proc/asound/cards, /proc/asound/devices and a few other selections (version, oss/devicess, timers, pcm). Selecting cards I get:
Code:
0 [MID            ]: HDA-Intel - HDA Intel MID
                     HDA Intel MID at 0x942c0000 irq 19
selecting devices I get:
Code:
 2: [ 0]   : control
 3: [ 0- 0]: digital audio playback
 4: [ 0- 0]: digital audio capture
 5: [ 0- 0]: hardware dependent
33:        : timer
There is only one RCA jack on this device and is clearly marked with the headphones icon. I'll see if I can find some headphones and try with that.

Does anyone have an idea on how to get the headphone output above zero? Clicking all over the bar graph does nothing.
 
Old 09-12-2022, 05:50 PM   #9
SW64
Member
 
Registered: May 2014
Distribution: Slackware
Posts: 262

Rep: Reputation: 123Reputation: 123
Quote:
Originally Posted by mfoley View Post
Does anyone have an idea on how to get the headphone output above zero? Clicking all over the bar graph does nothing.
Hit F1 or H in alsamixer and then Page Down/Page Up.
 
Old 09-12-2022, 05:57 PM   #10
SW64
Member
 
Registered: May 2014
Distribution: Slackware
Posts: 262

Rep: Reputation: 123Reputation: 123
pavucontrol might be easier if your computer is not headless. XFCE, Plasma, etc.
 
Old 09-12-2022, 06:50 PM   #11
dhalliwe
Member
 
Registered: Mar 2022
Location: Ontario, Canada
Distribution: Slackware
Posts: 170

Rep: Reputation: 160Reputation: 160
FYI, in alsamixer, left/right arrows keys will switch which output you are working with. PgUp/PgDn will make large changes in levels (for the current output), and up/down arrow keys will make single-digit changes in output.
 
Old 09-12-2022, 10:43 PM   #12
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,638

Original Poster
Rep: Reputation: 183Reputation: 183
Quote:
Originally Posted by SW64 View Post
Hit F1 or H in alsamixer and then Page Down/Page Up.
OK - figured that out and was able to change the Headphone to 100%. The Speaker was already at 100%. I plugged actual earphones into the jack. Still no sound. This is not looking hopeful
Quote:
Originally Posted by SW64 View Post
pavucontrol might be easier if your computer is not headless. XFCE, Plasma, etc.
This device won't run X.
Quote:
Originally Posted by dhalliwe View Post
FYI, in alsamixer, left/right arrows keys will switch which output you are working with. PgUp/PgDn will make large changes in levels (for the current output), and up/down arrow keys will make single-digit changes in output.
Thanks - figured that bit out.

Maybe the HDA-Intel "card" is not supported?
 
Old 09-13-2022, 02:39 PM   #13
SW64
Member
 
Registered: May 2014
Distribution: Slackware
Posts: 262

Rep: Reputation: 123Reputation: 123
Quote:
Originally Posted by mfoley View Post
This device won't run X.
Hmm. Maybe that is a factor to your sound issue.
 
Old 09-13-2022, 09:05 PM   #14
0XBF
Member
 
Registered: Nov 2018
Distribution: Slackware
Posts: 807

Rep: Reputation: 939Reputation: 939Reputation: 939Reputation: 939Reputation: 939Reputation: 939Reputation: 939Reputation: 939
If your system is using pulseaudio, which was the default in 14.2 (iirc), then its possible that the audio output in pulseaudio is muted. In this case, adjusting the alsa mixer wont change audio volume until you unmute the sink in pulseaudio. The design is that applications send audio to pulseaudio, then pulseaudio sends audio to the alsa device, so when pulse is muted its not sending an output signal at its part in the chain.

The 'pactl' tool is useful to look at for working with pulseaudio from the command line. The 'pactl help' command and man page explain all of pactl's command line usage and is helpful to reference.

You can check if pulseaudio is in use with:
Code:
pactl info
E.g. My system reports info like this, key things I've highlighted (and I removed some id stuff). This is also on Slackware 15.0 instead of 14.2 so the version will differ.
Code:
$ pactl info
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: yes
Client Index: 18
Tile Size: 65472
Server Name: pulseaudio
Server Version: 15.0
Default Sample Specification: s16le 2ch 44100Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.pci-0000_00_1f.3.analog-stereo
Default Source: alsa_input.pci-0000_00_1f.3.analog-stereo
If you confirm you are using pulseaudio then you should check if the sink is muted with the 'get-sink-mute' command. I use the following line to save typing out the full name of the default sink:
Code:
pactl get-sink-mute $(pactl get-default-sink)
Which should report yes/no to whether its muted. If it is muted, you can unmute by setting it to '0' (or 'toggle'), e.g:
Code:
pactl set-sink-mute $(pactl get-default-sink) 0
With that unmuted and alsamixer turned up, you should get a signal output. Good luck.

Edit: Looks like index 0 is also the default sink, so you can just address it with something like 'pactl get-sink-mute 0', instead of getting the string of the full name.

Last edited by 0XBF; 09-13-2022 at 09:08 PM.
 
2 members found this post helpful.
Old 09-14-2022, 11:44 AM   #15
SW64
Member
 
Registered: May 2014
Distribution: Slackware
Posts: 262

Rep: Reputation: 123Reputation: 123
I looked up the manual for your computer. It apparently has a speaker/headphone switch. To turn it on and off, hold down FN and press F2. Volume Down and Volume Up is FN+F3 and FN+F4. Here's the manual link. The URL should take you directly to page 30.

https://www.manualowl.com/m/Sony/VGN...page=30#manual


You may find these commands helpful. Volume warning on the 'tone-440hz.wav' file.
Code:
speaker-test -c 2 -t wav -l 3


sox -n -r 44100 -c 2 -b 16 tone-440hz.wav synth 3 sine 440 gain -12

play tone-440hz.wav

Last edited by SW64; 09-14-2022 at 12:49 PM.
 
1 members found this post helpful.
  


Reply

Tags
audio, slackware 14.2, vaio



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
access a file line by line, and check the length of each line. ddebbie90 Programming 1 02-13-2011 02:31 PM
awk command line: blank line record sep, new line field sep robertmarkbram Programming 4 02-21-2010 05:25 AM
grab the line below a blank line and the line above the next blank line awk or perl? Pantomime Linux - General 7 06-26-2008 08:13 AM
Partition check, check double check Vincentius Linux - General 0 12-25-2004 05:47 AM
Boot disk; check. CD in drive; check. Doesn't work; check. Hal DamnSmallLinux 7 02-04-2004 02:10 AM

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

All times are GMT -5. The time now is 03:34 AM.

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