Pulseaudio

I am a MOC nebie and I am loving it!

Is there a way to make MOC play friendly with other programs in Ubuntu 8.04? It steals all sound. If a program directly use alsa then no other program can be heard. How can MOC use pulseaudio?

afaik MOC use only OSS, ALSA or Jack.
You need to write patch for MOC to use pulseaudio.

Thanks for letting me know. Anyway, It is not a big problem.

I've solved adding these lines to .moc/config:

# Use OSS for Pulseaudio compatibility (run 'padsp mocp')
SoundDriver = OSS, ALSA, JACK

And then running (or setting a shell alias) MOC as:
padsp mocp

And it works perfectly.

--
Giulio : http://pilv.it

Instead of looking for workarounds, learn linux and fix your issue.

> Instead of looking for workarounds, learn linux and fix your issue.

Well, that was really helpful. Thanks a lot.

I'm using MOC with ALSA on two different systems and have never encountered problems when using other audio-applications.
I guess there are some issues with your soundcard/ALSA-driver that should be resolved. If you really want pulseaudio you could try to set it up via JACK. I had a quick glance at the Pulseaudio documentation a few days ago for other reasons and it seems that JACK can be used as a bridge to Pulseaudio.

It depends on your soundcard and configuration. On my laptop there is a problem, my soundcard supports only one audio stream at a time, so there are problems. Solution is to configure dmix (transparent to application) or implement support for pulseaudio/arts etc. in moc.

--
Damian Pietras - MOC developer

I solved my problem using the guide here:

http://ubuntuforums.org/showthread.php?t=776739

Hello,

I use the solution 'padsp mocp' for the bluetooth with pulseaudio. It works, but...

After the song ends, moc stops and go back to the terminal, where it's write : 
"FATAL_ERROR: Can't receive value from the server!"

It's not possible to have a playlist. Do you have any ideas ?

FATAL_ERROR: Can't receive value from the server!

This error from the MOC client process results from the server process having terminated prematurely. Usually, this is as the result of some error at the server and a more explicit reason should be shown wherever your system is configured (in /etc/syslog.conf) to write such messages (/var/log/syslog and /var/log/messages are good candidates). Alternatively, if MOC on your system was configured with --enable-debug set, then there should be a file mocp_server_log produced if MOC is started with the -D option which will contain the same message towards the end.

If neither of these approaches work, then you can run the server (under padsp) in foreground using the -SF command line option and connect to it from a client run separately (and not requiring to be run under padsp). This will display the messages on the terminal from which the server is started.

However, it is possible that padsp is prematurely terminating the MOC server process, and in that case there may be no message issued. It would probably be worth trying this (from the padsp manpage) so that padsp is not managing the MOC server process:

Equivalent to using padsp is starting an application with $LD_PRELOAD set to libpulsedsp.so

Hello,

thanks for the answer. Here is the last lines of the result of "padsp mocp -SF"

