Bug 247865 - mikmod doesnt seem to support sound output
mikmod doesnt seem to support sound output
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: mikmod (Show other bugs)
7
All Linux
low Severity low
: ---
: ---
Assigned To: Jindrich Novy
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-11 15:22 EDT by Stas Sergeev
Modified: 2013-07-02 19:21 EDT (History)
2 users (show)

See Also:
Fixed In Version: 3.2.2-6.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-02-25 19:27:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
strace log (9.63 KB, application/octet-stream)
2007-07-12 16:09 EDT, Stas Sergeev
no flags Details

  None (edit)
Description Stas Sergeev 2007-07-11 15:22:19 EDT
Description of problem:
Well, it does look like the mikmod in f7
is built without a support for any audio
output at all.
$ ldd /usr/bin/mikmod
        libmikmod.so.2 => /usr/lib64/libmikmod.so.2 (0x00002aaaaacc6000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002aaaaaf10000)
        libncurses.so.5 => /lib64/libncurses.so.5 (0x00002aaaab114000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aaaab334000)
        libc.so.6 => /lib64/libc.so.6 (0x00002aaaab54e000)
        libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00002aaaab89e000)
        /lib64/ld-linux-x86-64.so.2 (0x00002aaaaaaab000)
$ ldd /usr/lib64/libmikmod.so.2
        libdl.so.2 => /lib64/libdl.so.2 (0x00002aaaaad1b000)
        libc.so.6 => /lib64/libc.so.6 (0x00002aaaaaf1f000)
        /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
No signs of libasound, libesd or whatever.
In a config menu of the mikmod GUI, there is
nothing but a disk writer output.
mikmod -d num doesn't seem to help either.
Am I missing something, or is it really that
it was built without any sound support at all?

Version-Release number of selected component (if applicable):
mikmod-3.2.2-2.fc7

How reproducible:
always

Steps to Reproduce:
1. play something with mikmod
2. listen to the silence
  
Actual results:
Silence, disk writing (wav) at best.

Expected results:
Music.

Additional info:
Comment 1 Jindrich Novy 2007-07-12 01:58:13 EDT
mikmod and libmikmod doesn't have a direct dependencies to sound libraries
because mikmod dlopen()s available sound library (libasound, libgus, etc.) in
runtime automatically when the Configuration/Output Options/Driver is set to
Autodetect. Are you sure you have alsa-libs-devel or esound-devel installed?
Comment 2 Stas Sergeev 2007-07-12 16:09:05 EDT
Do you really mean I need the -devel packages
to only play the music?

Anyway:
$ rpm -q alsa-lib-devel
alsa-lib-devel-1.0.14-0.4.rc3.fc7
$ rpm -q esound-devel
esound-devel-0.2.38-2.fc7

I'll attach the strace log.
There are no signs of loading either libasound
or libesd. It seems to only try /dev/dsp and
nothing more.
Comment 3 Stas Sergeev 2007-07-12 16:09:56 EDT
Created attachment 159091 [details]
strace log
Comment 4 Jindrich Novy 2007-07-13 05:56:50 EDT
Ok, things are a bit clearer now. I assumed there are symbolic links to main
libraries missing while you used esd or alsa driver, because drv_alsa, drv_esd,
etc. tries to dlopen the libesd.so or libasound.so directly which are missing
without the -devel packages installed.

Yes, mikmod tries to open dsp devices and write to them directly. From the
strace output it looks like the /dev/dsp is already used by another process what
prevents mikmod to write in there:

4411  open("/dev/dsp", O_WRONLY)        = -1 EBUSY (Device or resource busy)

In my case mikmod successfully opens /dev/dsp and plays:

open("/dev/dsp", O_WRONLY)              = 4

