Performance issues with Sox and multi-channel oggs

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Performance issues with Sox and multi-channel oggs

TrojanNemo
Good morning everyone.
Just as a recap, in the past I received help through this mailing list on successfully using SoX to play back multi-channel ogg files. These are typically 10-14 channels multi-track songs where the channels are stored as mono audio, can be from 2 channels to as many as 18 channels, and each audio file is accompanied by metadata that lets me tell SoX via the remix feature how to pan and attenuate each of the channels. The end result is the user can play these multi-channel ogg files as if they were standard stereo audio. This is all GUI driven, created in and for Windows 32-bit, .NET 4.0 framework.
Thanks to the help I received on here, I managed to get it all working exactly as I wanted. On my development computer, as well as my work computer, my wife's laptop, and my mother's home computer, it all works beautifully. However, I've received feedback from more than one user now that describes the experience as "choppy" and "slowed-down" when SoX is playing the audio. I've taken to troubleshooting with one particular user, who has similar specs to my development computer and much better specs than the other three test computers. When he feeds a stereo WAV to SoX via command line, it plays fine for him. However, when playing a multi-channel ogg, even one that is smaller in size than the stereo WAV, it plays back at a choppy rate that is unusable.

To answer some of the questions I expect: the users all have Windows 32-bit or 64-bit, all have .NET Framework 4.0 (the rest of my programs that they use require it). I can't speak as to each user's specs, but at least this one far surpasses three of my test (working well) computers. SoX is not "installed", rather the executable and its required DLLs are included with my program. SoX doesn't give an "error", it plays but slowed down as if it couldn't handle the workload. The way I call SoX is via a standard Process.Start method, nothing special.

Any idea why it would work on four vastly different systems, and then have this performance issue on a very powerful system? Since it works as intended on every computer I have access to, I can't even troubleshoot it myself. My theory is (I'm waiting to hear from the user) that this user has both hardware and software sound card/drivers, and SoX is defaulting to the software card/driver and then is unable to play back correctly. Could that even be the cause? If so, how can I specify which sound card/driver to use in the one line argument I send to SoX? If not, any other suggestions of what to look for?

Thanks for the help.
Reply | Threaded
Open this post in threaded view
|

Re: Performance issues with Sox and multi-channel oggs

Jan Stary
On Feb 10 07:11:45, [hidden email] wrote:

> Good morning everyone.
> Just as a recap, in the past I received help through this mailing list on
> successfully using SoX to play back multi-channel ogg files. These are
> typically 10-14 channels multi-track songs where the channels are stored as
> mono audio, can be from 2 channels to as many as 18 channels, and each audio
> file is accompanied by metadata that lets me tell SoX via the remix feature
> how to pan and attenuate each of the channels. The end result is the user
> can play these multi-channel ogg files as if they were standard stereo
> audio. This is all GUI driven, created in and for Windows 32-bit, .NET 4.0
> framework.
> Thanks to the help I received on here, I managed to get it all working
> exactly as I wanted. On my development computer, as well as my work
> computer, my wife's laptop, and my mother's home computer, it all works
> beautifully. However, I've received feedback from more than one user now
> that describes the experience as "choppy" and "slowed-down" when SoX is
> playing the audio. I've taken to troubleshooting with one particular user,
> who has similar specs to my development computer and much better specs than
> the other three test computers. When he feeds a stereo WAV to SoX via
> command line, it plays fine for him. However, when playing a multi-channel
> ogg, even one that is smaller in size than the stereo WAV, it plays back at
> a choppy rate that is unusable.
>
> To answer some of the questions I expect: the users all have Windows 32-bit
> or 64-bit, all have .NET Framework 4.0 (the rest of my programs that they
> use require it). I can't speak as to each user's specs, but at least this
> one far surpasses three of my test (working well) computers. SoX is not
> "installed", rather the executable and its required DLLs are included with
> my program. SoX doesn't give an "error", it plays but slowed down as if it
> couldn't handle the workload. The way I call SoX is via a standard
> Process.Start method, nothing special.
>
> Any idea why it would work on four vastly different systems, and then have
> this performance issue on a very powerful system?

Because of some other difference between those systems,
most probably nothing to so with SoX.

