Csound Csound-dev Csound-tekno Search About

Re: [Csnd] Best odac setting for a Raspberry Pi computer

Date2013-07-20 18:07
FromBrian Redfern
SubjectRe: [Csnd] Best odac setting for a Raspberry Pi computer
Yeah I found I could get some complex things to run on the pi by using an 8khz sample rate and 8 bit sampling on the built in card, of course sounds really brutal but i got some interesting old school video game style sounds that I could play in realtime with my controller.

Date2013-07-20 18:17
FromAndres Cabrera
SubjectRe: [Csnd] Best odac setting for a Raspberry Pi computer

And of course run without X. That will help a lot too.

A

On Jul 20, 2013 10:08 AM, "Brian Redfern" <brianwredfern@gmail.com> wrote:
Yeah I found I could get some complex things to run on the pi by using an 8khz sample rate and 8 bit sampling on the built in card, of course sounds really brutal but i got some interesting old school video game style sounds that I could play in realtime with my controller.

Date2013-07-25 19:05
FromBernt Isak Wærstad
SubjectRe: [Csnd] Best odac setting for a Raspberry Pi computer
I've been playing around with a lot of different settings now, but I simply cannot Csound to run with full duplex audio (audio straight through) and no dropouts. It seems like there are some setting somewhere that are not right at all though, because increasing the ksmps and buffer sizes even sometimes made the sound break up even more. Also the increase in buffer size and ksmps does not appear to increase the latency. I'm on Ubuntu with csound6 compiled from sources pulled a couple of hours ago and using the Behringer UCG102 audio interface. This is my latest attempt on getting audio in and out again:

<CsoundSynthesizer>
<CsOptions>
-odac:hw:1,0 -iadc:hw:1 -b2048 -B2048 -d -realtime -+rtaudio=ALSA
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 128
nchnls = 2

instr 1

a1 inch 1

outs a1, a1

endin

</CsInstruments>

<CsScore>
i1 0 1000
</CsScore>
</CsoundSynthesizer>

So far this is has produced the best results, but still with the occasional dropout:

<CsoundSynthesizer>
<CsOptions>
-odac:hw:1,0 -iadc:hw:1 -d -+rtaudio=ALSA -b128 -B1024
</CsOptions>
<CsInstruments>
sr      = 44100
ksmps   = 32
nchnls  = 2

instr 1
        a1 inch 1

arevL, arevR  reverbsc a1, a1, 0.85, 12000, sr, 0.5, 1


        aL = arevL*0.5 + a1 * 0.5
        aR = arevR*0.5 + a1 * 0.5

        outs aL, aR
endin


</CsInstruments>
<CsScore>
i1 0 86400
</CsScore>
</CsoundSynthesizer>




 


On Sat, Jul 20, 2013 at 7:17 PM, Andres Cabrera <mantaraya36@gmail.com> wrote:

And of course run without X. That will help a lot too.

A

On Jul 20, 2013 10:08 AM, "Brian Redfern" <brianwredfern@gmail.com> wrote:
Yeah I found I could get some complex things to run on the pi by using an 8khz sample rate and 8 bit sampling on the built in card, of course sounds really brutal but i got some interesting old school video game style sounds that I could play in realtime with my controller.



--
Mvh.

Bernt Isak Wærstad



Date2013-07-28 12:33
FromBernt Isak Wærstad
SubjectRe: [Csnd] Best odac setting for a Raspberry Pi computer
It was a problem with the USB controller being 2.0 - forcing it to be 1.1 solved the dropout issue for me. This is how you do it:

Force USB port to USB 1.1 (needed to prevent dropouts)


The RPi has a USB2.0 controller that apparently can cause issues with USB1.1 audio interfaces. The solution is to force the controller to use USB1.1 mode. You can do this by adding the following kernel parameter to your /boot/cmdline.txt file on your RPi:


dwc_otg.speed=1

