You are not logged in.

#1 2011-05-15 22:50:57

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Playing two audio sources

My friend and I like to watch the latest episode of our favourite TV show together, we'll call each other up on skype with voice only, then we'll both play the AVI file of the episode at the same time, its easier to make comments about the episode to each other this way than typing out on IM.

This worked in Ubuntu, now that I am using Arch I don't know what settings Ubuntu had by default that I need to replicate.

First, when trying to play anything in MPlayer anyway it would fail, but installing the `alsa-oss` package fixed that.

Now when anything else is already outputting audio I get this message from MPlayer:

Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
[AO OSS] audio_setup: Can't open audio device /dev/dsp: Device or resource busy
mplayer: libao2/audio_out.c:273: old_ao_init: Assertion `!global_ao' failed.


MPlayer interrupted by signal 6 in module: ao2_init
- MPlayer crashed. This shouldn't happen.

Anyone know how to remedy this situation

Offline

#2 2011-05-15 23:59:15

Stebalien
Member
Registered: 2010-04-27
Posts: 1,239
Website

Re: Playing two audio sources

This is more of a workaround than a fix but you can try using PulseAudio (like Ubuntu).

Last edited by Stebalien (2011-05-15 23:59:50)


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C

Offline

#3 2011-05-16 00:03:08

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Playing two audio sources

Stebalien wrote:

This is more of a workaround than a fix but you can try using PulseAudio (like Ubuntu).

+1
Also, check https://wiki.archlinux.org/index.php/Skype#Skype_Sound

Offline

#4 2011-05-16 00:35:23

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: Playing two audio sources

Thanks for the replies. Having set up pulseaudio almost everything works now.

I can play an MPlayer video as well as a YouTube video no problem.

However, when Skype tries to output audio its really, fuzzy, for want of a better word.

Anyone know how to fix that issue, Skype didn't behave like this before.

Thanks

Offline

#5 2011-05-16 02:16:04

jlindgren
Member
Registered: 2011-02-27
Posts: 260

Re: Playing two audio sources

I've never tried using Skype with PulseAudio so I can't help there.  I use ALSA with the dmix plugin for mixing sound from multiple applications (including MPlayer and Skype).  This is the default setup for ALSA and *should* work out-of-the-box (though clearly it didn't for you).  It would help to know the original error message from MPlayer.  "It would fail" is too vague to tell what is going wrong.

Offline

#6 2011-05-16 03:42:37

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Playing two audio sources

jonnybarnes wrote:

[AO OSS] audio_setup: Can't open audio device /dev/dsp: Device or resource busy

/dev/dsp isn't ALSA.

Put in ~/.mplayer/config something like what I use:

ao=alsa:device=headphones

Offline

#7 2011-05-16 04:58:44

jlindgren
Member
Registered: 2011-02-27
Posts: 260

Re: Playing two audio sources

brebs wrote:

/dev/dsp isn't ALSA.

/dev/dsp can be emulated by ALSA for compatibility with old OSS programs.  That is what the alsa-oss package does.  Do your research, man.

brebs wrote:

Put in ~/.mplayer/config something like what I use:

ao=alsa:device=headphones

MPlayer *should* be able to detect ALSA without any user intervention (always has for me).

Edit: Just to clarify, /dev/dsp as emulated by ALSA still bypasses the normal processing route and thus does not support mixing from multiple programs, so I am not recommending its use.  I thought I had said that in my previous post, but apparently not ...

Second edit: My guess is that MPlayer is having trouble with ALSA output and that is why it is trying OSS-style output as a fallback.  So I don't think specifying -ao alsa will suddenly make anything work.  What we need to know is the original error MPlayer printed for jonnybarnes, even before he installed alsa-oss.

Third edit (I'm on a roll): Apparently you get /dev/dsp emulation even without alsa-oss installed; alsa-oss is a compatibility library activated by using a wrapper program called aoss (see https://help.ubuntu.com/community/alsa-oss).  jonnybarnes doesn't mention whether he was using this wrapper or not.  If so, it's strange that MPlayer should still be trying to open /dev/dsp; if not, it's strange that installing alsa-oss should have made any difference at all.  /me is confused.  Waiting for a response from you, @jonnybarnes ...

Last edited by jlindgren (2011-05-16 05:29:07)

Offline

#8 2011-05-16 08:22:53

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: Playing two audio sources

OK, so at the moment, my MPlayer config file has the ao=pulse parameter  in it. Then `mplayer Pocket\ Monsters\ -\ 119\ -\ Don\`t\ Touch\ That\ Dile.avi -v` returns

Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
dec_audio: Allocating 8192 + 65536 = 73728 bytes for output buffer.
MPEG 1.0 layer III, 128 kbit/s, 48000 Hz joint-stereo
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??...
[libaf] Adding filter dummy 
[dummy] Was reinitialized: 48000Hz/2ch/s16le
[dummy] Was reinitialized: 48000Hz/2ch/s16le
Trying preferred audio driver 'pulse', options '[none]'
AO: [pulse] 48000Hz 2ch s16le (2 bytes per sample)
AO: Description: PulseAudio audio output
AO: Author: Lennart Poettering
Building audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le...
[dummy] Was reinitialized: 48000Hz/2ch/s16le
[dummy] Was reinitialized: 48000Hz/2ch/s16le
Starting playback...

