View previous topic :: View next topic |
Author |
Message |
Dheath Tux's lil' helper
Joined: 06 Aug 2006 Posts: 131
|
Posted: Thu Aug 20, 2009 6:04 pm Post subject: Pulseaudio: padsp + /dev/dsp busy |
|
|
I have a program in binary that uses /dev/dsp as an audio output. In a matter of fact it can use any audio device under /dev/. I also think it works almost as simply as "cat /dev/urandom > /dev/dsp". It is an old program so it uses OSS. It's name is mplinux.
The problem is that it steals the audio control preventing other applications playing sound.
Before I have used it with aoss and thus preventing it from stealing audio control. Now I have moved to new Gentoo system;
amd64, baselayout2 and Pulseaudio.
So, I tried:
Code: |
$ padsp /home/dheath/ohjelmat/mikropuhe/mplinux
|
which actually works better than without the padsp. The command works well even with other audio devices under /dev/.
The problem is that it steals the audio control:
Code: |
# lsof |grep dev/dsp
mplinux 25739 dheath 5w CHR 14,3 0t0 5355 /dev/dsp
# fuser /dev/dsp
/dev/dsp: 25739
|
Same result is with aoss.
Where could be the problem?
I have changed /etc/pulse/default.pa so that Pulseaudio would not try to auto detect the audio card. The auto detection will not work correctly for some reason.
Code: |
load-module module-alsa-sink sink_name=dmx_out device=hw:0 channels=10
channel_map=left,right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7
load-module module-alsa-source source_name=dmx_in device=hw:0 channels=12 channel_map=left,right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8,aux9
|
I have also problems with mplayer. When I use parameter "-ao pulse" the video and audio are jerky separately. It seems that mplayer uses OSS and thus steals the audio control. The difference with the mplinux is that the padsp actually work with mplayer. |
|
Back to top |
|
|
comprookie2000 Retired Dev
Joined: 25 Jul 2004 Posts: 925 Location: Sun City Center, Florida
|
Posted: Fri Aug 21, 2009 5:12 pm Post subject: |
|
|
I followed this guide;
http://duckzland.ismywebsite.com/about/pulseaudio-and-gentoo/
Mine is a little different as I don't start pulseaudio system wide with;
Code: |
/etc/init.d/pulseaudio start
rc-update add pulseaudio default
|
Here are my files;
http://dwabbott.com/pulse/
For mplayer look at mplayer.conf, the real location of that file is /etc/mplayer/mplayer.conf
It seems to be working fine, I do have the latest;
Code: |
[ebuild R ] media-sound/pulseaudio-0.9.15-r51 USE="X alsa asyncns avahi bluetooth caps dbus glib hal oss tcpd -gnome -jack -libsamplerate -lirc (-policykit) -test" 0 kB
|
I even have audacity working with dmix for output;
http://dwabbott.com/downloads/audacity.png
And I do use gnome so;
gnome-volume-control
select your input and output devices
gstreamer-properties
select PulseAudio Sound Server
Also either the pulse user needs to be in plugdev, or
pulseaudio needs to install a dbus policy file to allow access.
http://pulseaudio.org/ticket/582 _________________ http://dev.gentoo.org/~dabbott/ |
|
Back to top |
|
|
Dheath Tux's lil' helper
Joined: 06 Aug 2006 Posts: 131
|
Posted: Sun Aug 23, 2009 11:41 pm Post subject: |
|
|
Thank you. All that will be useful. Mplayer works now with pulse audio. Sadly though it did not solve the real problem.
I changed my system using the /etc/init.d/pulseaudio service. I also checked everything trough and nothing seems to be out of order, expect that I can not find gstreamer-properties even tough media-plugins/gst-plugins-pulse is installed.
Also I actually found another program with the same problem: AudioOverload.
I think that the easiest way of reproducing my problem is doing:
$ padsp cat /dev/urandom > /dev/dsp
Expeced results:
Code: |
# lsof |grep dev/dsp & lsof |grep dev/snd
[1] 12064 12065
[1] + done lsof |
exit 1 grep --colour=auto dev/dsp
pulseaudi 12006 pulse mem CHR 116,10 3992 /dev/snd/pcmC0D0p
pulseaudi 12006 pulse 21u CHR 116,10 0t0 3992 /dev/snd/pcmC0D0p
pulseaudi 12006 pulse 26u CHR 116,8 0t0 3674 /dev/snd/controlC1
pulseaudi 12006 pulse 32u CHR 116,8 0t0 3674 /dev/snd/controlC1
|
Or something similar that has only pulseaudio taking control.
Actual results:
Code: |
# lsof |grep dev/dsp & lsof |grep dev/snd
[1] 12072 12073
cat 12071 dheath 1w CHR 14,3 0t0 5366 /dev/dsp
[1] + done lsof | grep --colour=auto dev/dsp
pulseaudi 12006 pulse 26u CHR 116,8 0t0 3674 /dev/snd/controlC1
pulseaudi 12006 pulse 32u CHR 116,8 0t0 3674 /dev/snd/controlC1
|
Why does not padsp handle this properly?
Neither -d (debug) nor pulseaudio output anything. It is as if the padsp has never been used.
my /etc/pulse/default.pa:
Code: |
.nofail
load-sample-lazy pulse-hotplug /usr/share/sounds/startup3.wav
load-sample-lazy pulse-coldplug /usr/share/sounds/startup3.wav
load-sample-lazy pulse-access /usr/share/sounds/generic.wav
.fail
load-module module-alsa-sink sink_name=dmx_out device=hw:0 channels=10 channel_map=left,right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7
load-module module-alsa-source source_name=dmx_in device=hw:0 channels=12 channel_map=left,right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8,aux9
load-module module-native-protocol-unix
load-module module-volume-restore
load-module module-default-device-restore
load-module module-rescue-streams
load-module module-suspend-on-idle
|
Notice that I do not load module-hal-detect because it starts using only the integrated audio output and gives something like:
Code: |
E: alsa-util.c: Error opening PCM device hw:0: Device or resource busy
E: module.c: Failed to load module "module-alsa-sink" (argument: "device_id=0 sink_name=alsa_output.pci_1412_1712_sound_card_0_alsa_playback_0"): initialization failed.
|
If I load module-detect I get something similar and there is no sound.
With:
Code: |
load-module module-alsa-sink sink_name=dmx_out device=hw:0 channels=10 channel_map=left,right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7
load-module module-alsa-source source_name=dmx_in device=hw:0 channels=12 channel_map=left,right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8,aux9
|
I get only the audio from my PCI audio card. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|