Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic:  Alsa sound not working after d-u  (Read 3176 times)

Offline effo

  • User
  • Posts: 36
Alsa sound not working after d-u
« on: 2018/12/01, 12:16:04 »
Two weeks ago I did a huge d-u. No errors, all worked fine. But I can not get any sound in alsa anymore. Sound works fine in KDE.


Code: [Select]
/home/effo> speaker-test   
speaker-test 1.1.7
 
Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave
Playback open error: -2,No such file or directory

This part look suspicious:
Playback open error: -2,No such file or directory

Code: [Select]
/home/effo> cat /proc/asound/cards
0 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                     HDA ATI HDMI at 0xfeb44000 irq 42
1 [Generic        ]: HDA-Intel - HD-Audio Generic
                     HD-Audio Generic at 0xfeb40000 irq 16


Code: [Select]
/home/effo> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 0: ALC887-VD Analog [ALC887-VD Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
 

Any ideas on how to fix this?

Offline finotti

  • User
  • Posts: 269
Re: Alsa sound not working after d-u
« Reply #1 on: 2018/12/01, 14:52:18 »
Did you check levels in alsamixer?

Offline effo

  • User
  • Posts: 36
Re: Alsa sound not working after d-u
« Reply #2 on: 2018/12/02, 13:42:45 »
Yes, levels in mixer are ok.

This is something else here that not is ok. When I try to start mocp I see these errors:

Code: [Select]
home/effo> mocp
Running the server...
Trying JACK...
Trying ALSA...
Trying OSS...
 
FATAL_ERROR: No valid sound driver!
 
FATAL_ERROR: Server exited!

If I open qmmp and try to play a track, I see this:

Code: [Select]
ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave
OutputALSA: Error opening PCM device default
OutputWriter: unable to initialize output
StateHandler: Current state: FatalError; previous state: Stopped
DecoderMAD: deleting input_buf
OutputALSA: setupMixer()
OutputALSA: Failed to find mixer element
StateHandler: Current state: Stopped; previous state: FatalError


Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.345
    • Land of the Buckeye
Re: Alsa sound not working after d-u
« Reply #3 on: 2018/12/02, 15:20:34 »
I lost audio on one of my laptops, an LXQt desktop, about 3 weeks ago now.  Troubleshooting did not find any problem, but sound was gone.

I finally reinstalled all the alsa-related packages, out of X, and then rebooted and it was fixed.
System76 Oryx Pro, Intel Core i7-11800H, SSD 970 EVO Plus;  Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO

Offline piper

  • User
  • Posts: 1.785
  • we are the priests ... of the temples of syrinx
Re: Alsa sound not working after d-u
« Reply #4 on: 2018/12/02, 15:37:11 »
This is a long shot (considering this happened November 03)

You can try and backup

Code: [Select]
/etc/alsa/conf.d
to a different folder/partition/whatever

Then

Code: [Select]
mv /etc/alsa/conf.d{,_bak}
login/reboot


Probably won't work, but worth a try
Free speech isn't just fucking saying what you want to say, it's also hearing what you don't want to fucking hear

I either give too many fucks or no fucks at all, it's like I cannot find a middle ground for a moderate fuck distribution, it's like what the fuck

Offline effo

  • User
  • Posts: 36
Re: Alsa sound not working after d-u
« Reply #5 on: 2018/12/02, 20:32:58 »
Unfortunately you are right piper, it did't help.

I purged alsa-utils and gstreamer1.0-plugins and re-install with no luck. There are libasound2-stuff too, but if I try to purge anything there, there is a lot to be removed.

Are there other packages to re-install...?

Code: [Select]
root@siductionbox:~# dpkg -l | grep -i alsa
ii  alsa-utils                                                  1.1.7-1                      amd64        Utilities for configuring and using ALSA
ii  gstreamer1.0-alsa:amd64                                     1.14.4-1                     amd64        GStreamer plugin for ALSA
ii  libasound2:amd64                                            1.1.7-1+b1                   amd64        shared library for ALSA applications
ii  libasound2:i386                                             1.1.7-1+b1                   i386         shared library for ALSA applications
ii  libasound2-data                                             1.1.7-1                      all          Configuration files and profiles for ALSA drivers
ii  libasound2-plugins:amd64                                    1.1.7-3                      amd64        ALSA library additional plugins
ii  libasound2-plugins:i386                                     1.1.7-3                      i386         ALSA library additional plugins





Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.345
    • Land of the Buckeye
Re: Alsa sound not working after d-u
« Reply #6 on: 2018/12/02, 22:11:35 »
On a working system (amd64 only) my alsa packages are exactly the same as yours except I don't have the i386 versions.

What does

Code: [Select]
inxi -A
show?

You say sound works fine in KDE -- do you mean in the systemsettings > hardware > multimedia > Audio and Video setting?
System76 Oryx Pro, Intel Core i7-11800H, SSD 970 EVO Plus;  Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO

Offline effo

  • User
  • Posts: 36
Re: Alsa sound not working after d-u
« Reply #7 on: 2018/12/02, 22:36:55 »
Code: [Select]
/home/effo> inxi -A
Audio:     Device-1: Advanced Micro Devices [AMD/ATI] Trinity HDMI Audio driver: snd_hda_intel
           Device-2: Advanced Micro Devices [AMD] FCH Azalia driver: snd_hda_intel
           Sound Server: ALSA v: k4.19.5-towo.3-siduction-amd64

I have sound in Chromium and VLC, but no sound in qmmp and mocp

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.345
    • Land of the Buckeye
Re: Alsa sound not working after d-u
« Reply #8 on: 2018/12/02, 22:44:59 »
If the sound test in KDE's systemsettings > hardware > multimedia > Audio and Video setting works (verify that the correct sound playback device for the Music category is at the top of the list), and also since VLC and the browser play sound, it is beginning to sound like bugs in qmmp and mocp, which I do not use and don't know anything about.
System76 Oryx Pro, Intel Core i7-11800H, SSD 970 EVO Plus;  Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO

Offline der_bud

  • User
  • Posts: 1.072
  • member
Re: Alsa sound not working after d-u
« Reply #9 on: 2018/12/03, 00:06:56 »
There is a moc bug report with similar symptoms: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=913277
Du lachst? Wieso lachst du? Das ist doch oft so, Leute lachen erst und dann sind sie tot.

Offline piper

  • User
  • Posts: 1.785
  • we are the priests ... of the temples of syrinx
Re: Alsa sound not working after d-u
« Reply #10 on: 2018/12/03, 00:47:33 »
Last resort

Code: [Select]
killall -9 pulseaudio
apt purge pulseaudio
apt clean;  apt autoremove

reboot.

Code: [Select]
rm -r ~/.pulse ~/.asound* ~/.pulse-cookie ~/.config/pulse
apt install pulseaudio
alsa force-reload
Free speech isn't just fucking saying what you want to say, it's also hearing what you don't want to fucking hear

I either give too many fucks or no fucks at all, it's like I cannot find a middle ground for a moderate fuck distribution, it's like what the fuck

Offline effo

  • User
  • Posts: 36
Re: Alsa sound not working after d-u
« Reply #11 on: 2018/12/03, 20:57:01 »
I did read the bug report on moc and it looks like the same problem. But my guess is that this is not moc related, more an ALSA thing as I have problem with speaker-test:

Code: [Select]
/home/effo> speaker-test

speaker-test 1.1.7

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave
Playback open error: -2,No such file or directory
/home/effo/.config/pulse>

Hmm, "unable to open slave", are we trying to use the wrong device or something like that...?
Let's look at all cards:

Code: [Select]
/home/effo> aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
hdmi:CARD=HDMI,DEV=0
    HDA ATI HDMI, HDMI 0
    HDMI Audio Output
dmix:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Direct sample mixing device
dsnoop:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Direct sample snooping device
hw:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Direct hardware device without any conversions
plughw:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Hardware device with all software conversions
default:CARD=Generic
    HD-Audio Generic, ALC887-VD Analog
    Default Audio Device
sysdefault:CARD=Generic
    HD-Audio Generic, ALC887-VD Analog
    Default Audio Device
front:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    Front speakers
surround21:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
dmix:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    Direct sample mixing device
dsnoop:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    Direct sample snooping device
hw:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    Direct hardware device without any conversions
plughw:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    Hardware device with all software conversions

Ok, I want to use default:CARD=Generic
I'll try it with speaker-test:

Code: [Select]
/home/effo> speaker-test -Ddefault:Generic

speaker-test 1.1.7

Playback device is default:Generic
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 2048 to 16384
Period size range from 1024 to 1024
Using max buffer size 16384
Periods = 4
was set period_size = 1024
was set buffer_size = 16384
 0 - Front Left
Time per period = 2,654912
 0 - Front Left
Time per period = 2,986484

YES - sound!

I can even play music with aplay:
Code: [Select]
/home/effo> aplay --device default:CARD=Generic Muse_-_Please,_Please,_Please,_Let_Me_Get_What_I_Want.wav
Playing WAVE 'Muse_-_Please,_Please,_Please,_Let_Me_Get_What_I_Want.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

So I guess that alsa uses the wrong device as the default one. But why? And how to change that?

Did some googling and found https://www.alsa-project.org/main/index.php/Setting_the_default_device
So listed my cards:

Code: [Select]
/home/effo> cat /proc/asound/cards
 0 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xfeb44000 irq 42
 1 [Generic        ]: HDA-Intel - HD-Audio Generic
                      HD-Audio Generic at 0xfeb40000 irq 16

Then created /etc/asound.conf and added
Code: [Select]
defaults.pcm.card 1
defaults.ctl.card 1

And now mocp and qmmp works!

But I don't like adding random config-files, this feels like a cludge :(

Shall I report my findings somewhere?

Offline piper

  • User
  • Posts: 1.785
  • we are the priests ... of the temples of syrinx
Free speech isn't just fucking saying what you want to say, it's also hearing what you don't want to fucking hear

I either give too many fucks or no fucks at all, it's like I cannot find a middle ground for a moderate fuck distribution, it's like what the fuck

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.345
    • Land of the Buckeye
Re: Alsa sound not working after d-u
« Reply #13 on: 2018/12/03, 21:19:45 »
Using KDE/Plasma, it has been a long time since I had much trouble with audio.  With phonon, phonon-backend-gstreamer, and pulseaudio installed along with the list of alsa packages shown above, you use systemsettings > hardware > multimedia > Audio and Video, choose "Music" under Audio Playback, then under the "Backend" tab you make sure phonon-gstreamer is selected, and under the "Device Preference" tab you use the "Test" button to see which works, and use the up-down adjustment to put the desired device on top of the list.
« Last Edit: 2018/12/03, 21:27:11 by dibl »
System76 Oryx Pro, Intel Core i7-11800H, SSD 970 EVO Plus;  Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO