0

I have a Debian/Windows 10 dual boot system with a shared Data partition that I mount on /home. The problem is: if I mount anything on /home or on /home/$USERNAME, sound does not work anymore. (See below for how it does not work)

I tried the following things:

  • When I mount /dev/sda5 ($DATA) on /home, sound breaks.
  • When I mount $DATA on /media/$USERNAME/$DATA and then bind it to /home, it breaks.
  • When I mount data as before and bind the $USERNAME subfolder only, still no sound
  • When I bind a random folder on /home or /home/$USERNAME, silence.
  • When I mount $DATA as before and then bind all the subfolders (Documents & co.) individually into /home/$USERNAME, everything works fine.
  • I also added a new user and did the same there, the issue applies there too.
  • I tried reproducing the issue on a Ubuntu USB stick, but I couldn't log in anymore because I messed up the permissions (everything was root and read-only).
  • Same for mounting a smaller FAT32 partition on my drive instead of the NTFS DATA partition.
  • Before Debian I had KUbuntu installed the same way and I don't remember sound ever worked.

I'm using that single working option as a workaround for now, but I'd like to know the root cause and to fix it. The content of the /home folder has no effect on the issue (I previously thought it was tied to some wrong config files). Can anyone reproduce the issue?

Original problem

When I have something mounted, the system does not recognize any sound cards, even if most of the commands (aplay -l and such) do, as before.

I tried getting rid of all old config files I could find, no result. I tried completely purging everything sound-related to re-install it (and almost uninstalled my whole system), but that didn't work either.

(Kind of) fun fact: on the login screen everything still works fine. Audacity works out of the box too, but nothing else I tested (YouTube, Music, Factorio). On windows and Ubuntu live sound works perfectly fine too, so that's not the problem.

Some outputs:

$aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic_1 [HD-Audio Generic], device 0: CX20585 Analog [CX20585 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

$aplay -L

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

$speaker-test

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

$(ps axu | grep pulse)

Debian-+   692  0.0  0.1 889324 11152 ?        Ssl  12:47   0:00 /usr/bin/pulseaudio --daemonize=no
piegames  3742  0.0  0.0  12784   960 pts/0    S+   13:31   0:00 grep pulse

$aplay somefile.wav

ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
aplay: main:788: audio open error: No such file or directory

$paplay somefile.wav

Connection failure: Connection refused
pa_context_connect() failed: Connection refused

pavucontrol says the connection to PulseAudio failed and suggests manually starting it. start-pulseaudio-x11 returns the same as paplay

Alsamixer works fine except that the default device has no useful settings, but switching the device outputs what it should.

The system settings just tell that the didn't find any devices; all options are grayed out.

  • Do you run Pulseaudio? (ps axu | grep pulse). If yes, can you use paplay instead of aplay to playback some wav file? What about pavucontrol? Do you have an ~/.asoundrc file? If yes, update the question with the contents. Anything funny in syslog after you mount /Home? Do you intend to use sound via Pulseaudio, or just via ALSA? – dirkt Jan 14 '18 at 12:28
  • I do not have a ~/.asoundrc file. For the syslog, I have no idea of how to search for information there. Also the drive is mounted on boot since mounting it live does funny things with Gnome. I don't care if PulseAudio of ALSA, I don't even really know the difference. The only thing I care is that in the end I have working sound. – piegames Jan 14 '18 at 12:41
  • Are there any files in /home before you mount anything on it? – dirkt Jan 15 '18 at 22:39
  • Yes, the personal user folders (Documents, Downloads, etc.) you can't delete and the default hidden files. (config and such). I also tried moving all the config to $DATA so then there were really only empty user folders in /home; didn't help. – piegames Jan 15 '18 at 23:26
1

Diagnosis:

You are running a Pulseaudio server under a different useraccount (Debian-+, likely truncated) than your main useraccount (piegames). Pulseaudio is meant to be run as the same user as the one that produces the sound. So on startup, the Pulseaudio server grabs all ALSA hw devices, and those devices are only meant to be open by one process, which is why you can't get sound via ALSA when you run aplay etc. On the other hand, Pulseaudio refuses connections from a different user, which is why you can't get sound via Pulseaudio.

Options:

One could try disabling Pulseaudio completely, but as you seem to want to use Gnome, that might cause consiberable headache.

The other option is to fix your desktop login process, and make sure Pulseaudio is started as the same user as the user that is logged in. I'm not familiar enough with the Debian/Gnome login process to give a step-by-step description. Look at your display manager (gdm?), the login process, and the configuration files involved, find out where it starts Pulseaudio, and fix what needs fixing. Very likely there are some configuration files in /home that screw things up, but it's impossible to guess which ones.

To make sure legacy ALSA applications work with Pulseaudio, you need

pcm.!default pulse
ctl.!default pulse

either in ~/.asoundrc or /etc/asound.conf, so sound gets routed to Pulseaudio via a compatibility layer. This should have been setup by the distro, I don't know what went wrong in your case.

As you will need to dig quite a bit into the bowels of the system, you'll have to know the difference between Pulseaudio and ALSA, and much more, so start reading up ...

Installing different distros over already existing home directories sometimes just doesn't work well.

Alternatively, do a complete Debian install from scratch, including making a new user with home directoy and everything, and copy over your old data only. That means copying configuration files only if you know what they are for.

All options are a bit annoying, but I guess it can't be helped ...

  • I feel like making a drive image backup before trying anything of this out... – piegames Jan 14 '18 at 14:41
  • You always should have a backup of your data, anyway ... And if you can figure out where the login process goes wrong, no need for backup or reinstall. But that requires digging. – dirkt Jan 14 '18 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.