Csound Csound-dev Csound-tekno Search About

[Cs-dev] Csound for Haiku

Date2012-11-28 21:48
From"Pete G."
Subject[Cs-dev] Csound for Haiku
Hi,
I think it's about time I dropped in here and announced this...

For the last few months I've been porting Csound (5.17.6) to Haiku.  (This
is the open-source successor to the late lamented BeOS --
http://www.haiku-os.org/ )  I think I've reached the point where I can make
a first release, which I'll do as soon as I can get it all packaged up
conveniently for the user.  It's compiled with all the plugins except for
some like the FLTK stuff that Haiku doesn't currently have.  It has
real-time audio out and MIDI in, but no audio-in or MIDI-out yet.

I can't say I've tested much of it yet, but the bulk of the code compiled
directly, and it happily plays the orchestras and csds I've tried.  Most of
the tweaks were to add in recognition of the __HAIKU__ define where it was
needed, though I had to fiddle with pthreads a bit because Haiku doesn't
have pthread_barrier [or didn't -- there have been advances recently that I
haven't checked], and also handles them in the root library rather than in a
separate libpthread.  I had to edit SConstruct quite a bit because of this
and a few other things.  And of course there's the whole new rthaiku.so
plugin.

I'll put the user package on the 'Haikuware' site, and we have a
'haikuports' site where recipes for the patching can be posted, but if
possible I'd like to get my modifications merged into the main trunk.   I've
taken care to ensure that I haven't messed with any other platform's needs,
but of course that would have to be checked.  (There were a couple of places
that I've changed platform-conditional checks because they seemed
inconsistent, but they are hopefully now more correct!)   There are still,
BTW, quite a few places where "__BEOS__" shows up, dating from Jens
Killian';s Csound4 port, I guess, but I doubt it would ever be possible to
make Csound5 run there.

So, if this is permissible, how should I donate my mods?   Probably the
simplest for me would just be to tar up all the revised and new sources --
under 600K unpacked -- and send them somewhere.  I could create a patch file
of them all instead, but I'm not sure that's any more convenient.

Thanks,

  -- Pete Goodeve --





--
View this message in context: http://csound.1045644.n5.nabble.com/Csound-for-Haiku-tp5718404.html
Sent from the Csound - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-29 10:55
FromVictor Lazzarini
SubjectRe: [Cs-dev] Csound for Haiku
Thanks for this. I guess we should try and merge this port into GIT sources. 
Does scons identify the platform correctly? If so, you could add your build changes in there
as we do for specific platforms ('linux', 'darwin', etc.).

Then it's the case of preparing a patch file that we can apply, and one of us can do it.

Regards

Victor

On 28 Nov 2012, at 21:48, Pete G. wrote:

> Hi,
> I think it's about time I dropped in here and announced this...
> 
> For the last few months I've been porting Csound (5.17.6) to Haiku.  (This
> is the open-source successor to the late lamented BeOS --
> http://www.haiku-os.org/ )  I think I've reached the point where I can make
> a first release, which I'll do as soon as I can get it all packaged up
> conveniently for the user.  It's compiled with all the plugins except for
> some like the FLTK stuff that Haiku doesn't currently have.  It has
> real-time audio out and MIDI in, but no audio-in or MIDI-out yet.
> 
> I can't say I've tested much of it yet, but the bulk of the code compiled
> directly, and it happily plays the orchestras and csds I've tried.  Most of
> the tweaks were to add in recognition of the __HAIKU__ define where it was
> needed, though I had to fiddle with pthreads a bit because Haiku doesn't
> have pthread_barrier [or didn't -- there have been advances recently that I
> haven't checked], and also handles them in the root library rather than in a
> separate libpthread.  I had to edit SConstruct quite a bit because of this
> and a few other things.  And of course there's the whole new rthaiku.so
> plugin.
> 
> I'll put the user package on the 'Haikuware' site, and we have a
> 'haikuports' site where recipes for the patching can be posted, but if
> possible I'd like to get my modifications merged into the main trunk.   I've
> taken care to ensure that I haven't messed with any other platform's needs,
> but of course that would have to be checked.  (There were a couple of places
> that I've changed platform-conditional checks because they seemed
> inconsistent, but they are hopefully now more correct!)   There are still,
> BTW, quite a few places where "__BEOS__" shows up, dating from Jens
> Killian';s Csound4 port, I guess, but I doubt it would ever be possible to
> make Csound5 run there.
> 
> So, if this is permissible, how should I donate my mods?   Probably the
> simplest for me would just be to tar up all the revised and new sources --
> under 600K unpacked -- and send them somewhere.  I could create a patch file
> of them all instead, but I'm not sure that's any more convenient.
> 
> Thanks,
> 
>  -- Pete Goodeve --
> 
> 
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Csound-for-Haiku-tp5718404.html
> Sent from the Csound - Dev mailing list archive at Nabble.com.
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-29 20:15
FromAndres Cabrera
SubjectRe: [Cs-dev] Csound for Haiku
Hi Pete,

Great to hear this. Was it much work? If you can prepare a patch for
recent sources, that would definitely make it easier to integrate the
patches.

I think everyone here would be happy to add support for Haiku.

Cheers,

Andrés

On Nov 28, 2012 1:49 PM, "Pete G."  wrote:
>
> Hi,
> I think it's about time I dropped in here and announced this...
>
> For the last few months I've been porting Csound (5.17.6) to Haiku.  (This
> is the open-source successor to the late lamented BeOS --
> http://www.haiku-os.org/ )  I think I've reached the point where I can make
> a first release, which I'll do as soon as I can get it all packaged up
> conveniently for the user.  It's compiled with all the plugins except for
> some like the FLTK stuff that Haiku doesn't currently have.  It has
> real-time audio out and MIDI in, but no audio-in or MIDI-out yet.
>
> I can't say I've tested much of it yet, but the bulk of the code compiled
> directly, and it happily plays the orchestras and csds I've tried.  Most of
> the tweaks were to add in recognition of the __HAIKU__ define where it was
> needed, though I had to fiddle with pthreads a bit because Haiku doesn't
> have pthread_barrier [or didn't -- there have been advances recently that I
> haven't checked], and also handles them in the root library rather than in a
> separate libpthread.  I had to edit SConstruct quite a bit because of this
> and a few other things.  And of course there's the whole new rthaiku.so
> plugin.
>
> I'll put the user package on the 'Haikuware' site, and we have a
> 'haikuports' site where recipes for the patching can be posted, but if
> possible I'd like to get my modifications merged into the main trunk.   I've
> taken care to ensure that I haven't messed with any other platform's needs,
> but of course that would have to be checked.  (There were a couple of places
> that I've changed platform-conditional checks because they seemed
> inconsistent, but they are hopefully now more correct!)   There are still,
> BTW, quite a few places where "__BEOS__" shows up, dating from Jens
> Killian';s Csound4 port, I guess, but I doubt it would ever be possible to
> make Csound5 run there.
>
> So, if this is permissible, how should I donate my mods?   Probably the
> simplest for me would just be to tar up all the revised and new sources --
> under 600K unpacked -- and send them somewhere.  I could create a patch file
> of them all instead, but I'm not sure that's any more convenient.
>
> Thanks,
>
>   -- Pete Goodeve --
>
>
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Csound-for-Haiku-tp5718404.html
> Sent from the Csound - Dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/list

Date2012-11-29 22:06
From"Pete G."
SubjectRe: [Cs-dev] Csound for Haiku
Yes, scons recognizes Haiku just as it does the other platforms, and I've
tried to make my additions to SConstruct parallel to the way you handle
them.

I'll put  a patch together, then.  I guess I'll probably have to gather all
the pieces and do it manually, as my work tree is pretty messy!  (And I just
got the source tar originally -- not via git.)  How should I pass it to you
when it's done?

Cheers,
    -- Pete --




--
View this message in context: http://csound.1045644.n5.nabble.com/Csound-for-Haiku-tp5718404p5718425.html
Sent from the Csound - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-29 22:20
From"Pete G."
SubjectRe: [Cs-dev] Csound for Haiku
It took a few months, but a large part of that was a drive crash just as I
got things beginning to work! (:-()
Working up the links to Haiku audio and MIDI took some time, but was fairly
straightforward, borrowing from the other real-time protocols.  The core
code mostly just compiled, except where it needed to be told that Haiku was
pretty much Posix...

The patch will be against 5.17.6.  Is that recent enough?  I know you've
bumped a release since I started, but I thought I'd better continue on from
where the crash stymied me.

I'm pretty pleased so far about the way it's working.  I can play live with
nice low latency -- though that /does/ need a slightly patched (HDA) driver
that hasn't made it into the Haiku distribution yet.  (And I really like the
way that Haiku is progressing!)

Cheers,
  -- Pete --




--
View this message in context: http://csound.1045644.n5.nabble.com/Csound-for-Haiku-tp5718404p5718427.html
Sent from the Csound - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-12-01 03:42
FromAndres Cabrera
SubjectRe: [Cs-dev] Csound for Haiku
Thanks for the info, I really need to check out Haiku someday. Is
there a haiku live cd?

Cheers,
Andrés

On Thu, Nov 29, 2012 at 2:20 PM, Pete G.  wrote:
> It took a few months, but a large part of that was a drive crash just as I
> got things beginning to work! (:-()
> Working up the links to Haiku audio and MIDI took some time, but was fairly
> straightforward, borrowing from the other real-time protocols.  The core
> code mostly just compiled, except where it needed to be told that Haiku was
> pretty much Posix...
>
> The patch will be against 5.17.6.  Is that recent enough?  I know you've
> bumped a release since I started, but I thought I'd better continue on from
> where the crash stymied me.
>
> I'm pretty pleased so far about the way it's working.  I can play live with
> nice low latency -- though that /does/ need a slightly patched (HDA) driver
> that hasn't made it into the Haiku distribution yet.  (And I really like the
> way that Haiku is progressing!)
>
> Cheers,
>   -- Pete --
>
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Csound-for-Haiku-tp5718404p5718427.html
> Sent from the Csound - Dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> VERIFY Test and improve your parallel project with help from experts
> and peers. http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https

Date2012-12-01 08:04
FromPete Goodeve
SubjectRe: [Cs-dev] Csound for Haiku
AttachmentsNone  

Date2012-12-01 11:26
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] Csound for Haiku
> [BTW, I have to check on my netiquette here... (:-/)
> I notice that most replies are top-posted, with the entire previous
> conversation appended.  If I did that on a Haiku list, there'd be
> screams of outrage! (:-))  I've been replying via nabble, which strips
> *all* previous content.  Probably better to reply to the list, but my
> personal preference is to condense the content and append my
> response(s) to the appropriate points.  Is there any objection to
> that here?]

As far as I am aware we have never made any pronouncements on this.
personnally I prefer the new text at the top (unlike this!) with the
earlier message abbreviate (like this), or sometimes answers interleaved
in more complex discussions.

Never understood why people get so het up about this.  I know that bottom
posting is annoying as one has to scroll past stuff one has seen and
sometimes I miss the new bit!

But whatever

==John ff


------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-12-01 12:04
FromSteven Yi
SubjectRe: [Cs-dev] Csound for Haiku
AttachmentsNone  None  

I know there's been posts here by blind members who mention that bottom posting is very inconvenient for screen readers, or something to that effect. I end up just replying using Gmail default which is top posting. I don't mind either really.

On Dec 1, 2012 11:26 AM, <jpff@cs.bath.ac.uk> wrote:

> [BTW, I have to check on my netiquette here... (:-/)
> I notice that most replies are top-posted, with the entire previous
> conversation appended.  If I did that on a Haiku list, there'd be
> screams of outrage! (:-))  I've been replying via nabble, which strips
> *all* previous content.  Probably better to reply to the list, but my
> personal preference is to condense the content and append my
> response(s) to the appropriate points.  Is there any objection to
> that here?]