> Since it works as intended
> on every computer I have access to, I can't even troubleshoot it myself. My
> theory is (I'm waiting to hear from the user) that this user has both
> hardware and software sound card/drivers, and SoX is defaulting to the
> software card/driver and then is unable to play back correctly. Could that
> even be the cause?

That, or anything else can be the cause under Windows using NET.

> If so, how can I specify which sound card/driver to use
> in the one line argument I send to SoX?

With the --default-device option,
as clearly described in the manpage you haven't read.


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Performance issues with Sox and multi-channel oggs

TrojanNemo
Jesus Christ Jan, you really still haven't grasped the concept of responding to a mailing list that you're in by choice without being an ass in your reply, have you?

I did read the "man page" after you pointed it out the last time I asked a question to this mailing list. And no, it's not "clearly described" there. Maybe I'm not "man" enough to understand what's there in that very brief section dealing with this. You seem to take the position that virtually everything is explained in the "man page" and that since it's "explained" there, there is no reason for anyone to ask for help. Then why the heck is there a mailing list for this exact purpose?

Anyways, I believe I found the solution. You should read it.

http://sox.10957.n7.nabble.com/Multiple-sound-cards-on-windows-td3685.html

Next time someone asks a question, try to answer more like he did, and less like how you typically respond.
I've said it before, and I'll say it again. You REALLY make this mailing list be an unwelcoming place. And I say that knowing that typically, I'm seen as the asshole or troll in the forums I frequent.
I think I will unsubscribe from this mailing list and try my luck elsewhere.

If any of the SoX devs are on this mailing list: thank you for this great software - but you really need better PR, and a web forum.

Thank you.

Sincerely,


Yemil Aragon, Esq.



> Date: Tue, 10 Feb 2015 19:42:28 +0100

> From: [hidden email]
> To: [hidden email]
> Subject: Re: [SoX-users] Performance issues with Sox and multi-channel oggs
>
> On Feb 10 07:11:45, [hidden email] wrote:
> > Good morning everyone.
> > Just as a recap, in the past I received help through this mailing list on
> > successfully using SoX to play back multi-channel ogg files. These are
> > typically 10-14 channels multi-track songs where the channels are stored as
> > mono audio, can be from 2 channels to as many as 18 channels, and each audio
> > file is accompanied by metadata that lets me tell SoX via the remix feature
> > how to pan and attenuate each of the channels. The end result is the user
> > can play these multi-channel ogg files as if they were standard stereo
> > audio. This is all GUI driven, created in and for Windows 32-bit, .NET 4.0
> > framework.
> > Thanks to the help I received on here, I managed to get it all working
> > exactly as I wanted. On my development computer, as well as my work
> > computer, my wife's laptop, and my mother's home computer, it all works
> > beautifully. However, I've received feedback from more than one user now
> > that describes the experience as "choppy" and "slowed-down" when SoX is
> > playing the audio. I've taken to troubleshooting with one particular user,
> > who has similar specs to my development computer and much better specs than
> > the other three test computers. When he feeds a stereo WAV to SoX via
> > command line, it plays fine for him. However, when playing a multi-channel
> > ogg, even one that is smaller in size than the stereo WAV, it plays back at
> > a choppy rate that is unusable.
> >
> > To answer some of the questions I expect: the users all have Windows 32-bit
> > or 64-bit, all have .NET Framework 4.0 (the rest of my programs that they
> > use require it). I can't speak as to each user's specs, but at least this
> > one far surpasses three of my test (working well) computers. SoX is not
> > "installed", rather the executable and its required DLLs are included with
> > my program. SoX doesn't give an "error", it plays but slowed down as if it
> > couldn't handle the workload. The way I call SoX is via a standard
> > Process.Start method, nothing special.
> >
> > Any idea why it would work on four vastly different systems, and then have
> > this performance issue on a very powerful system?
>
> Because of some other difference between those systems,
> most probably nothing to so with SoX.
>
> > Since it works as intended
> > on every computer I have access to, I can't even troubleshoot it myself. My
> > theory is (I'm waiting to hear from the user) that this user has both
> > hardware and software sound card/drivers, and SoX is defaulting to the
> > software card/driver and then is unable to play back correctly. Could that
> > even be the cause?
>
> That, or anything else can be the cause under Windows using NET.
>
> > If so, how can I specify which sound card/driver to use
> > in the one line argument I send to SoX?
>
> With the --default-device option,
> as clearly described in the manpage you haven't read.
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Sox-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sox-users

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Performance issues with Sox and multi-channel oggs

Chris Angelico
On Wed, Feb 11, 2015 at 6:11 AM, Yemil Aragon <[hidden email]> wrote:
> If any of the SoX devs are on this mailing list: thank you for this great
> software - but you really need better PR, and a web forum.

FWIW, a web forum isn't always an improvement. I find mailing lists to
be excellent; but they desperately need people, good people, to create
a culture of helpfulness. If you can find those people more easily by
deploying a web forum, so be it, but without them, no technology will
help you.

ChrisA

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Performance issues with Sox and multi-channel oggs

Jan Stary
In reply to this post by TrojanNemo
On Feb 10 14:11:47, [hidden email] wrote:
> http://sox.10957.n7.nabble.com/Multiple-sound-cards-on-windows-td3685.html

My bad, sorry.


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Performance issues with Sox and multi-channel oggs

Fmiser
In reply to this post by TrojanNemo
> Yemil wrote:
>
> If any of the SoX devs are on this mailing list: thank you for
> this great software - but you really need better PR, and a web
> forum.

*shutter*  No web forum, please.  For me, a forum is a lot more
trouble than an email list.

--  fm

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Performance issues with Sox and multi-channel oggs

TrojanNemo
I owe it to my users to try and resolve this issue, so here's a follow up to try and find a solution.

I have now confirmed the problem happens on two Windows Vista machines, whereas all my tests on Windows 7 and Windows 8 have been fine.
The user that has been troubleshooting with me was so kind as to record the problem in action.

This is the problem happening while running my GUI:
http://www.mediafire.com/watch/7oetw54dd6daw31/cplayer-playing.mp4

This is the same problem, with the same user, running SoX standalone from command line:
http://www.mediafire.com/watch/jk49a3jx0j659fz/testogg.mp4

Since the same behavior is encountered whether my GUI calls SoX, or the user calls SoX directly, I think we can move away from dismissing it as being a NET issue and try to troubleshoot SoX itself.
The argument line he gave SoX was provided by me to him, it's part of what my GUI sends to SoX. He did accidentally truncate the end of the argument line, but that's not the cause of the slow-down.
(In case there's questions, yes it's redundant to have the 0.0 attenuation values, but they're generated by my GUI based on the song's metadata, so some songs are 0.0 and some are not. It works fine, don't worry about that.)

Interestingly, 10 seconds of playback (according to the SoX timer) on his video and on my end both result in the same out size and percentage according to his and my SoX windows. So it's playing the same amount of data and the same percentage of the song in the same span of time, but it sounds like it's playing it at a fraction of the full speed for him.

On my end, replacing -d with -t waveaudio 0 results in the same behavior = proper playback out of my main speakers.
On his end he also gets the same behavior - meaning he's still getting stuttery audio regardless of which of his two hardware sound cards he specifies. In short, my theory of "maybe it's defaulting to an emulated/software audio device" is not the culprit.

I hope this is enough information to help you pinpoint what could be causing this.

If you you'd be interested, here's the multi-channel ogg I sent to him for testing. It includes the instructions I provided him with as well:

http://www.keepitfishy.com/rb3/cplayer/test_ogg.rar

Thank you for any information that may lead to fixing this. I would rather work out a solution than just say Windows Vista is not supported.
Reply | Threaded
Open this post in threaded view
|

Re: Performance issues with Sox and multi-channel oggs

TrojanNemo
I wanted to send a response for anyone interested or anyone who comes across this post in the future:

I never found the correct answer per se, but some research indicated that starting with Windows 7, Windows started using WASAPI for audio playback.

All positive results with SoX were on computers running Windows 7 or newer, whereas all negative results with SoX were on computers running Windows Vista.

I assume this means SoX by default uses WASAPI on Windows and either it's not supported to use the prior interface or more likely, it needs to be specified by the user.

In any case, I've moved on from SoX to BASS.NET for playback of these multi-channel oggs, which gives me all that SoX did plus much more for a greater user experience for my end users. I'm still going to rely on SoX for a few things, so I'll keep it close by.

Thanks everyone who has helped in the past.