Csound 6 无法直接初始化 PortAudio,但以某种方式通过文件工作

Posted

技术标签:

【中文标题】Csound 6 无法直接初始化 PortAudio,但以某种方式通过文件工作【英文标题】:Csound 6 fails to initialize PortAudio directly, but works via file somehow 【发布时间】:2014-11-17 21:20:11 【问题描述】:

我已经好几年没用过 csound 了;在 Windows 7 上安装最新的非 RC 版本 (6.03.2) 后,我感到非常惊讶的是,我不再从中获得任何音频。奇怪的是,我可以渲染到文件,然后 CsoundQt 可以自动播放重新渲染的文件,也可以通过 PortAudio。为了修复示例输入,我使用演示中的 01C01_db_vs_linear.csd,尽管此文件的选择对结果并不重要。这是我在 CsoundQt 中点击播放(或 Ctrl+R)时得到的结果:

STARTING FILE
Creating options
Creating orchestra
Creating score
rtaudio: PortAudio module enabled ... 
using blocking interface
Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.003s
sorting score ...
    ... done
Elapsed time at end of score sort: real: 0.003s, CPU: 0.003s
--Csound version 6.03.2 (double samples) May 12 2014
midi channel 1 using instr 1
midi channel 2 using instr 2
midi channel 3 using instr 1
midi channel 4 using instr 1
midi channel 5 using instr 1
midi channel 6 using instr 1
midi channel 7 using instr 1
midi channel 8 using instr 1
midi channel 9 using instr 1
midi channel 10 using instr 1
midi channel 11 using instr 1
midi channel 12 using instr 1
midi channel 13 using instr 1
midi channel 14 using instr 1
midi channel 15 using instr 1
midi channel 16 using instr 1
graphics suppressed, ascii substituted
0dBFS level = 1.0
orch now loaded
audio buffered in 4096 sample-frame blocks
PortAudio V19-devel (built Apr 21 2014 11:58:26)
   0: adc0 (ASIO4ALL v2)
PortAudio: failed to obtain device info.
Failed to initialise real time audio input

而且我没有声音输出。如果我使用“渲染到文件”(Alt+F)会发生以下情况:

STARTING FILE
Creating options
Creating orchestra
Creating score
rtaudio: PortAudio module enabled ... 
using callback interface
Elapsed time at end of orchestra compile: real: 0.004s, CPU: 0.004s
sorting score ...
    ... done
Elapsed time at end of score sort: real: 0.004s, CPU: 0.004s
--Csound version 6.03.2 (double samples) May 12 2014
midi channel 1 using instr 1
midi channel 2 using instr 2
midi channel 3 using instr 1
midi channel 4 using instr 1
midi channel 5 using instr 1
midi channel 6 using instr 1
midi channel 7 using instr 1
midi channel 8 using instr 1
midi channel 9 using instr 1
midi channel 10 using instr 1
midi channel 11 using instr 1
midi channel 12 using instr 1
midi channel 13 using instr 1
midi channel 14 using instr 1
midi channel 15 using instr 1
midi channel 16 using instr 1
graphics suppressed, ascii substituted
0dBFS level = 1.0
orch now loaded
audio buffered in 4096 sample-frame blocks
PortAudio V19-devel (built Apr 21 2014 11:58:26)
   0: dac0 (Microsoft Sound Mapper - Output)
   1: dac1 (Speakers (High Definition Audio)
   2: dac2 (Digital Audio (S/PDIF) (High De)
   3: dac3 (Digital Audio (S/PDIF) (High De)
   4: dac4 (Primary Sound Driver)
   5: dac5 (Speakers (High Definition Audio Device))
   6: dac6 (Digital Audio (S/PDIF) (High Definition Audio Device))
   7: dac7 (Digital Audio (S/PDIF) (High Definition Audio Device))
   8: dac8 (ASIO4ALL v2)
PortAudio: selected output device 'Speakers (High Definition Audio'
writing 8192 sample blks of 64-bit floats to dac 
SECTION 1:
new alloc for instr 1:
B  0.000 .. 11.000 T 11.000 TT 11.000 M:  0.99990  0.99990
new alloc for instr 2:
B 11.000 .. 21.000 T 21.000 TT 21.000 M:  0.99983  0.99983
Score finished in csoundPerformKsmps().
inactive allocs returned to freespace
end of score.          overall amps:  0.99990  0.99990
       overall samples out of range:        0        0
0 errors in performance
Elapsed time at end of performance: real: 21.098s, CPU: 21.098s
closing device
227 8192 sample blks of 64-bit floats written to dac

当然我可以这样听到。但是为什么直接播放不起作用呢?

编辑添加:因为似乎 adc[s] 正在/正在对 PortAudio 造成某种问题(它不会通过播放渲染文件显示出来,因为它可能不会尝试在以下情况下初始化 adcs那样玩),我已经卸载了 ASIO4ALL 并重新启动,但仍然没有运气直接玩,我现在只是得到一个更神秘的日志,因为它根本没有列出任何 adc,但现在仍然无法通过枚举那些不存在的 adc :

STARTING FILE
Creating options
Creating orchestra
Creating score
rtaudio: PortAudio module enabled ... 
using blocking interface
Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.017s
sorting score ...
    ... done
Elapsed time at end of score sort: real: 0.004s, CPU: 0.017s
--Csound version 6.03.2 (double samples) May 12 2014
midi channel 1 using instr 1
midi channel 2 using instr 2
midi channel 3 using instr 1
midi channel 4 using instr 1
midi channel 5 using instr 1
midi channel 6 using instr 1
midi channel 7 using instr 1
midi channel 8 using instr 1
midi channel 9 using instr 1
midi channel 10 using instr 1
midi channel 11 using instr 1
midi channel 12 using instr 1
midi channel 13 using instr 1
midi channel 14 using instr 1
midi channel 15 using instr 1
midi channel 16 using instr 1
graphics suppressed, ascii substituted
0dBFS level = 1.0
orch now loaded
audio buffered in 4096 sample-frame blocks
PortAudio V19-devel (built Apr 21 2014 11:58:26)
Failed to initialise real time audio input

这个直接运行(Ctrl+R),通过渲染文件播放(Alt+F)仍然像以前一样工作。

【问题讨论】:

【参考方案1】:

嗯,我现在按照http://csound.1045644.n5.nabble.com/Csound-QiuteCsound-problem-td3231424.html 中的建议通过在配置中不选择任何输入来修复它。这很烦人,因为在 Windows 上插入东西时会自动配置线路/麦克风输入,所以人们会期望 PortAudio 自己管理这么多,但显然这超出了它当前的功能集。我必须记住在使用某些输入时将其改回 adc。

【讨论】:

以上是关于Csound 6 无法直接初始化 PortAudio,但以某种方式通过文件工作的主要内容,如果未能解决你的问题,请参考以下文章

在 python 内部使用 csound

CSound 乐器的补丁存储

CSound 和 Python 通信

csound 是不是能够从互联网上提取简单的信息/数据?

CSound6 缺少 32 位库

CSOUND 函数表缩放错误