As far as I am aware we have never made any pronouncements on this.
personnally I prefer the new text at the top (unlike this!) with the
earlier message abbreviate (like this), or sometimes answers interleaved
in more complex discussions.

Never understood why people get so het up about this.  I know that bottom
posting is annoying as one has to scroll past stuff one has seen and
sometimes I miss the new bit!

But whatever

==John ff


------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Date2012-12-02 21:10
Frompete.goodeve@computer.org
SubjectRe: [Cs-dev] Csound for Haiku
AttachmentsNone  

Date2012-12-02 21:34
FromVictor Lazzarini
SubjectRe: [Cs-dev] Csound for Haiku
By the way, is there realtime audio on Haiku?If so, what type of API is it (blocking, asynchronous), and what kind of latencies are experienced?

Regards

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
DESIGN Expert tips on starting your parallel project right.
http://goparallel.sourceforge.net/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-12-03 00:00
FromPete Goodeve
SubjectRe: [Cs-dev] Csound for Haiku
AttachmentsNone  

Date2012-12-03 00:16
FromJustin Smith
SubjectRe: [Cs-dev] Csound for Haiku
AttachmentsNone  None  
You have described a variety of blocking / push interface.

Asynchronous (or callback based) interfaces are based on registering a function to be called by the sink when the data stream is being consumed, and typically this will lead to better performance.


