LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 04-15-2020, 07:15 AM   #1
ahmedali19
LQ Newbie
 
Registered: Apr 2020
Distribution: Kali Linux
Posts: 17

Rep: Reputation: 0
Post Speakers not working, Default audio device is headphone


I have recently installed Ubuntu 18.04.4 LTS and the default audio device is headphones and my speakers (built-in) are not showing up in sound settings. What's more that the headphone jack of my HP Probook 6550b laptop is broken so I can't test if I am getting audio output or not. How do I setup my speakers? Please guide me properly as I am a beginner in terms of Linux and terminal.
 
Old 04-15-2020, 08:22 AM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,805

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Welcome to LXQ. Some detailed information about your audio hardware and subsystem can be got using a diagnostic script called alsa-info.sh which will then help others to advise further.

Follow this guide about how to run the script in a terminal
https://wiki.ubuntu.com/Audio/AlsaInfo
It will upload the output to an online server. Post the link that it provides here.
 
Old 04-15-2020, 10:43 AM   #3
ahmedali19
LQ Newbie
 
Registered: Apr 2020
Distribution: Kali Linux
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks for your reply Here is the file you asked for:
http://alsa-project.org/db/?f=df9203...e869c142f992fc

Also the situation has changed a little. I followed some steps from another forum regarding this problem and did the following:
Quote:
You need to edit this file /etc/modprobe.d/alsa-base.conf and then add a line in its end. Use the following commands:

sudo gedit /etc/modprobe.d/alsa-base.conf

Now add the following line at its end:

options snd-hda-intel model=generic

Now reboot your computer. It should solve your problem.
After doing this the speakers is showing up in the audio devices and headphones has disappeared but still no audio from the speakers.SS

P.S. I am dual booting Ubuntu with Windows 7
 
Old 04-15-2020, 04:25 PM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,805

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
I'm not sure that was required, as the diagnostic output confirms that the 'snd-hda-intel' driver was loaded at boot automatically. Sometimes particular module options are required, but I'm not sure if that is the case here. The ALSA mixer levels look ok at first glance, and now we should check PulseAudio (sound server that sits on top of ALSA). I note that

Code:
pacmd list-cards
Code:
pacmd list-sinks
You can run a graphical PulseAudio miixer utility called 'pavucontrol'. Start it from the terminal and check the 'Configuration' tab for correct audio profile. This might be needed if sound being sent to HDMI instead of laptop speakers for example, depending on your requirements. If it is not present, it can be installed with
Code:
sudo apt install pavucontrol
 
Old 04-16-2020, 01:18 AM   #5
ahmedali19
LQ Newbie
 
Registered: Apr 2020
Distribution: Kali Linux
Posts: 17

Original Poster
Rep: Reputation: 0
Output:
Code:
ahmedali@AHMEDALI-PC:~$ pacmd list-cards
1 card(s) available.
    index: 0
	name: <alsa_card.pci-0000_00_1b.0>
	driver: <module-alsa-card.c>
	owner module: 7
	properties:
		alsa.card = "0"
		alsa.card_name = "HDA Intel MID"
		alsa.long_card_name = "HDA Intel MID at 0xd4820000 irq 32"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1b.0"
		sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "3b56"
		device.product.name = "5 Series/3400 Series Chipset High Definition Audio"
		device.form_factor = "internal"
		device.string = "0"
		device.description = "Built-in Audio"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	profiles:
		input:analog-stereo: Analog Stereo Input (priority 60, available: unknown)
		output:analog-stereo: Analog Stereo Output (priority 6000, available: unknown)
		output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060, available: unknown)
		output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5400, available: unknown)
		output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (priority 5460, available: unknown)
		off: Off (priority 0, available: unknown)
	active profile: <output:analog-stereo>
	sinks:
		alsa_output.pci-0000_00_1b.0.analog-stereo/#0: Built-in Audio Analog Stereo
	sources:
		alsa_output.pci-0000_00_1b.0.analog-stereo.monitor/#0: Monitor of Built-in Audio Analog Stereo
	ports:
		analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: unknown)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
			properties:
				
		analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)
			properties:
				device.icon_name = "audio-speakers"
		analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-headphones"
		hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: unknown)
			properties:
				device.icon_name = "video-display"