and using alsa `mplayer -ao alsa Pocket\ Monsters\ -\ 119\ -\ Don\`t\ Touch\ That\ Dile.avi -v` returns

Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
dec_audio: Allocating 8192 + 65536 = 73728 bytes for output buffer.
MPEG 1.0 layer III, 128 kbit/s, 48000 Hz joint-stereo
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??...
[libaf] Adding filter dummy 
[dummy] Was reinitialized: 48000Hz/2ch/s16le
[dummy] Was reinitialized: 48000Hz/2ch/s16le
Trying preferred audio driver 'alsa', options '[none]'
alsa-init: requested format: 48000 Hz, 2 channels, 9
alsa-init: using ALSA 1.0.24.1
alsa-init: setup for 1/2 channel(s)
alsa-init: using device default
alsa-init: pcm opened in blocking mode
alsa-init: got buffersize=96000
alsa-init: got period size 1500
alsa: 48000 Hz/2 channels/4 bpf/96000 bytes buffer/Signed 16 bit Little Endian
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
AO: Description: ALSA-0.9.x-1.x audio output
AO: Author: Alex Beregszaszi, Zsolt Barat <joy@streamminister.de>
AO: Comment: under development
Building audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le...
[dummy] Was reinitialized: 48000Hz/2ch/s16le
[dummy] Was reinitialized: 48000Hz/2ch/s16le
Starting playback...

I've got very confused by all this audio stuff with ALSA/OSS/PulseAudio.

Those outputs along with audio were the same even if I was playing a YouTube video or not, but I think the YouTube video was using PulseAudio. I'm not sure though =\

Offline

#9 2011-05-16 08:47:21

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Playing two audio sources

I'm not aware of Flash having Pulse support, at least not out of the box. So your entire problem was MPlayer being configured to use OSS. Which means you don't need Pulseaudio, just configure MPlayer accordingly.

Offline

#10 2011-05-16 08:58:30

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: Playing two audio sources

Hmm, OK. When installing PulseAudio it set up its own "/etc/asound.conf" file to get the system to use PulseAudio. I'm assuming I can just edit this to get the system to use ALSA instead off just blindly trying to uninstall a load of PulseAudio packages. Anyone know what I should edit it to in order to use ALSA.

I used MPlayer to play an AVI file and an MP3 file both using `-ao alsa` with success.

