newbie need help with raspberry and csound
Date | 2015-07-23 08:45 |
From | sevi |
Subject | newbie need help with raspberry and csound |
Hello there , I'm an absolute newbie with csound. I would like to use the LineIn of my Behringer UCA202 with out latency problems -> real time audio now to my test. So I want to spend the LineIn of my UAC202 directly again. *my orc:* /;=========== ; toot01.orc ;=========== sr = 44100 kr = 4410 ksmps = 10 nchnls = 1 instr 1 a1 oscil 10000, 440, 1 out a1 endin / *my command line input and output:* /root@innotune:~# csound -i dsnoop01 -orc /var/www/Toots/toot01.orc -o LineIn01 PortAudio real-time audio module for Csound virtual_keyboard real time MIDI plugin for Csound PortMIDI real time MIDI plugin for Csound 0dBFS level = 32768.0 Csound version 5.17 (double samples) Apr 6 2013 libsndfile-1.0.25 orchname: /var/www/Toots/toot01.orc rtmidi: PortMIDI module enabled RAWWAVE_PATH: /usr/share/stk/rawwaves/ rtaudio: PortAudio module enabled ... using blocking interface Parsing successful! Elapsed time at end of orchestra compile: real: 0.008s, CPU: 0.010s Csound tidy up: Segmentation fault root@innotune:~#/ *pieces of my asound.conf:* /pcm.dmixer01 { type dmix ipc_key 1024 ipc_key_add_uid false ipc_perm 0666 slave { pcm "hw:01,0" # period_time 0 # period_size 1024 # buffer_size 16384 # rate 44100 } } pcm.dsnoop01 { type dsnoop ipc_key 2048 ipc_perm 0666 slave { pcm "hw:01,0" # rate 44100 channels 2 } } pcm.LineIn01 { type softvol slave.pcm "MuteIfAirplay01" control.name LineIn_01 control.card 01 } / *my asound.conf works so far with the command: * / arecord -f cd -D dsnoop01 | aplay -D LineIn01/ now I want to get this thing with csound up and running. I hope for support THX -- View this message in context: http://csound.1045644.n5.nabble.com/newbie-need-help-with-raspberry-and-csound-tp5742844.html Sent from the Csound - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ _______________________________________________ Csound-users mailing list Csound-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/csound-users Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2015-07-23 09:39 |
From | jpff |
Subject | Re: newbie need help with raspberry and csound |
Your command kine tries to write the audio to a file called LineIn01 and not to the real-time output. I am not expert at using alsa but I would expect something starting -o dac:..... I am sure one of our users knows the answer in detail ==John ff On Thu, 23 Jul 2015, sevi wrote: > Hello there , > I'm an absolute newbie with csound. I would like to use the LineIn of my > Behringer UCA202 with out latency problems -> real time audio > now to my test. So I want to spend the LineIn of my UAC202 directly again. > > *my orc:* > > > /;=========== > ; toot01.orc > ;=========== > > sr = 44100 > kr = 4410 > ksmps = 10 > nchnls = 1 > > instr 1 > a1 oscil 10000, 440, 1 > out a1 > endin > / > > *my command line input and output:* > > /root@innotune:~# csound -i dsnoop01 -orc /var/www/Toots/toot01.orc -o > LineIn01 > PortAudio real-time audio module for Csound > virtual_keyboard real time MIDI plugin for Csound > PortMIDI real time MIDI plugin for Csound > 0dBFS level = 32768.0 > Csound version 5.17 (double samples) Apr 6 2013 > libsndfile-1.0.25 > orchname: /var/www/Toots/toot01.orc > rtmidi: PortMIDI module enabled > RAWWAVE_PATH: /usr/share/stk/rawwaves/ > rtaudio: PortAudio module enabled ... using blocking interface > Parsing successful! > Elapsed time at end of orchestra compile: real: 0.008s, CPU: 0.010s > Csound tidy up: Segmentation fault > root@innotune:~#/ > > *pieces of my asound.conf:* > > /pcm.dmixer01 { > type dmix > ipc_key 1024 > ipc_key_add_uid false > ipc_perm 0666 > slave { > pcm "hw:01,0" > # period_time 0 > # period_size 1024 > # buffer_size 16384 > # rate 44100 > } > } > > pcm.dsnoop01 { > type dsnoop > ipc_key 2048 > ipc_perm 0666 > slave { > pcm "hw:01,0" > # rate 44100 > channels 2 > } > } > > pcm.LineIn01 { > type softvol > slave.pcm "MuteIfAirplay01" > control.name LineIn_01 > control.card 01 > } > / > > *my asound.conf works so far with the command: * > > / arecord -f cd -D dsnoop01 | aplay -D LineIn01/ > > now I want to get this thing with csound up and running. > > > I hope for support > > THX > > > > > -- > View this message in context: http://csound.1045644.n5.nabble.com/newbie-need-help-with-raspberry-and-csound-tp5742844.html > Sent from the Csound - General mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > _______________________________________________ > Csound-users mailing list > Csound-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/csound-users > Send bugs reports to > https://github.com/csound/csound/issues > Discussions of bugs and features can be posted here > ------------------------------------------------------------------------------ _______________________________________________ Csound-users mailing list Csound-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/csound-users Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2015-07-23 09:54 |
From | Rory Walsh |
Subject | Re: newbie need help with raspberry and csound |
Try this: |
Date | 2015-07-23 09:57 |
From | Rory Walsh |
Subject | Re: newbie need help with raspberry and csound |
By the way, if you wish to see what devices are available change the CsOptions to this: -+rtaudio=alsa -iadc99 -odac99 that will list the different devices available. Then you can do something like: -+rtaudio=alsa -iadc:hw:1,0 -odac:hw:1,1 On 23 July 2015 at 10:54, Rory Walsh |
Date | 2015-07-23 10:33 |
From | sevi |
Subject | Re: newbie need help with raspberry and csound |
hy, many thanks! it works Unfortunately, I have a little problem with the latenzy. *my config:* / |
Date | 2015-07-23 10:46 |
From | Rory Walsh |
Subject | Re: newbie need help with raspberry and csound |
You're last line states that you have no problems? So what's the problem? On 23 July 2015 at 11:33, sevi |
Date | 2015-07-23 13:09 |
From | sevi |
Subject | Re: newbie need help with raspberry and csound |
hy, again, if I speak directly with my Behringer UAC202 like this: /-+rtaudio=alsa -iadc:hw:1,0 -odac:hw:1,0/ i have no problems. BUT if i routes my LineIn to the LineOut over my asound.conf with: / -+rtaudio=alsa -iadc:dsnoop01 -odac:LineIn01/ then i have a bad latenzy and the saound is slower as the video on my TV. any ideas? many THX! -- View this message in context: http://csound.1045644.n5.nabble.com/newbie-need-help-with-raspberry-and-csound-tp5742844p5742855.html Sent from the Csound - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ _______________________________________________ Csound-users mailing list Csound-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/csound-users Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2015-07-23 13:16 |
From | Rory Walsh |
Subject | Re: newbie need help with raspberry and csound |
I'm not sure why that is. What does Csound print when you do -iadc99 -odac99? On 23 July 2015 at 14:09, sevi |
Date | 2015-07-23 13:28 |
From | sevi |
Subject | Re: newbie need help with raspberry and csound |
Hy, /root@innotune:~# csound /var/www/csound_linein.csd PortAudio real-time audio module for Csound virtual_keyboard real time MIDI plugin for Csound PortMIDI real time MIDI plugin for Csound 0dBFS level = 32768.0 Csound version 5.17 (double samples) Apr 6 2013 libsndfile-1.0.25 UnifiedCSD: /var/www/csound_linein.csd STARTING FILE Creating options Creating orchestra Creating score rtmidi: PortMIDI module enabled rtaudio: ALSA module enabled RAWWAVE_PATH: /usr/share/stk/rawwaves/ Parsing successful! Elapsed time at end of orchestra compile: real: 0.009s, CPU: 0.010s sorting score ... ... done Elapsed time at end of score sort: real: 0.010s, CPU: 0.010s Csound version 5.17 (double samples) Apr 6 2013 graphics not supported on this terminal, ascii substituted 0dBFS level = 1.0 orch now loaded audio buffered in 256 sample-frame blocks *** ALSA: must specify a device name, not a number (e.g. -odac:hw:0,0) "hw:0,0" - Playback HiFi-0 : : playback 1 : capture 1 "hw:0,1" - Capture HiFi-1 : : playback 1 : capture 1 "hw:1,0" - USB Audio : USB Audio : playback 1 : capture 1 "hw:2,0" - USB Audio : USB Audio : playback 1 : capture 1 Failed to initialise real time audio input inactive allocs returned to freespace end of score. overall amps: 0.00000 0.00000 overall samples out of range: 0 0 1 errors in performance Elapsed time at end of performance: real: 0.011s, CPU: 0.010s root@innotune:~#/ but i need the ALSA config to audio mixing. THX -- View this message in context: http://csound.1045644.n5.nabble.com/newbie-need-help-with-raspberry-and-csound-tp5742844p5742857.html Sent from the Csound - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ _______________________________________________ Csound-users mailing list Csound-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/csound-users Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2015-07-23 14:18 |
From | Rory Walsh |
Subject | Re: newbie need help with raspberry and csound |
Sorry, I don't know anything about asound.conf. I just access my sound cards directly. On 23 July 2015 at 13:28, sevi |
Date | 2015-07-23 22:16 |
From | Anders Genell |
Subject | Re: newbie need help with raspberry and csound |
Hi! You can set "period_size" and "buffer_size" for both the dmix device and the dsnoop device, e.g.: pcm.dsnooper { type dsnoop ipc_key 1024 slave { pcm "hw:0,1 period_size 64 buffer_size 256 } bindings { 0 0 1 1 } } That way you might reduce latency and/or stuttering. You would likely want to relate your ksmps value in your csd-file to the buffer and period sizes in asound.conf, since one batch of ksmps audio samples is rendered in each csound cycle, so the realtime sync to the audio card buffer handling will be kept tight. I suggest reading http://csound.github.io/docs/manual/UsingRealTime.html#RealTimeLinux especially the section about "Output with dmix" which should be valid for dsnoop as well. Someone on this list did some experimenting with buffer sizes for csound on raspberry pi a while ago, but I cannot remember who it was... Regards, Anders > 23 jul 2015 kl. 15:18 skrev Rory Walsh |
Date | 2015-07-24 10:12 |
From | sevi |
Subject | Re: newbie need help with raspberry and csound |
hy, works already not so bad! perfect! but i have very slight difference between sound and video on my TV. maybe i could optimize that. now my configs: *asound.conf* / pcm.dmixer01 { type dmix ipc_key 1024 ipc_key_add_uid false ipc_perm 0666 slave { pcm "hw:01,0" # period_time 0 period_size 1536 buffer_size 12288 # rate 44100 } } pcm.dsnoop01 { type dsnoop ipc_key 2048 ipc_perm 0666 slave { pcm "hw:01,0" period_size 1536 buffer_size 12288 } bindings { 0 0 1 1 } }/ *csound.cds* / |
Date | 2016-01-11 07:56 |
From | sevi |
Subject | Re: newbie need help with raspberry and csound |
Hy again, i have again problems with my csound config with alsa. my problem is i don´t no the reference from my csound.csd to my asound.conf detailed is about the period size and puffer size. * csound.csd:* |
Date | 2016-01-11 08:39 |
From | Anders Genell |
Subject | Re: newbie need help with raspberry and csound |
Do you know if you have pulseaudio installed? Regards Anders > 11 jan. 2016 kl. 08:56 skrev sevi |
Date | 2016-01-11 09:03 |
From | sevi |
Subject | Re: newbie need help with raspberry and csound |
hy, thx for the fast reply. No i dont have pulse-audio installed. i need csound with a dmix sample rate of 44100 because I 've also run shairort and shairport need 44100. at all is this possible with csound? thx -- View this message in context: http://csound.1045644.n5.nabble.com/newbie-need-help-with-raspberry-and-csound-tp5742844p5746182.html Sent from the Csound - General mailing list archive at Nabble.com. Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2016-01-11 09:47 |
From | Anders Genell |
Subject | Re: newbie need help with raspberry and csound |
If you can live with 44100 within csound too, you can set sr=44100 in you csd or add as command line flag. For using csound with dmix, and for setting corresponding buffer values, I recommend reading the "Output with dmix" section in the manual: http://csound.github.io/docs/manual/UsingRealTime.html#RealTimeLinux Regards, Anders > 11 jan. 2016 kl. 10:03 skrev sevi |
Date | 2016-01-11 10:30 |
From | sevi |
Subject | Re: newbie need help with raspberry and csound |
Hy thx for the answer. i read the doc "Output with dmix" but it does not work if i write in csound.csd sr44100 and also in asound.conf and the same period and puffer size i have under or overrun. i think 44100 in asound.conf is not possibel in csound. http://sourceforge.net/p/csound/mailman/message/12830583/ i dont know...... -- View this message in context: http://csound.1045644.n5.nabble.com/newbie-need-help-with-raspberry-and-csound-tp5742844p5746186.html Sent from the Csound - General mailing list archive at Nabble.com. Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2016-01-11 11:02 |
From | Anders Genell |
Subject | Re: newbie need help with raspberry and csound |
First, in your csd you have " -odac:LineIn01" but in your asound.conf there is "pcm.dmixer01" Do you actually have an alsa device called LineIn01? Second, in your asound.conf you set buffers to period_size 1536 buffer_size 12288 How did you decide to use these values? Third, if you add a "plug" device to your asound.conf that might help with conversion
Finally, it might be difficult to have too much processing done in realtime when using full duplex audio on a Raspberry Pi. You might want to check out http://cosmoproject.github.io/ for examples where this has been achieved, but with a custom SPI interface, not USB. Regards, Anders On Mon, Jan 11, 2016 at 11:30 AM, sevi <severin@elmecker.net> wrote: Hy |
Date | 2016-01-11 11:35 |
From | Anders Genell |
Subject | Re: newbie need help with raspberry and csound |
Also, there might be some useful information about general audio handling on a Raspberry Pi here: http://wiki.linuxaudio.org/wiki/raspberrypi On Mon, Jan 11, 2016 at 12:02 PM, Anders Genell <anders.genell@gmail.com> wrote:
|
Date | 2016-01-12 06:11 |
From | sevi |
Subject | Re: newbie need help with raspberry and csound |
Hy, /"First, in your csd you have " -odac:LineIn01" but in your asound.conf there is "pcm.dmixer01" Do you actually have an alsa device called LineIn01?"/ -> yes i have a alsa device with LineIn01 I posted only fragments of my asound.conf /"Second, in your asound.conf you set buffers to period_size 1536 buffer_size 12288 How did you decide to use these values?"/ -> various instructions for example this http://csound.github.io/docs/manual/UsingRealTime.html#RealTimeLinux /"Third, if you add a "plug" device to your asound.conf that might help with conversion"/ -> thx for this useful solution!!! and for the link to cosmo! *my csd now:* |