Code:
ahmedali@AHMEDALI-PC:~$ pacmd list-sinks
1 sink(s) available.
  * index: 0
	name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
	driver: <module-alsa-card.c>
	flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: SUSPENDED
	suspend cause: IDLE 
	priority: 9039
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 0.00 ms
	max request: 0 KiB
	max rewind: 0 KiB
	monitor source: 0
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	configured latency: 0.00 ms; range is 0.50 .. 371.52 ms
	card: 0 <alsa_card.pci-0000_00_1b.0>
	module: 7
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "Generic Analog"
		alsa.id = "Generic Analog"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "HDA Intel MID"
		alsa.long_card_name = "HDA Intel MID at 0xd4820000 irq 32"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1b.0"
		sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "3b56"
		device.product.name = "5 Series/3400 Series Chipset High Definition Audio"
		device.form_factor = "internal"
		device.string = "front:0"
		device.buffering.buffer_size = "65536"
		device.buffering.fragment_size = "32768"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		device.description = "Built-in Audio Analog Stereo"
		alsa.mixer_name = "IDT Generic"
		alsa.components = "HDA:111d7603,103c146f,00100202 HDA:11c11040,103c3066,00100200 HDA:80862804,80860101,00100000"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)
			properties:
				device.icon_name = "audio-speakers"
		analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-headphones"
	active port: <analog-output-speaker>

As for running pavucontrol, the following options are present in the configuration tab, which one should I use:
Analog Stereo Duplex
Analog Stereo Output (Currently Selected)
Digital Stereo (HDMI) Output + Analog Stereo Input
Digital Stereo (HDMI) Output
Analog Stereo Input
Off
 
Old 04-16-2020, 02:06 AM   #6
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,805

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Yes, the pacmd output confirms 'active profile: <output:analog-stereo>' is current profile as you've indicated via pavucontrol as well. This current profile (or 'Analog Stereo Duplex') should both provide working sound via the internal laptop speakers.

To exclude PulseAudio-related issues, try generating some sound using these ALSA-specific commands...
Code:
speaker-test
Code:
speaker-test -t wav -c 6
Code:
sudo aplay -D hw:0,0 -vv /usr/share/sounds/alsa/test.wav
This command will temporarily pause PulseAudio explicitly to allow access for the ALSA utility...
Code:
pasuspender -- aplay -D hw:0,0 -vv /usr/share/sounds/alsa/test.wav
Do you here sound being produced with any of these? Report back with the results.

BTW, you can check/adjust the ALSA mixer levels by using
Code:
alsamixer
in a terminal. Press F6 to select the sound card, and adjust from there.

Last edited by ferrari; 04-16-2020 at 02:10 AM.
 
Old 04-16-2020, 03:25 PM   #7
dna9
Member
 
Registered: Nov 2004
Location: Colorado
Distribution: Ubuntu mostly...
Posts: 100

Rep: Reputation: 28
it could be a hardware/mechanical issue. "broken headphone plug" disabling the sound totally. did you have sound before? just asking.
 
Old 04-17-2020, 12:25 AM   #8
ahmedali19
LQ Newbie
 
Registered: Apr 2020
Distribution: Kali Linux
Posts: 17

Original Poster
Rep: Reputation: 0
Sorry for the late reply
I ran the commands the results:
Code:
ahmedali@AHMEDALI-PC:~$ speaker-test

speaker-test 1.1.3

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 192 to 2097152
Period size range from 64 to 699051
Using max buffer size 2097152
Periods = 4
was set period_size = 524288
was set buffer_size = 2097152
 0 - Front Left
Time per period = 10.939272
 0 - Front Left
Time per period = 10.938045
 0 - Front Left
Time per period = 10.937454
 0 - Front Left
Time per period = 10.938479
 0 - Front Left
Time per period = 10.939623
 0 - Front Left
Time per period = 10.942235
 0 - Front Left
Time per period = 10.940009
 0 - Front Left
Time per period = 10.940221
 0 - Front Left
Time per period = 10.941262
 0 - Front Left
Time per period = 10.939872
 0 - Front Left
Time per period = 10.941065
 0 - Front Left
Time per period = 10.938588
 0 - Front Left
^CTime per period = 10.938819
The test kept running on I had to break. But I heard no sound.

Code:
ahmedali@AHMEDALI-PC:~$ speaker-test -t wav -c 6

speaker-test 1.1.3

Playback device is default
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 32 to 349525
Period size range from 10 to 116509
Using max buffer size 349524
Periods = 4
was set period_size = 87381
was set buffer_size = 349524
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE
Time per period = 8.918198
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE
Time per period = 8.700809
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE
Time per period = 8.703000
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE
Time per period = 8.699613
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE
Time per period = 8.702466
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE
Time per period = 8.705745
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE
Time per period = 8.705027
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE
Time per period = 8.711053
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE
Time per period = 8.707423
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE
^CTime per period = 8.711397
Same as the above command kept repeating but no sound