EDIT: So I've removed the /etc/asound.conf file, so the system should be using ALSA now, when it was suggested to install PulseAudio, with releavent wiki page said install ossp, so I've removed that. Now when playing a song in Banshee, when I try and play a video in MPlayer it plays without audio, giving this message:

Trying preferred audio driver 'alsa', options '[none]'
alsa-init: requested format: 48000 Hz, 2 channels, 9
alsa-init: using ALSA 1.0.24.1
alsa-init: setup for 1/2 channel(s)
alsa-init: using device default
[AO_ALSA] alsa-lib: pcm_hw.c:1293:(snd_pcm_hw_open) open '/dev/snd/pcmC0D0p' failed (-16): Device or resource busy
[AO_ALSA] alsa-lib: pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
[AO_ALSA] Playback open error: Device or resource busy
Failed to initialize audio driver 'alsa'
Could not open/initialize audio device -> no sound.
Uninit audio filters...

Skype also tells me I have PulseAudio server (local) running and won't let me use anything else, the sound it outputs is still fuzzy.

EDIT2: removed the lib32-libpulse package, trying to work out which package Skype uses to load PulseAudio, Skype opens and plays its login noise without fuzziness, then proceeds to crash/close after a few seconds.

EDIT3: Using PulseAudio, everything seems to work/mix properly. To get Skype working I edited the file /etc/pulse/default.pa:

load-module module-udev-detect
becomes
load-module module-udev-detect tsched=0

Last edited by jonnybarnes (2011-05-16 16:43:50)

Offline

#11 2011-05-16 17:03:33

jlindgren
Member
Registered: 2011-02-27
Posts: 260

Re: Playing two audio sources

[AO_ALSA] Playback open error: Device or resource busy

This sounds like ALSA is not set up to use DMix (the ALSA plugin that mixes audio from multiple programs).  I'm on a Windows machine right now but tonight I can get you a plain vanilla .asoundrc that uses DMix if you would like to try that.

Offline

#12 2011-05-16 18:29:25

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Playing two audio sources

jlindgren wrote:
[AO_ALSA] Playback open error: Device or resource busy

This sounds like ALSA is not set up to use DMix (the ALSA plugin that mixes audio from multiple programs).  I'm on a Windows machine right now but tonight I can get you a plain vanilla .asoundrc that uses DMix if you would like to try that.

Not at all. It can also mean OSS app is holding the sound card locked. Or an ALSA app using hw:0.1 instead of the default alsa device (which is dmixed). An example, I just did mplayer -ao alsa:device=hw0.0 video.avi and I got sound. But running another mplayer I get the same error jonnybarnes gets. Without telling the first mplayer instance to use hw0.0, both instances get sound.

@jonnybarnes: Check Banshee's configuration. Make sure it uses alsa default. Though, if Pulse works for you, ok, use that. It's just that you don't really need it.

Offline

#13 2011-05-16 20:30:27

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: Playing two audio sources

My other issue was after I got pulseaudio set up, trying to get skype working on alsa was unsuccessful, it just crashed every time I opened it.

Offline

#14 2011-05-16 21:44:59

jlindgren
Member
Registered: 2011-02-27
Posts: 260

Re: Playing two audio sources

Gusar wrote:
jlindgren wrote:
[AO_ALSA] Playback open error: Device or resource busy

This sounds like ALSA is not set up to use DMix (the ALSA plugin that mixes audio from multiple programs).  I'm on a Windows machine right now but tonight I can get you a plain vanilla .asoundrc that uses DMix if you would like to try that.

Not at all. It can also mean OSS app is holding the sound card locked. Or an ALSA app using hw:0.1 instead of the default alsa device (which is dmixed). An example, I just did mplayer -ao alsa:device=hw0.0 video.avi and I got sound. But running another mplayer I get the same error jonnybarnes gets. Without telling the first mplayer instance to use hw0.0, both instances get sound.

It could mean one of those things also.  Without access to jonnybarnes's system, all you and I can do is guess.

Offline

#15 2011-05-16 21:46:18