You cannot edit this file from the Raspberry itself (through ssh) since it is a read-only file on a protected boot partition (sudo will not help). Instead power down the PI, extract the SD card and put it into your machine. On the SD card partition you will find the cmdline.txt file and be able to edit it so it will look something like this:


dwc_otg.lpm_enable=0 dwc_otg.speed=1 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

Save the file, eject the SD card and put it back into your PI.  




On Thu, Jul 25, 2013 at 8:05 PM, Bernt Isak Wærstad <berntisak@gmail.com> wrote:
I've been playing around with a lot of different settings now, but I simply cannot Csound to run with full duplex audio (audio straight through) and no dropouts. It seems like there are some setting somewhere that are not right at all though, because increasing the ksmps and buffer sizes even sometimes made the sound break up even more. Also the increase in buffer size and ksmps does not appear to increase the latency. I'm on Ubuntu with csound6 compiled from sources pulled a couple of hours ago and using the Behringer UCG102 audio interface. This is my latest attempt on getting audio in and out again:

<CsoundSynthesizer>
<CsOptions>
-odac:hw:1,0 -iadc:hw:1 -b2048 -B2048 -d -realtime -+rtaudio=ALSA
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 128
nchnls = 2

instr 1

a1 inch 1

outs a1, a1

endin

</CsInstruments>

<CsScore>
i1 0 1000
</CsScore>
</CsoundSynthesizer>

So far this is has produced the best results, but still with the occasional dropout:

<CsoundSynthesizer>
<CsOptions>
-odac:hw:1,0 -iadc:hw:1 -d -+rtaudio=ALSA -b128 -B1024
</CsOptions>
<CsInstruments>
sr      = 44100
ksmps   = 32
nchnls  = 2

instr 1
        a1 inch 1

arevL, arevR  reverbsc a1, a1, 0.85, 12000, sr, 0.5, 1


        aL = arevL*0.5 + a1 * 0.5
        aR = arevR*0.5 + a1 * 0.5

        outs aL, aR
endin


</CsInstruments>
<CsScore>
i1 0 86400
</CsScore>
</CsoundSynthesizer>





 


On Sat, Jul 20, 2013 at 7:17 PM, Andres Cabrera <mantaraya36@gmail.com> wrote:

And of course run without X. That will help a lot too.

A

On Jul 20, 2013 10:08 AM, "Brian Redfern" <brianwredfern@gmail.com> wrote:
Yeah I found I could get some complex things to run on the pi by using an 8khz sample rate and 8 bit sampling on the built in card, of course sounds really brutal but i got some interesting old school video game style sounds that I could play in realtime with my controller.



--
Mvh.

Bernt Isak Wærstad





--
Mvh.

Bernt Isak Wærstad



Date2013-07-28 17:47
FromSteven Yi
SubjectRe: [Csnd] Best odac setting for a Raspberry Pi computer
Great info!  I'm curious, what -b, -B, ksmps, etc. settings are you
able to use after forcing USB 1.1?



