I’ve returned to Arch (YAY!) but I’m still having a slight problem with audio. Last time I was using Pulseaudio and it caused no end of problems. This time I’m going to stick to ALSA. I would like to use my soundcard (Xonar DS) instead of the onboard sound.
The problem I am having is getting it to work across the whole system. My audio player (deadbeef) works fine and I can get mplayer to work as long as I modify the command;
ALSA_CARD=DS mplayer movie_file.avi
How can I set this so I don’t need to do that everytime?
Now mplayer works without any modification to the command but Firefox still has no sound. Also if I play a song in deadbeef I then need to quit the application before mplayer will work again.
Is this something to do with ALSA’s dmix feature?
Output of mplayer with deadbeef still open after a song;
[output omitted]
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 1536.0 kbit/100.00% (ratio: 192000->192000)
Selected audio codec: [ffdca] afm: ffmpeg (FFmpeg DTS)
==========================================================================
[AO_ALSA] alsa-lib: pcm_hw.c:1293:(snd_pcm_hw_open) open '/dev/snd/pcmC1D0p' failed (-16): Device or resource busy
[AO_ALSA] Playback open error: Device or resource busy
Failed to initialize audio driver 'alsa'
Could not open/initialize audio device -> no sound.
Audio: no sound
Starting playback..
[output omitted]
[AO_ALSA] alsa-lib: pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
It looks like the slave is not created, you may want to look at the following:
http://alsa.opensrc.org/AlsaTips#Share_a_single_card_with_multiple_applications
http://alsa.opensrc.org/DmixPlugin
@Mark - I don’t seem to have /etc/asound.conf. Not sure why, I never had to manually set it up when I was installing the system. Should it be created automatically?
@SeZo - Cheers for those links, I will look through them today.
I tried Firefox again last night before I gave up for the evening and Youtube decided to have sound. Not sure what was different as I hadn’t changed anything since the reboot. At least it is working.
I can still hear sound in mplayer after listening to youtube, I just can’t have deadbeef and mplayer at the same time. Not a massive issue as this is a workable solution until I can get them to share the card. At least I’ve got sound!
Cheers for the help guys, I’ll have another look tonight after reading up on Dmix.