Audio using dummy device....

JasKinasis

Well-Known Member
Credits
823
Here's a heads up about an unusual audio related problem I finally fixed on my laptop the other day (running Debian Testing).

A couple of weeks ago I had my laptop plugged into one of our TV's via the HDMI port and had all of my audio routed through the TV so my wife and I could watch some Netflix.

Afterwards, I shut my laptop down and disconnected the HDMI lead. When I restarted my laptop the following day (without the HDMI lead connected), I was unable to get any audio whatsoever.

From opening up some of the systems-settings dialogs from some of the desktop environments I have installed (KDE and openbox) - I could see that pulseaudio was routing all audio through a dummy device and was unable to see/access my laptops built-in sound-card.

I tried reconnecting my laptop to the TV via HDMI and rebooted - the last time the audio was working, it was routed through the HDMI port - so perhaps having my laptop plugged in to my HDMI port would fix it..... But nope - no luck there!

From looking at Alsamixer and some of the other alsa utils - it was evident that alsa was able to see the card and access the levels, but for some reason no sound was getting to Pulse.

Some years ago, I had seen these exact symptoms once before and the solution back then was to issue the command:
Code:
sudo alsa force-reload
When I tried the above command, I got an error message about the 'alsa' command not being found. I eventually found out that the sytemd replacement for the old 'alsa' command is "alsactl". So I issued a few commands to kill pulseaudio and to stop, reconfigure and restart alsa and then restart pulse.

But again, this still did not yield any sound.
Alsamixer and the other alsa tools could see the sound-card and change the levels, mute/unmute channels etc. But Pulse was always routing audio through a dummy device, so there was never any sound.

On and off over the following two weeks, I tried various things to try and figure out what could have gone wrong with my audio-settings. I was convinced that it was some config for Pulseaudio that had gone screwy. So I had a play with those settings and still had no luck.
I messed around with alsa and oss too - again, no luck whatsoever.

Then a few days ago I tried hdajackretask to see if something had messed with the configuration of the inputs/outputs on my sound-card - nothing looked unusual, but I tried messing with the settings anyway. When I tried to save the settings I got an error message about the audio device being busy.

And at this point I had already killed Alsa and Pulse. Using ps, I confirmed that there were no alsa or pulse related processes running - so something else was using my audio device.

So I decided to use 'lsof' to find out what processes were using my sound-card:
Code:
sudo lsof /dev/snd/*
This showed that several audio devices in /dev/snd/ (including the cards main controller) were open by timidity (a daemon for MIDI playback) - I have a few pieces of MIDI software installed, so I need timidity.

Anyway, after killing timidity and restarting Alsa and Pulse - that completely fixed the issue...... That is - until I rebooted!

On reboot, I discovered the same problem again. Timidity had the sound-device open. So I'm guessing that somehow, at boot-time - Timidity was starting up before Pulseaudio and was opening the sound-device.

And because Timidity had the sound device open, Pulseaudio was unable to access the sound-card, so it defaulted to route the audio through a dummy device - resulting in no audio.

So for now, my temporary "fix" is to completely uninstall timidity. Not ideal, but at some point I'll probably try re-installing timidity and see if I can get it to play nicely with the rest of the audio sub-systems, but for now - I'm making do without it!

I'm not sure if the original cause of the problem was related to HDMI being unplugged when I rebooted, or whether there was a system update to timidity the night before it went wrong - which perhaps caused timidity's config to go wonky.

That said, my main tmux terminal session is set up to automatically open a pane which runs a script to update my laptop, so it may well have been that there was an update to timidity that night!

Routing audio through the HDMI port one day and then shutting down and rebooting with HDMI unplugged the next day normally does not cause any issues - I have done this many times in the past without any problems. So perhaps the HDMI audio-routing thing is a red-herring.

I guess I'll be able to work that out for sure when/if I manage to get timidity working properly again! :/

Anyway - this was just a heads up - I'm not looking for help or anything!

So, I suppose the lesson here is:
If you ever lose all audio because of pulse persistently routing it through a dummy device - try using lsof to see if any other processes have the sound-card open.
 
Last edited:


wizardfromoz

Super Moderator
Staff member
Gold Supporter
Credits
1,926
Yeah, I follow all that :confused::rolleyes:o_O

Make friends with Timeshift, Jas, then you can always roll back ;)

If my audio goes cockeyed, I'm coming to you :D

Wizard
 

JasKinasis

Well-Known Member
Credits
823
Ha ha - sadly there's no point rolling back to a backup ATM - my laptops HD is starting to die. All of my current data is backed up and I'm using an external drive to store any new files onto whilst I wait for the HD to finally die. (My lappy's HD cannot be trusted with new things!)

And I'm not sure when I'll be able to get a new laptop HD either. So I'm in a bit of a race against time trying to work out the best way to create a custom Linux distro that I can boot from USB before my HD finally completely dies on me.

As you probably know - I'm not a huge fan of any of the major desktop environments, so I want something that will use dwm by default. Unfortunately there aren't any distros that offer dwm as the default wm, so I'll have to roll my own!

So I plan to try using the minimal Debian net based installer to install a CLI only version of Debian onto one of my USB thumbdrives and then customise it from there (adding X , vim, dwm etc).

Or perhaps I'll just install something like Bunsenlabs onto a thumbdrive and add dwm as an extra WM. IDK.... :/

I could also use Arch, but that would be slightly more work than taking the Debian minimal route.

Either way, I need to do something pretty soon....
 


Members online

No members online now.

Latest posts

Top