code-google-com / qmmp

Automatically exported from code.google.com/p/qmmp
0 stars 0 forks source link

OSS output plays very slow (cygwin only) #49

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Having built qmmp-0.2.3 for Cygwin, where ALSA is not available, using the
OSS output plugin causes the file to play at ~1/8 speed.  I'm willing to
try any patches you can provide and report back the results.

Original issue reported on code.google.com by yselkow...@gmail.com on 25 Feb 2009 at 7:08

GoogleCodeExporter commented 9 years ago
Try svn version: 
svn checkout http://qmmp.googlecode.com/svn/branches/qmmp-0.2/ qmmp-0.2 

Original comment by trialuser02 on 25 Feb 2009 at 10:50

GoogleCodeExporter commented 9 years ago
Tried r809 on the branch, same results.

Original comment by yselkow...@gmail.com on 25 Feb 2009 at 6:54

GoogleCodeExporter commented 9 years ago
OK, try another player. If qmmp only has this problem, show its output during
starting playback.

Original comment by trialuser02 on 28 Feb 2009 at 2:59

GoogleCodeExporter commented 9 years ago
> OK, try another player.

I have dozens of multimedia programs on this computer, and all work fine with 
OSS
audio output.

> If qmmp only has this problem, show its output during starting playback.

OutputOSS: uninitialize
DecoderMAD: deleting input_buf
DecoderMAD: deleting output_buf
SoundCore: creating decoder
ok
SoundCore: decoder was created successfully
DecoderMAD: 152 bytes skipped
DecoderMAD: Fixed rate detected
DecoderMAD: Total time: 12
DecoderMAD: 152 bytes skipped

Original comment by yselkow...@gmail.com on 1 Mar 2009 at 5:04

GoogleCodeExporter commented 9 years ago
OK, try r818. If the problem still exists, show output again.

Original comment by trialuser02 on 2 Mar 2009 at 12:53

GoogleCodeExporter commented 9 years ago
I appreciate your persistence.  I build r818 from the branch, the results are 
still
the same, here's the output with a 12s MP3 which played at 1/8 speed:

SoundCore: creating decoder
ok
SoundCore: decoder was created successfully
DecoderMAD: 152 bytes skipped
DecoderMAD: Fixed rate detected
DecoderMAD: Total time: 12
OutputOSS: frequency=44100, channels=2, bits=16
DecoderMAD: 152 bytes skipped

With a 68s Ogg/Vorbis file, the speed was approx. 1/4:

SoundCore: creating decoder
ok
SoundCore: decoder was created successfully
DecoderVorbis: initialize
OutputOSS: frequency=44100, channels=1, bits=16
file info:
ARTIST =
TITLE =
ALBUM =
COMMENT =
GENRE = Other
YEAR = 0
TRACK = 0
LENGTH = 68

Testing a few different files, the speed seems to be 1/(4 * channels); 1/4 for 
mono,
1/8 for stereo.  Does that help?

Original comment by yselkow...@gmail.com on 2 Mar 2009 at 2:39

GoogleCodeExporter commented 9 years ago
OK, try again. I hope, it shows more useful info now.

Original comment by trialuser02 on 2 Mar 2009 at 4:57

GoogleCodeExporter commented 9 years ago
Sorry, output and results are exactly the same.

Original comment by yselkow...@gmail.com on 2 Mar 2009 at 5:16

GoogleCodeExporter commented 9 years ago
May be qWarning() doesn't show messages under windows. Find outputoss.cpp file 
and
change all "qWarning" functions to "qDebug". Than try again. I consider, 
"/dev/oss"
doesn't support 44kHz.

Original comment by trialuser02 on 2 Mar 2009 at 5:58

GoogleCodeExporter commented 9 years ago
Cygwin != Windows, and qWarning does show messages (I added one unconditionally 
to
verify).  I assure you that these files do play on other audio players with 
their OSS
backends.

Original comment by yselkow...@gmail.com on 2 Mar 2009 at 6:48

GoogleCodeExporter commented 9 years ago
OK, yet another attempt. Try to remove this lines from outputoss.cpp

    int flags;
    if ((flags = fcntl(m_audio_fd, F_GETFL, 0)) > 0)
    {
        flags &= O_NDELAY;
        fcntl(m_audio_fd, F_SETFL, flags);
    }

Original comment by trialuser02 on 2 Mar 2009 at 9:23

GoogleCodeExporter commented 9 years ago
Sorry, no change. :-(

Original comment by yselkow...@gmail.com on 2 Mar 2009 at 10:05

GoogleCodeExporter commented 9 years ago
OK, try to increase sample rate. Change "m_frequency = freq" to something like
"m_frequency = freq*4" or 8. Does it change anything? 

Original comment by trialuser02 on 3 Mar 2009 at 9:00

GoogleCodeExporter commented 9 years ago
Using freq*4, I got an additional message:

OutputOSS: can't set frequency, using 176400 instead

With freq*8, the message was 352800.  That comes from the if(m_frequency != 
freq)
conditional which you added.

Playback was still as slow.

Original comment by yselkow...@gmail.com on 3 Mar 2009 at 9:21

GoogleCodeExporter commented 9 years ago
Looks like "/dev/dsp" doesn't use samplerate settings. And I can't find any
differences in oss code between mpd, audacious and qmmp. 
I consider, this is last difference: 
- open(m_audio_device.toAscii(), O_WRONLY, 0);
+ open(m_audio_device.toAscii(), O_WRONLY);

Original comment by trialuser02 on 3 Mar 2009 at 10:40

GoogleCodeExporter commented 9 years ago
Looking at the Cygwin sources, I see now that SNDCTL_DSP_GETODELAY is not 
supported.
 GStreamer and PulseAudio use SNDCTL_DSP_GETOSPACE as a backup.

If you're out of ideas, then I'll try to figure this out myself, and if I'm
successful, I'll propose a patch here.  I appreciate your efforts nevertheless.

Original comment by yselkow...@gmail.com on 4 Mar 2009 at 7:13

GoogleCodeExporter commented 9 years ago
Yes, you are right. I haven,t more ideas. So I'm waiting for your patches. 

Original comment by trialuser02 on 4 Mar 2009 at 3:17

GoogleCodeExporter commented 9 years ago

Original comment by trialuser02 on 5 Apr 2009 at 9:44