Marshall Mason
2015-Jun-14 05:38 UTC
[Vorbis-dev] Sound glitch when using libvorbisfile and libao
Hi Gunter, Thank you for your quick response. As I mentioned in the email, I cannot dependably reproduce it. It comes and goes, and I just have to wait for it to come up before I can try to debug it. I've found it tends to happen when I've been taxing my sound driver, but this isn't consistent either. My inability to consistently reproduce this has made it a nasty bug for me to investigate. I was hoping that something would be immediately obvious in my code to those who know these libraries very well. I have the feeling it has something to do with buffering. If I decode the Ogg Vorbis file and dump it into a raw file, and then read it in again and feed it to ao_play, the problem goes away. I have a simple Ogg Vorbis file I am using for testing, which I sent to you in a private email. I have no server space on which to store it. Thanks, Marshall On Sat, Jun 13, 2015 at 10:14 PM, Gunter K?nigsmann <gunter at peterpall.de> wrote:> How can this problem be reproduced? If you have an specific .ogg file that > gives problems it would be helpful to have them so we can try to reproduce > them. > > Kind regards, > > Gunter. > > On So, Jun 14, 2015 at 7:10 , Marshall Mason <marshallmason2 at gmail.com> > wrote: > > Hi there, > I've been grappling with this for some time, so I'm finally breaking down > and trying this list. > > I'm trying to integrate libvorbisfile and libao to create a simple sound > file player, a la ogg123. To do this, I borrowed heavily from ao_example.c > and vorbisfile_example.c. I feed the buffer from ov_read into ao_play in a > simple loop. It usually works, but occasionally all it does is make a > strange sound and quickly finishes. I cannot dependably reproduce it. The > same problem does not happen when I use ogg123, so I'm sure I'm doing > something wrong. I've combed through the ogg123 source code and couldn't > figure it out. I'm wondering if someone can look at my code and tell me if > there's something I overlooked. > > http://pastie.org/10239629 > > (Debian Jessie, libvorbisfile 1.3.4, libao-1.1.0) > > Thanks, > Marshall > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20150613/781ef377/attachment.htm
Gunter Königsmann
2015-Jun-14 07:51 UTC
[Vorbis-dev] Sound glitch when using libvorbisfile and libao
Dear Marshall, I spent most of yesterday finding out that wxWidget's wxStringArray sometimes drops whitespace in a new entry depending on the character the last entry ended with - so I know what you mean. But your code looks clean and after listening to the bell for what felt too long I started using your program as a regular audio player. I too assume the problem lies in the audio driver your soundcard is using and has to be triggered by using some exact timing. One potential way to test for this would be keeping the audio driver active between running instances of your program: You said the problem always turns up when starting the playback. Is it possible for you to constantly play back silent audio in the background while testing? Alsa can be configured to automatically mix all streams that are being played back simultaneously and the sound servers all support this feature, too. Kind regards, Gunter. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20150614/54b4daa8/attachment.htm
Marshall Mason
2015-Jun-14 17:02 UTC
[Vorbis-dev] Sound glitch when using libvorbisfile and libao
Hi Gunter, I think this problem started happening when I upgraded from Debian Wheezy to Debian Jessie. If nothing looks amiss in my code, it probably is a sound driver problem. But since it works 100% of the time in ogg123, I feel I must have missed some corner case. My audio driver is almost always active. I usually have my music player going in the background when I do my testing. The problem surfaces more reliably after watching a bunch of YouTube videos, but not consistently enough to use it as a test case. I'll keep poking at it, and will give an update if I figure it out. Thanks for your responses. Marshall On Sun, Jun 14, 2015 at 12:51 AM, Gunter K?nigsmann <gunter at peterpall.de> wrote:> Dear Marshall, > > I spent most of yesterday finding out that wxWidget's wxStringArray > sometimes drops whitespace in a new entry depending on the character the > last entry ended with - so I know what you mean. But your code looks clean > and after listening to the bell for what felt too long I started using your > program as a regular audio player. > I too assume the problem lies in the audio driver your soundcard is using > and has to be triggered by using some exact timing. One potential way to > test for this would be keeping the audio driver active between running > instances of your program: You said the problem always turns up when > starting the playback. Is it possible for you to constantly play back > silent audio in the background while testing? Alsa can be configured to > automatically mix all streams that are being played back simultaneously and > the sound servers all support this feature, too. > > Kind regards, > > Gunter. >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20150614/ce81f818/attachment.htm