SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-07-13 06:06:56

Hatch
New Member
Registered: 2011-07-13
Posts: 2

Various mpd/mpc and audio issues (snd-hda-intel)

Hi! New to crunchbang and loving it, but I'm having a couple of issues involving audio and mpd/mpc:

1. IMPROVED When I first boot, one of three things happens:

  • I have no sound at all

  • I have sound but the volume control keys I set up have no effect (I set them up using openbox's rc.xml. I can post the exact entries, but I know for a fact they're correct).

  • Everything works exactly as it should. This is definitely the least common situation

To rectify the problem, I reload the snd-hda-intel module using "sudo modprobe -r snd-hda-intel" and "sudo modprobe snd-hda-intel". Sometimes it takes a couple of rounds of doing so to make it work.

IMPROVEMENT:
Per a post I googled up, I edited /etc/rc.local and added the following lines right before 'exit 0':

rmmod snd_hda_intel
modprobe snd_hda_intel

Now I always seems to have sound when I boot, but it still sometimes doesn't recognize my shortcut keys until I modprobe a time or two. I think it's because alsa is not recognizing the device, only OSS is. I have no clue what to do about this.

2. SOLVED! For the most part, only one process can play audio at once. For example, if I'm playing a game with sound and attempt to "mpc play", it says "ERROR: problems opening audio device". If I quit the game, mpc works properly. This can be especially annoying when a process hangs on to control of the audio device even when it's not actually playing audio. IceWeasel does this occasionally, forcing me to quit it, start mpc, then relaunch.

I understand this may be a fundamental limitation of the audio system used in crunchbang, but I'm almost certain I remember hearing pidgin alert noises while listening to music at one point. I could be wrong. Regardless, I have no interest in installing PulseAudio. If that's the only option for mixing multiple audio streams, I'll simply do without.

SOLUTION:
Firstly, as it turns out, this was just a problem with mpd. Streams mix just fine from other sources. To fix it for mpd, I commented out all of the device section in my mpd.conf (in my home folder).

3. I have the following lines in my autostart.sh:

## Start mpd and prepare mpc
(mpd && (mpc ls | mpc add) && mpc random on) &

However, when I first boot, mpc has no songs and the mpd process is owned by, if I recall correctly, user "mpd". I have to sudo to kill it. Once I do so and manually type in the commands from autostart.sh, mpc and mpd behave as expected (once I fix audio issue #1)

Last edited by Hatch (2011-07-13 21:38:22)

Offline

Help fund CrunchBang, donate to the project!

#2 2011-07-13 09:27:17

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,602

Re: Various mpd/mpc and audio issues (snd-hda-intel)

conc #3: mpd is set up to run as a system daemon in Debian.
The daemon runs as user "mpd".
For the "mpc ls" command to work, user "mpd" must have read access to your music directory.

On the other hand, if you want mpd to run as your user, you have to:

cp /etc/mpd.conf ~/.mpd.conf

modify /etc/default/mpd:

## Defaults for the MPD init script, sourced by /etc/init.d/mpd on Debian
## systems.  Uncomment (remove the leading '#') and change values as needed.

## Change this to prevent MPD from being started as a system service (for
## example, if you want to run it from a regular user account)
# START_MPD=true

## The configuration file location for mpd:
MPDCONF=$HOME/.mpd.conf

## Change this to enable/disable debugging
MPD_DEBUG="true"

modify ~/.mpd.conf so that mpd reads your ~/.mpd.conf, logs to a logfile of your own, saves the pid to a file of your own, etc...
Check your mpd.conf thoroughly, replace all system locations by user locations

I suggest you lace all your mpd related files in a dir ~/mpd

Hope this helps...

Last edited by xaos52 (2011-07-13 09:31:17)

Offline

#3 2011-07-13 09:40:07

machinebacon
#! unstable
From: China
Registered: 2009-07-02
Posts: 6,634
Website

Re: Various mpd/mpc and audio issues (snd-hda-intel)

in the mpd configuration file there is a section which defines the audio output:

audio_output { 
         type                    "alsa"
         name                    "My ALSA Device"
         device                  "hw:0,0"     # optional
         format                  "44100:16:2" # optional
}

 

Maybe you need to define the device and the output here. Check that this section has no # in front of the lines. BTW If you have an on-board *and* PCI sound card, you need to disable the on-board sound card, so that the PCI sound card is used only.

Regarding sound from multiple sources: dmix can be used for the digital streams as software mixer, so that multiple streams can be played simultaneously.

Last edited by machinebacon (2011-07-13 09:48:15)

Offline

#4 2011-07-13 21:49:43

Hatch
New Member
Registered: 2011-07-13
Posts: 2

Re: Various mpd/mpc and audio issues (snd-hda-intel)

Regarding issue #1:
Per a post I googled up, I edited /etc/rc.local and added the following lines right before 'exit 0':

rmmod snd_hda_intel
modprobe snd_hda_intel

Now I always seems to have sound when I boot, but it still sometimes doesn't recognize my shortcut keys until I modprobe a time or two. I think it's because ALSA is not recognizing the device, only OSS is. I have no clue what to do about this.

@machinebacon: I only have mainboard audio. At least I think. I mean, I know I have no soundcard, but my graphics may have audio support; I'm not sure. It's an Nvidia GTX 275. How would I go about disabling/blacklisting its modules?

Regarding issue #2:
Fixed! Firstly, as it turns out, this was just a problem with mpd. Streams mixed just fine from other sources. To fix it for mpd, I commented out all of the device section in my mpd.conf (in my home folder). I guess letting it autodetect worked some voodoo magic smile

Regarding issue #3:
I already had my own home folder .mpdconf. Despite tweaking it and /etc/default/mpd, I'm no closer to a fix. Here are the relevant files:

my mpdconf in a pastebin because it's largish: [link]

/etc/default/mpd:

## Defaults for the MPD init script, sourced by /etc/init.d/mpd on Debian
## systems.  Uncomment (remove the leading '#') and change values as needed.

## Change this to prevent MPD from being started as a system service (for
## example, if you want to run it from a regular user account)
# START_MPD=true

## The configuration file location for mpd:
MPDCONF=$HOME/.mpdconf

Last edited by Hatch (2011-07-14 04:15:20)

Offline

#5 2011-07-14 13:06:01

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,602

Re: Various mpd/mpc and audio issues (snd-hda-intel)

Regarding issue #3:
Oh this is a subtle one: your mpd daemon is the system daemon, started by your init scripts.
To prevent the system daemon from starting you have to change your /etc/default/mpd to:

## Defaults for the MPD init script, sourced by /etc/init.d/mpd on Debian
## systems.  Uncomment (remove the leading '#') and change values as needed.

## Change this to prevent MPD from being started as a system service (for
## example, if you want to run it from a regular user account)
START_MPD=false

## The configuration file location for mpd:
MPDCONF=$HOME/.mpdconf

So you should set START_MPD to something different from 'true',
because in /etc/init.d/mpd START_MPD is set to 'true" before sourcing /etc/default.mpd,
and it was not being reset because the START_MPD entry was commented out.

EDIT: They do say: change this to prevent MPD from being started as a system service ...
Commenting out is not considered a change smile

Last edited by xaos52 (2011-07-14 13:17:31)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo