Announcement

Collapse
No announcement yet.

ChucK

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    ChucK

    I am in the process of trying to learn ChucK, which is a programming language to produce musical sounds. My problem is that I cannot use two audio sources when ChucK is active. For example, I cannot watch the instructional video and exercise ChucK at the same time. ChucK seems to require exclusive use of the sound card. I have built ChucK from source and have three choices: Linux-Alsa, Linux-oss, Linux-Jack. I have had no luck with any of the builds. The bad thing is that Windows works the way I want it to, that is, Windows handles two audio sources properly. So, I do not know if my Linux issue is due the ChucK code or whether it is something inherent in Linux.

    Does anyone out there have any experience with ChucK and Linux?

    Thank you.

    #2
    You've run smack into the reason why PulseAudio is important for Linux: without it, applications cannot share sound cards.

    ChucK, alas, is not aware of PulseAudio. Even though PulseAudio provides a virtual ALSA adapter, ChucK is bypassing that and taking direct control of the hardware. All is not lost, however; Google found some information that can help:

    http://superuser.com/questions/53703...ith-pulseaudio

    The article has lots of interesting information. Most importantly, it includes a hack to RtAudio.cpp that fixes ChucK to be Pulse-aware:
    Code:
    --- ./RtAudio/RtAudio.cpp.orig  2013-01-14 16:18:18.113645910 +0100
    +++ ./RtAudio/RtAudio.cpp   2013-01-14 18:46:15.289672175 +0100
    @@ -5657,7 +5699,8 @@
             if ( result < 0 ) break;
             if ( subdevice < 0 ) break;
             if ( nDevices == device ) {
    -          sprintf( name, "hw:%d,%d", card, subdevice );
    +          //~ sprintf( name, "hw:%d,%d", card, subdevice );
    +          sprintf( name, "pulse");
               snd_ctl_close( chandle );
               goto foundDevice;
             }
    @@ -5696,6 +5739,7 @@
    
       snd_pcm_t *phandle;
       int openMode = SND_PCM_ASYNC;
    +  printf( "pcm name %s\n", name);
       result = snd_pcm_open( &phandle, name, stream, openMode );
       if ( result < 0 ) {
         if ( mode == OUTPUT )
    This should fix your problem.

    Comment

    Working...
    X