nov. 30 09:28:21.991170: server.c:1770 server_loop(): Got 'wake up' nov. 30 09:28:21.991198: server.c:698 send_events(): Flushing events for client 0 nov. 30 09:28:21.991317: ffmpeg.c:1116 decode_packet(): Decoded 627B nov. 30 09:28:21.991350: oss.c:176 oss_read_mixer(): ERROR: Can't read from mixer nov. 30 09:28:21.991372: server.c:273 wake_up_server(): Waking up the server nov. 30 09:28:21.991401: ffmpeg.c:1153 decode_packet(): Copying 9216B (9216B filled) nov. 30 09:28:21.991427: server.c:1770 server_loop(): Got 'wake up' nov. 30 09:28:21.991454: server.c:698 send_events(): Flushing events for client 0 nov. 30 09:28:21.991482: player.c:512 decode_loop(): decoded 9216 bytes nov. 30 09:28:21.991501: player.c:188 bitrate_list_add(): Not adding bitrate 192 at time 1 because the bitrate hasn't changed nov. 30 09:28:21.991515: player.c:580 decode_loop(): putting into the buffer 9216 bytes nov. 30 09:28:21.991586: oss.c:176 oss_read_mixer(): ERROR: Can't read from mixer nov. 30 09:28:21.991610: server.c:273 wake_up_server(): Waking up the server nov. 30 09:28:21.991632: player.c:471 decode_loop(): loop... nov. 30 09:28:21.991647: server.c:1770 server_loop(): Got 'wake up' nov. 30 09:28:21.991672: server.c:698 send_events(): Flushing events for client 0 nov. 30 09:28:21.991698: ffmpeg.c:996 get_packet(): Got 627B packet nov. 30 09:28:21.991793: oss.c:176 oss_read_mixer(): ERROR: Can't read from mixer nov. 30 09:28:21.991814: server.c:273 wake_up_server(): Waking up the server nov. 30 09:28:21.991844: ffmpeg.c:1116 decode_packet(): Decoded 627B nov. 30 09:28:21.991876: server.c:1770 server_loop(): Got 'wake up' nov. 30 09:28:21.991902: server.c:698 send_events(): Flushing events for client 0 nov. 30 09:28:21.991929: ffmpeg.c:1153 decode_packet(): Copying 9216B (9216B filled) nov. 30 09:28:21.991951: player.c:512 decode_loop(): decoded 9216 bytes nov. 30 09:28:21.991965: player.c:188 bitrate_list_add(): Not adding bitrate 192 at time 1 because the bitrate hasn't changed nov. 30 09:28:21.991979: player.c:580 decode_loop(): putting into the buffer 9216 bytes nov. 30 09:28:21.992033: oss.c:176 oss_read_mixer(): ERROR: Can't read from mixer nov. 30 09:28:21.992055: server.c:273 wake_up_server(): Waking up the server nov. 30 09:28:21.992089: server.c:1770 server_loop(): Got 'wake up' nov. 30 09:28:21.992113: server.c:698 send_events(): Flushing events for client 0 nov. 30 09:28:21.992138: player.c:471 decode_loop(): loop... nov. 30 09:28:21.992159: ffmpeg.c:996 get_packet(): Got 627B packet nov. 30 09:28:21.992249: oss.c:176 oss_read_mixer(): ERROR: Can't read from mixer nov. 30 09:28:21.992270: server.c:273 wake_up_server(): Waking up the server nov. 30 09:28:21.992296: ffmpeg.c:1116 decode_packet(): Decoded 627B nov. 30 09:28:21.992322: server.c:1770 server_loop(): Got 'wake up' nov. 30 09:28:21.992346: server.c:698 send_events(): Flushing events for client 0 nov. 30 09:28:21.992371: ffmpeg.c:1153 decode_packet(): Copying 9216B (9216B filled) nov. 30 09:28:21.992390: player.c:512 decode_loop(): decoded 9216 bytes nov. 30 09:28:21.992404: player.c:188 bitrate_list_add(): Not adding bitrate 192 at time 1 because the bitrate hasn't changed nov. 30 09:28:21.992418: player.c:580 decode_loop(): putting into the buffer 9216 bytes nov. 30 09:28:21.992511: oss.c:176 oss_read_mixer(): ERROR: Can't read from mixer nov. 30 09:28:21.992538: server.c:273 wake_up_server(): Waking up the server nov. 30 09:28:21.992564: player.c:471 decode_loop(): loop... nov. 30 09:28:21.992590: server.c:1770 server_loop(): Got 'wake up' nov. 30 09:28:21.992615: server.c:698 send_events(): Flushing events for client 0 nov. 30 09:28:21.992641: ffmpeg.c:996 get_packet(): Got 627B packet nov. 30 09:28:21.992775: ffmpeg.c:1116 decode_packet(): Decoded 627B nov. 30 09:28:21.992807: oss.c:176 oss_read_mixer(): ERROR: Can't read from mixer nov. 30 09:28:21.992853: server.c:273 wake_up_server(): Waking up the server nov. 30 09:28:21.992884: ffmpeg.c:1153 decode_packet(): Copying 9216B (9216B filled) nov. 30 09:28:21.992906: player.c:512 decode_loop(): decoded 9216 bytes nov. 30 09:28:21.992923: player.c:188 bitrate_list_add(): Not adding bitrate 192 at time 1 because the bitrate hasn't changed nov. 30 09:28:21.992942: player.c:580 decode_loop(): putting into the buffer 9216 bytes Assertion 'pa_atomic_load(&(b)->_ref) > 0' failed at pulsecore/memblock.c:682, function pa_memblock_unref(). Aborting. nov. 30 09:28:21.992969: server.c:1770 server_loop(): Got 'wake up' [1] 21096 abort padsp mocp -SF

There's a lot of "ERROR: Can't read from mixer"

If you have any ideas ! Thanks

... and it seems to work !

I tried apt-cache search OSS pulseaudio

and I saw this 2 packages and installed it. After a reboot, it's was OK.

Thank for your reactivity.

After installing osspd,
apt install osspd oss-compat

I found I don't have to use padsp.
This solution seems be alright and stable :

If I want bluetooth , I run Moc with this command :
mocp --sound-driver OSS

If I want the internal speakers , I run Moc with this command :
mocp --sound-driver ALSA

Thanks again for your reactivity. I'll look further for the padsp problem...

This is the smoking gun:

Assertion 'pa_atomic_load(&(b)->_ref) > 0' failed at pulsecore/memblock.c:682, function pa_memblock_unref(). Aborting.

It's not the MOC server which has the problem, it's padsp itself which is failing (and in so doing also killing its children). You should refer the problem to whomever maintains it.

In the meantime, I think the preloading of libpulsedsp.so alternative has a good chance of being successful if the problem does not originate from deeper down within PulseAudio.

Hello,

thank for your answers and reactivity.

Bertrand

It's nice to get feedback to our attempts to help; so often they just disappear into a black hole and we (and anyone else with the same problem) never know whether or not it was resolved.

It would be interesting for you to try the preloading approach just to know whether or not it works as well.

Are you planning on reporting to padsp assertion to them? If so, could you please post the URL to the bug report here for future reference.