On Sun, Dec 2, 2012 at 4:00 PM, Pete Goodeve <pete.goodeve@computer.org> wrote:
On Sun, Dec 02, 2012 at 09:34:02PM +0000, Victor Lazzarini wrote:
> By the way, is there realtime audio on Haiku?If so, what type of API is it (blocking, asynchronous), and what kind of latencies are experienced?
>
Oh, yes!  I'm playing Csound real-time from my MIDI keyboard, with
a latency of about 13 ms.  I might be able to improve that slightly,
but at the moment it's fine for me.

I have to admit, though, that I needed to tweak the HDA driver a bit
to get such latency.  It's built with a large buffer size -- probably dating
from earlier times when there were problems with interrupt scheduling
and so on.  Default latency is about 1/5sec!  I've patched the driver to
allow setting the buffers suitably smaller, and it works perfectly (on my
2.39GHz 4-Processor laptop), but the patch is still awaiting commission
by one of the core folks.

Not sure I understand the "blocking/asynchronous" choice.  Basically
a source gets a buffer pool which it fills as needed, and sends each buffer
down a chain with a tag indicating when it is *supposed* to be performed.
It will normally know the expected latency, and will send the buffer at
a suitable earlier time.  If the circulating buffer pool gets emptied for
some reason, the source will of course block, but normally there'll be
enough in the pool to avoid that.