jlindgren
Member
Registered: 2011-02-27
Posts: 260

Re: Playing two audio sources

jonnybarnes wrote:

My other issue was after I got pulseaudio set up, trying to get skype working on alsa was unsuccessful, it just crashed every time I opened it.

This is a known problem; downgrading Skype to version 2.1.0.81 should solve it.

Offline

#16 2011-05-17 11:07:55

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: Playing two audio sources

So what exactly is the known issue in Skype? Thanks for the replys, though at the moment my more pressing concern is why my second hard drive has a read speed of 0.11MB/s.

Until thats sorted I don't think I'll be messing round with my audio, though it'll be nice to get ALSA + dmix working properly. smile

Offline

#17 2011-05-17 17:14:46

jlindgren
Member
Registered: 2011-02-27
Posts: 260

Re: Playing two audio sources

jonnybarnes wrote:

So what exactly is the known issue in Skype?

Maybe I shouldn't have said it's a "known" issue, since everyone seems to have a slightly different experience.  But the fact is that a lot of people have had problems with the program crashing after upgrading from 2.1 to 2.2.
https://bbs.archlinux.org/viewtopic.php?id=116389

Offline

#18 2011-05-19 12:22:12

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: Playing two audio sources

Hey, got my HDD sorted out now, turned out it was a faulty drive.

I have uninstalled skype for now, and all the lib32- dependencies it installed as well as lib32-libpulse. I have also removed my /etc/asound.conf file so my system *should* be using ALSA

Running alsamixer looks promising, where as before it talked about PulseAudio it now has all the different sound levels and they are all unmuted. smile

So my plan is ignore Skype and getting everything else working. I have added ao=alsa to my MPlayer config file and I can have two instances of MPlayer open playing audio which is good.

I can also have MPlayer playing whilst flash is playing audio, and when chromium is playing an HTML5 video.

My last problem is Banshee taking over the soundcard, when Banshee is playing audio MPlayer outputs its usual error message from before:

[AO_ALSA] alsa-lib: pcm_hw.c:1293:(snd_pcm_hw_open) open '/dev/snd/pcmC0D0p' failed (-16): Device or resource busy
[AO_ALSA] alsa-lib: pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
[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

Going to Edit -> Preferences in Banshee doesn't show anything useful.

Banshee also refuses to play if MPlayer is playing a song.

EDIT: SO having learnt that Banshee uses GStreamer I did some googling, I found this site: http://www.gentoo-wiki.info/ALSA/Softwa … igurations.

So I edited the file ~/.gconf/system/gstreamer/0.10/default/%gconf.xml so it now reads:

<?xml version="1.0"?>
<gconf>
        #video stuff
        <entry name="audiosrc" mtime="1305817710" type="string">
                <stringvalue>alsasrc</stringvalue>
        </entry>
        <entry name="audiosink" mtime="1305817710" type="string">
                <stringvalue>alsasink -device=dmix</stringvalue>
        </entry>
</gconf>

Banshee still plays stuff and MPlayer still throws out the same error message sad

Last edited by jonnybarnes (2011-05-19 15:27:56)

Offline

#19 2011-05-19 23:02:05

mandog
Member
From: Peru
Registered: 2008-09-17
Posts: 218

Re: Playing two audio sources

this should sort skype sound https://bbs.archlinux.org/viewtopic.php?id=117822
It did for me


I'm dyslexic Please do not complain about puntuation or spelling and remember most dyslexic people have above average iq.

Offline

#20 2011-05-19 23:13:43

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: Playing two audio sources

I'm hoping Skype will work with ALSA once I install it again, it did originally.

Offline

#21 2011-05-20 21:47:57

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: Playing two audio sources

This is getting really annoying, I've tried different things in my .asoundrc file from various different sites to try and get dmix working. Yet still Banshee/GStreamer hogs my soundcard. Grr!

Offline

Board footer

Powered by FluxBB