Code:
ahmedali@AHMEDALI-PC:~$ sudo aplay -D hw:0,0 -vv /usr/share/sounds/alsa/test.wav
/usr/share/sounds/alsa/test.wav: No such file or directory

ahmedali@AHMEDALI-PC:~$ pasuspender -- aplay -D hw:0,0 -vv /usr/share/sounds/alsa/test.wav
/usr/share/sounds/alsa/test.wav: No such file or directory
There was a file/directory error in both the commands
 
Old 04-17-2020, 12:28 AM   #9
ahmedali19
LQ Newbie
 
Registered: Apr 2020
Distribution: Kali Linux
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dna9 View Post
it could be a hardware/mechanical issue. "broken headphone plug" disabling the sound totally. did you have sound before? just asking.
No its not a hardware issue since I dual boot with windows 7 and the sound works fine there.

Also some months back I had installed Kali Linux and I had this same sound problem there too. I believe its a driver issue with linux OS.
 
Old 04-17-2020, 01:11 AM   #10
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,805

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
Originally Posted by ahmedali19 View Post
Sorry for the late reply
I ran the commands the results:
Code:
ahmedali@AHMEDALI-PC:~$ speaker-test

speaker-test 1.1.3

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 192 to 2097152
Period size range from 64 to 699051
Using max buffer size 2097152
Periods = 4
was set period_size = 524288
was set buffer_size = 2097152
 0 - Front Left
Time per period = 10.939272
 0 - Front Left
Time per period = 10.938045
 0 - Front Left
Time per period = 10.937454
 0 - Front Left
Time per period = 10.938479
 0 - Front Left
Time per period = 10.939623
 0 - Front Left
Time per period = 10.942235
 0 - Front Left
Time per period = 10.940009
 0 - Front Left
Time per period = 10.940221
 0 - Front Left
Time per period = 10.941262
 0 - Front Left
Time per period = 10.939872
 0 - Front Left
Time per period = 10.941065
 0 - Front Left
Time per period = 10.938588
 0 - Front Left
^CTime per period = 10.938819
The test kept running on I had to break. But I heard no sound.
They are supposed to keep running until you stop them.

Anyway, as you report that you heard no sound, we know the problem is not related to PulseAudio but likely ALSA-related (including driver).
 
Old 04-17-2020, 01:16 AM   #11
ahmedali19
LQ Newbie
 
Registered: Apr 2020
Distribution: Kali Linux
Posts: 17

Original Poster
Rep: Reputation: 0
So do you have any ideas what to do next?
 
Old 04-17-2020, 02:22 AM   #12
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,805

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
1. Check for any errors
Code:
dmesg | egrep -i "snd|firmware"
2. Try using
Code:
options snd-hda-intel model=auto probe_mask=1
in /etc/modprobe.d/alsa-base.conf, and then reboot. Any different?
 
Old 04-17-2020, 05:14 AM   #13
ahmedali19
LQ Newbie
 
Registered: Apr 2020
Distribution: Kali Linux
Posts: 17

Original Poster
Rep: Reputation: 0
My audio is now working
After updating the alsa-base.conf with options snd-hda-intel model=auto probe_mask=1 I rebooted the pc and opened pavucontrol. The default audio device was headphones again but I switched to speakers which it was showing unavailable SS. After that I played some audio and it was working. I think its a bug because of which it is showing my speakers unavailable. Thankyou for your help @ferrari

P.S: If you could report this bug/problem to ubuntu please do so thanks.

Last edited by ahmedali19; 04-17-2020 at 05:16 AM.
 
Old 04-17-2020, 05:55 AM   #14
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,805

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Glad to have been of guidance. This was a tricky one.

Not really sure a bug report is warranted here though - more like a corner case due to a hardware-specific quirk.
 
Old 04-18-2020, 01:29 PM   #15
dna9
Member
 
Registered: Nov 2004
Location: Colorado
Distribution: Ubuntu mostly...
Posts: 100

Rep: Reputation: 28
that's a weird one. funky drivers. glad you got it working.
 
  


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
Sound Plays through Computer speakers only, not headphone jack Knoppixer Linux - Hardware 2 03-01-2018 06:30 PM
No sound in headphone's jack, but I do have sound in Speakers Silverdaz Linux - Newbie 7 09-05-2008 05:12 AM
Low sound from speakers/ No sound from headphone jack with Intel ICH8 Family Audio troydclayton Linux - Hardware 2 03-28-2008 10:18 PM
no sound from speakers or headphone jack in ibm 600e donnyb General 4 03-27-2006 11:37 AM
Headphone plugged in, sound still comes out of speakers tbraun Linux - Hardware 3 01-18-2005 03:36 PM

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

All times are GMT -5. The time now is 12:08 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