On Sun, Jul 28, 2013 at 1:33 PM, Bernt Isak Wærstad  wrote:
> It was a problem with the USB controller being 2.0 - forcing it to be 1.1
> solved the dropout issue for me. This is how you do it:
>
> Force USB port to USB 1.1 (needed to prevent dropouts)
>
>
> The RPi has a USB2.0 controller that apparently can cause issues with USB1.1
> audio interfaces. The solution is to force the controller to use USB1.1
> mode. You can do this by adding the following kernel parameter to your
> /boot/cmdline.txt file on your RPi:
>
>
> dwc_otg.speed=1
>
>
> You cannot edit this file from the Raspberry itself (through ssh) since it
> is a read-only file on a protected boot partition (sudo will not help).
> Instead power down the PI, extract the SD card and put it into your machine.
> On the SD card partition you will find the cmdline.txt file and be able to
> edit it so it will look something like this:
>
>
> dwc_otg.lpm_enable=0 dwc_otg.speed=1 console=ttyAMA0,115200
> kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4
> elevator=deadline rootwait
>
>
> Save the file, eject the SD card and put it back into your PI.
>
>
>
>
> On Thu, Jul 25, 2013 at 8:05 PM, Bernt Isak Wærstad 
> wrote:
>>
>> I've been playing around with a lot of different settings now, but I
>> simply cannot Csound to run with full duplex audio (audio straight through)
>> and no dropouts. It seems like there are some setting somewhere that are not
>> right at all though, because increasing the ksmps and buffer sizes even
>> sometimes made the sound break up even more. Also the increase in buffer
>> size and ksmps does not appear to increase the latency. I'm on Ubuntu with
>> csound6 compiled from sources pulled a couple of hours ago and using the
>> Behringer UCG102 audio interface. This is my latest attempt on getting audio
>> in and out again:
>>
>> 
>> 
>> -odac:hw:1,0 -iadc:hw:1 -b2048 -B2048 -d -realtime -+rtaudio=ALSA
>> 
>> 
>> sr = 44100
>> ksmps = 128
>> nchnls = 2
>>
>> instr 1
>>
>> a1 inch 1
>>
>> outs a1, a1
>>
>> endin
>>
>> 
>>
>> 
>> i1 0 1000
>> 
>> 
>>
>> So far this is has produced the best results, but still with the
>> occasional dropout:
>>
>> 
>> 
>> -odac:hw:1,0 -iadc:hw:1 -d -+rtaudio=ALSA -b128 -B1024
>> 
>> 
>> sr      = 44100
>> ksmps   = 32
>> nchnls  = 2
>>
>> instr 1
>>         a1 inch 1
>>
>> arevL, arevR  reverbsc a1, a1, 0.85, 12000, sr, 0.5, 1
>>
>>
>>         aL = arevL*0.5 + a1 * 0.5
>>         aR = arevR*0.5 + a1 * 0.5
>>
>>         outs aL, aR
>> endin
>>
>>
>> 
>> 
>> i1 0 86400
>> 
>> 
>>
>>
>>
>>
>>
>>
>>
>>
>> On Sat, Jul 20, 2013 at 7:17 PM, Andres Cabrera 
>> wrote:
>>>
>>> And of course run without X. That will help a lot too.
>>>
>>> A
>>>
>>> On Jul 20, 2013 10:08 AM, "Brian Redfern" 
>>> wrote:
>>>>
>>>> Yeah I found I could get some complex things to run on the pi by using
>>>> an 8khz sample rate and 8 bit sampling on the built in card, of course
>>>> sounds really brutal but i got some interesting old school video game style
>>>> sounds that I could play in realtime with my controller.
>>
>>
>>
>>
>> --
>> Mvh.
>>
>> Bernt Isak Wærstad
>>
>>
>
>
>
> --
> Mvh.
>
> Bernt Isak Wærstad
>
>


