Can't set audio format: Invalid argument

Whenever I try to play something in MOC I get this error in the bottom "status bar", then the program tries the next song in the playlist, I get the same error, and so on. I have not been able play anything with MOC on this computer. I have tried playing multiple song formats, various mp3s and flac. Every other program plays music just fine (mpg321, flac123, play, xmms, beep-media-player...)

OS: Debian unstable
Kernel: custom vanilla
Arch: PowerPC, Apple "dual-usb" white G3 iBook
Soundcard: internal Apple one (OSS, DMASOUND_PMAC, sound/oss/dmasound)

Relevant (consecutive) lines of mocp_server_log:
Feb 2 16:52:43.866325: audio.c:234 sfmt_best_matching(): Choosed 16-bit signed little-endian as the best matching 24-bit signed (as 32-bit samples) little-endian
Feb 2 16:52:43.866484: oss.c:57 open_dev(): Audio device opened
Feb 2 16:52:43.866633: server.c:518 server_error(): ERROR: Can't set audio format: Invalid argument

I have tried both Debian packages, the one in Debian unstable (2.3.3-1) and the development one from your site (2.3.3+2.4.0-alpha2-2) though I have not been able to compile the subversion code myself. Something with "underquoted definition of AM_PATH_LIBXOSD" and "LIBTOOL is undefined". Whatever.

Is this the right place to report a bug?


Please send me mocp_server_log file (how to generate it:, maybe I could help, but I suspect I can't reproduce it on my computer. As a workaround you can try ALSA instead of OSS.

Damian Pietras - MOC developer

Here's the full mocp_server_log:

I can't use ALSA, this soundcard has a OSS driver only.

Edit: ok, since you're not going to be able to reproduce this on your machine, I've done some debugging myself. Although I can't compile moc with debug symbols (I can't compile it at all) using strace and gdb I managed to see that the ioctl at oss.c:258 is being called with req_format==0x20 (AFMT_S16_BE) and it fails with errno==EINVAL.

The funny thing is that AFMT_S16_BE isn't even mentioned in oss_set_params!

One thing that I have noticed is that other programs, such as flac123, which work correctly on my hardware, never call that ioctl with any other argument than AFMT_QUERY. I guess they don't even try to set the sample format, knowing that some drivers refuse to cooperate. They probably just query for the current format and do the conversion themselves.

How did you compile the Debian source?

The path to source is always uphill ;-)
Moc's Debian maintainer

Maybe my English is not so good: I can't compile MOC at all.
Not from tarballs, not from SVN.

To be honest I didn't try too hard. I gave up after a while and just used strace and gdb on the already compiled (and stripped) binaries inside the Debian packages.

I have tried both the package from Debian unstable and the one at
deb binary-powerpc/

Could you please try
beta 2 binaries. They are patched with oss_be.patch sent from Damian.
I can't test them, 'cause my pb doesn't run an oss soundcard.
The binaries are working well on ppc-alsa ;)


The path to source is always uphill ;-)

OMG they work like a charm!

thank you very much Damian and Elimar!

If [[ OMG == _O_h _m_y _g_od ]]<br /> then<br /> DAMIAN == god<br /> fi<br />

The path to source is always uphill ;-)

Link to the mocp_server_log is broken (Invalid Link Converter).
Damian Pietras - MOC developer

sorry, try this

Can you try to compile, run, and send me the output of this little test?

to compile:
cc -W -o oss_test oss_test.c

and run:


Damian Pietras - MOC developer


AFMT_S16_LE (0x10)... Invalid argument
AFMT_S16_BE (0x20)... OK
AFMT_S16_NE (0x20)... OK
AFMT_MPEG (0x200)... Invalid argument