Suggest to lsof | grep '/dev/dsp' to figure out what blocks the playback via dsp
on your side.
Comment 5 Stas Sergeev 2007-07-13 07:48:42 EDT
No deal. :)
Yes, I've noticed the EBUSY myself, but I don't
care since this is an alsa OSS emulation. I am not
interested in using an OSS emulation. The previous
versions of mikmod (in fc6 etc) used ESD or alsa
(with dmix), which are never busy and involve a
software mixing.
How can I get these to work? Getting it to work via
an OSS is not an intention.
Comment 6 Stas Sergeev 2007-07-13 12:28:32 EDT
By the way:
---
$ lsof | grep '/dev/dsp'
$ echo >/dev/dsp
bash: /dev/dsp: Device or resource busy
$ cat /dev/dsp
urimmiqprqz
$ lsmod |grep snd_pcm_oss
snd_pcm_oss            53217  0 
snd_mixer_oss          25537  3 snd_pcm_oss
snd_pcm                93129  4 snd_intel8x0,snd_ac97_codec,snd_pcm_oss
snd                    71785  13
snd_intel8x0,snd_ac97_codec,snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer

---

So:
1. No process is hogging on /dev/dsp.
2. /dev/dsp is busy for writing.
3. /dev/dsp is _available_ for reading!
4. The usage count of /dev/dsp is 0, so the
device is unused.

This all is very suspecious. It looks like the
OSS emulation in F7 is broken itself and permits
only a recording, but not a playback.
This probably deserves another bug report, but
all the apps that use alsa or ESD, do not have
any problems. The OSS apps seem to no longer work,
but the only OSS app I can think of, is that broken
mikmod.
So the question still stays: why does the mikmod
no longer supports an alsa and ESD?
Comment 7 Stas Sergeev 2007-07-13 13:26:34 EDT
Sorry. I kinda forgot that the OSS emulation
doesn't work if someone uses the alsa sound
device. And that someone appeared to be esd.
So if I do "killall esd" then mikmod appears
to work.
This is no go of course.
Comment 8 Hans de Goede 2008-02-18 11:18:37 EST
Short self intro: I'm a co-mainter of mikmod and libmikmod.

As such I've been looking at fixing this bug, long story short, I succeeded
except that alsa is not supported (but esd now works again, and so does
pulseaudio which is the future of desktop sound on Fedora):

* Mon Feb 18 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 3.2.2-5
- Add BuildRequires esound-devel, so that the esd output driver gets build
- Replace completely braindead (hint to author, drink coffee first, then code)
  esd non blocking patch with one that actually works. This fixes using mikmod
  with pulseaudio (bz 247865)
- Note: this makes the 2 supported output devices oss and esd (and pulseaudio's
  esd emulation) alsa is not supported, this requires a rewrite of the mikmod
  alsa code which was written for alsa-0.5 and never updated for the new alsa
  0.9/1.0 api

About alsa, fixing this requires a rewrite of the alsa output driver in mikmod,
which given how we are moving to pulseaudio, is a wontfix thing atm.

3.2.2-5 which fixes esd output is on its way to F-7 updates-testing, our updates
system will add a note here once it hits the repo including instructions howto
install this update from the updates-testing repository, please test this update
when available and let us know if it fixes things for you.
Comment 9 Stas Sergeev 2008-02-18 15:10:17 EST
> - Replace completely braindead (hint to author, drink coffee first, then code)
Sorry, I am not a mikmod/esd developer and have
no idea about its internals. The patch was clearly
marked as a workaround:
---
I have made a simple patch that fixes a problem for me, maybe this
will help.
I'll attach it now.

Created an attachment
simple patch to work around the problem
---
and was intended mainly to show the problematic place.
I don't know how could the one mark the patch more
prominently to point that it was just a workaround,
not a real fix.
And it was there for 7 years already, I've completely
forgot it ever existed, and there was no one preventing
you from reviewing/rewriting it all these years long.

Thanks for fixing the problem though.
Comment 10 Fedora Update System 2008-02-19 04:24:53 EST
mikmod-3.2.2-6.fc7 has been submitted as an update for Fedora 7
Comment 11 Fedora Update System 2008-02-20 21:54:40 EST
mikmod-3.2.2-6.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mikmod'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F7/FEDORA-2008-1871
Comment 12 Fedora Update System 2008-02-25 19:27:36 EST
mikmod-3.2.2-6.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.