The normal chain is for the source (like Csound) to send straight to
the system mixer, where all sources are of course mixed into a single
output, with suitable timing, and these new buffers go on to the
driver.

The idea is that a buffer can go through an arbitrary set of processing
nodes before it gets to the mixer, or possibly even bypass that, or go
to a recorder, but it looks to me as if this is still entirely buggy.  On
BeOS there is an app called 'Cortex' that shows the nodes and the
paths between them, and you can 'rewire' these as you like.  Haiku
has the same Cortex, but rewiring doesn't work -- the chain just goes dead
if you  try it.  I'm sure this is a temporary problem, but it does negate
the nice design of the audio system a bit!

Cheers,
   -- Pete --

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
BUILD Helping you discover the best ways to construct your parallel projects.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2012-12-03 10:30
FromVictor Lazzarini
SubjectRe: [Cs-dev] Csound for Haiku
Thanks for the information. What about HW support? Is there a good range of support for different audio cards?

On 3 Dec 2012, at 00:00, Pete Goodeve wrote:

> On Sun, Dec 02, 2012 at 09:34:02PM +0000, Victor Lazzarini wrote:
>> By the way, is there realtime audio on Haiku?If so, what type of API is it (blocking, asynchronous), and what kind of latencies are experienced?
>> 
> Oh, yes!  I'm playing Csound real-time from my MIDI keyboard, with
> a latency of about 13 ms.  I might be able to improve that slightly,
> but at the moment it's fine for me.
> 
> I have to admit, though, that I needed to tweak the HDA driver a bit
> to get such latency.  It's built with a large buffer size -- probably dating
> from earlier times when there were problems with interrupt scheduling
> and so on.  Default latency is about 1/5sec!  I've patched the driver to
> allow setting the buffers suitably smaller, and it works perfectly (on my
> 2.39GHz 4-Processor laptop), but the patch is still awaiting commission
> by one of the core folks.
> 
> Not sure I understand the "blocking/asynchronous" choice.  Basically
> a source gets a buffer pool which it fills as needed, and sends each buffer 
> down a chain with a tag indicating when it is *supposed* to be performed.
> It will normally know the expected latency, and will send the buffer at
> a suitable earlier time.  If the circulating buffer pool gets emptied for
> some reason, the source will of course block, but normally there'll be
> enough in the pool to avoid that.
> 
> The normal chain is for the source (like Csound) to send straight to
> the system mixer, where all sources are of course mixed into a single
> output, with suitable timing, and these new buffers go on to the
> driver.
> 
> The idea is that a buffer can go through an arbitrary set of processing
> nodes before it gets to the mixer, or possibly even bypass that, or go
> to a recorder, but it looks to me as if this is still entirely buggy.  On
> BeOS there is an app called 'Cortex' that shows the nodes and the
> paths between them, and you can 'rewire' these as you like.  Haiku
> has the same Cortex, but rewiring doesn't work -- the chain just goes dead
> if you  try it.  I'm sure this is a temporary problem, but it does negate
> the nice design of the audio system a bit!
> 
> Cheers,
>   -- Pete --
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> BUILD Helping you discover the best ways to construct your parallel projects.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
BUILD Helping you discover the best ways to construct your parallel projects.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-12-03 23:40
FromPete Goodeve
SubjectRe: [Cs-dev] Csound for Haiku
AttachmentsNone  

Date2012-12-04 03:09
FromPete Goodeve
SubjectRe: [Cs-dev] Csound for Haiku
AttachmentsNone