Date2013-07-30 11:38
FromBernt Isak Wærstad
SubjectRe: [Csnd] Best odac setting for a Raspberry Pi computer
I got the best results with -b128 -B1024 and ksmps=32. Crackle free and with ok latency with some reverb, delay and tremolo (don't have the csd-file here). With pvs-opcodes I had to increase -b and ksmps to prevent dropouts.

Will report back with some examples when I've got the PI up and running again.

On Sun, Jul 28, 2013 at 6:47 PM, Steven Yi <stevenyi@gmail.com> wrote:
Great info!  I'm curious, what -b, -B, ksmps, etc. settings are you
able to use after forcing USB 1.1?



On Sun, Jul 28, 2013 at 1:33 PM, Bernt Isak Wærstad <berntisak@gmail.com> wrote:
> It was a problem with the USB controller being 2.0 - forcing it to be 1.1
> solved the dropout issue for me. This is how you do it:
>
> Force USB port to USB 1.1 (needed to prevent dropouts)
>
>
> The RPi has a USB2.0 controller that apparently can cause issues with USB1.1
> audio interfaces. The solution is to force the controller to use USB1.1
> mode. You can do this by adding the following kernel parameter to your
> /boot/cmdline.txt file on your RPi:
>
>
> dwc_otg.speed=1
>
>
> You cannot edit this file from the Raspberry itself (through ssh) since it
> is a read-only file on a protected boot partition (sudo will not help).
> Instead power down the PI, extract the SD card and put it into your machine.
> On the SD card partition you will find the cmdline.txt file and be able to
> edit it so it will look something like this:
>
>
> dwc_otg.lpm_enable=0 dwc_otg.speed=1 console=ttyAMA0,115200
> kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4
> elevator=deadline rootwait
>
>
> Save the file, eject the SD card and put it back into your PI.
>
>
>
>
> On Thu, Jul 25, 2013 at 8:05 PM, Bernt Isak Wærstad <berntisak@gmail.com>
> wrote:
>>
>> I've been playing around with a lot of different settings now, but I
>> simply cannot Csound to run with full duplex audio (audio straight through)
>> and no dropouts. It seems like there are some setting somewhere that are not
>> right at all though, because increasing the ksmps and buffer sizes even
>> sometimes made the sound break up even more. Also the increase in buffer
>> size and ksmps does not appear to increase the latency. I'm on Ubuntu with
>> csound6 compiled from sources pulled a couple of hours ago and using the
>> Behringer UCG102 audio interface. This is my latest attempt on getting audio
>> in and out again:
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac:hw:1,0 -iadc:hw:1 -b2048 -B2048 -d -realtime -+rtaudio=ALSA
>> </CsOptions>
>> <CsInstruments>
>> sr = 44100
>> ksmps = 128
>> nchnls = 2
>>
>> instr 1
>>
>> a1 inch 1
>>
>> outs a1, a1
>>
>> endin
>>
>> </CsInstruments>
>>
>> <CsScore>
>> i1 0 1000
>> </CsScore>
>> </CsoundSynthesizer>
>>
>> So far this is has produced the best results, but still with the
>> occasional dropout:
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac:hw:1,0 -iadc:hw:1 -d -+rtaudio=ALSA -b128 -B1024
>> </CsOptions>
>> <CsInstruments>
>> sr      = 44100
>> ksmps   = 32
>> nchnls  = 2
>>
>> instr 1
>>         a1 inch 1
>>
>> arevL, arevR  reverbsc a1, a1, 0.85, 12000, sr, 0.5, 1
>>
>>
>>         aL = arevL*0.5 + a1 * 0.5
>>         aR = arevR*0.5 + a1 * 0.5
>>
>>         outs aL, aR
>> endin
>>
>>
>> </CsInstruments>
>> <CsScore>
>> i1 0 86400
>> </CsScore>
>> </CsoundSynthesizer>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Sat, Jul 20, 2013 at 7:17 PM, Andres Cabrera <mantaraya36@gmail.com>
>> wrote:
>>>
>>> And of course run without X. That will help a lot too.
>>>
>>> A
>>>
>>> On Jul 20, 2013 10:08 AM, "Brian Redfern" <brianwredfern@gmail.com>
>>> wrote:
>>>>
>>>> Yeah I found I could get some complex things to run on the pi by using
>>>> an 8khz sample rate and 8 bit sampling on the built in card, of course
>>>> sounds really brutal but i got some interesting old school video game style
>>>> sounds that I could play in realtime with my controller.
>>
>>
>>
>>
>> --
>> Mvh.
>>
>> Bernt Isak Wærstad
>>
>>
>
>
>
> --
> Mvh.
>
> Bernt Isak Wærstad
>
>


Send bugs reports to the Sourceforge bug trackers
csound6:
            https://sourceforge.net/p/csound/tickets/
csound5:
            https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





--
Mvh.

Bernt Isak Wærstad