Open Paul-Andre opened 8 years ago
Hmm this might have something to do with not having the linux ALSA extension header bindings set up yet. We only have bindings to the general portaudio.h
so far. #22 is the related issue.
Would you mind running the devices.rs
and hosts.rs
examples and posting their output to here?
I only have OS X available to me at the moment, but I'm hoping to use rust-portaudio w/ ALSA for some embedded audio stuff mid-next month which is when I was planning on having a go at this. It shouldn't be too tricky to run rust-bindgen on the necessary header and set it up (I'm happy for someone else to beat me to it).
I can't get into the computer on which I've initially done that, but on another computer, also running Ubuntu 14.04, but running Pulseaudio, I get the same error and I get:
When running non_blocking using cargo:
Running `target/debug/examples/non_blocking`
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
jack_client_new: deprecated
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
jack_client_new: deprecated
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
PortAudio:
version: 1899
version text: Ok("PortAudio V19-devel (built Feb 25 2014 21:08:14)")
host count: 2
default host: Some(
HostApiInfo {
struct_version: 1,
host_type: ALSA,
name: "ALSA",
device_count: 8,
default_input_device: Some(
DeviceIndex(
7
)
),
default_output_device: Some(
DeviceIndex(
7
)
)
}
)
Default input device info: DeviceInfo {
struct_version: 2,
name: "default",
host_api: 0,
max_input_channels: 32,
max_output_channels: 32,
default_low_input_latency: 0.008707482993197279,
default_low_output_latency: 0.008707482993197279,
default_high_input_latency: 0.034829931972789115,
default_high_output_latency: 0.034829931972789115,
default_sample_rate: 44100
}
Default output device info: DeviceInfo {
struct_version: 2,
name: "default",
host_api: 0,
max_input_channels: 32,
max_output_channels: 32,
default_low_input_latency: 0.008707482993197279,
default_low_output_latency: 0.008707482993197279,
default_high_input_latency: 0.034829931972789115,
default_high_output_latency: 0.034829931972789115,
default_sample_rate: 44100
}
An unknown error occurred
When running devices.rs:
Running `target/debug/examples/devices`
ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
jack_client_new: deprecated
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
jack_client_new: deprecated
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Number of devices = 6
Defualt input device: Ok(DeviceIndex(5))
Defualt output device: Ok(DeviceIndex(5))
All devices:
--------------------------------------- DeviceIndex(0)
DeviceInfo {
struct_version: 2,
name: "HDA Intel: ALC1200 Digital (hw:0,1)",
host_api: 0,
max_input_channels: 2,
max_output_channels: 2,
default_low_input_latency: 0.005804988662131519,
default_low_output_latency: 0.008707482993197279,
default_high_input_latency: 0.034829931972789115,
default_high_output_latency: 0.034829931972789115,
default_sample_rate: 44100
}
Supported standard sample rates for half-duplex 16-bit 2 channel input:
44100hz
48000hz
96000hz
Supported standard sample rates for half-duplex 16-bit 2 channel output:
44100hz
48000hz
88200hz
96000hz
192000hz
Supported standard sample rates for full-duplex 16-bit 2 channel input, 2 channel output:
44100hz
48000hz
96000hz
--------------------------------------- DeviceIndex(1)
DeviceInfo {
struct_version: 2,
name: "HDA Intel: ALC1200 Alt Analog (hw:0,2)",
host_api: 0,
max_input_channels: 2,
max_output_channels: 0,
default_low_input_latency: 0.005804988662131519,
default_low_output_latency: -1,
default_high_input_latency: 0.034829931972789115,
default_high_output_latency: -1,
default_sample_rate: 44100
}
Supported standard sample rates for half-duplex 16-bit 2 channel input:
44100hz
48000hz
96000hz
Supported standard sample rates for half-duplex 16-bit 0 channel output:
Supported standard sample rates for full-duplex 16-bit 2 channel input, 0 channel output:
--------------------------------------- DeviceIndex(2)
DeviceInfo {
struct_version: 2,
name: "iec958",
host_api: 0,
max_input_channels: 0,
max_output_channels: 2,
default_low_input_latency: -1,
default_low_output_latency: 0.005804988662131519,
default_high_input_latency: -1,
default_high_output_latency: 0.034829931972789115,
default_sample_rate: 44100
}
Supported standard sample rates for half-duplex 16-bit 0 channel input:
Supported standard sample rates for half-duplex 16-bit 2 channel output:
44100hz
48000hz
88200hz
96000hz
192000hz
Supported standard sample rates for full-duplex 16-bit 0 channel input, 2 channel output:
--------------------------------------- DeviceIndex(3)
DeviceInfo {
struct_version: 2,
name: "spdif",
host_api: 0,
max_input_channels: 2,
max_output_channels: 2,
default_low_input_latency: 0.005804988662131519,
default_low_output_latency: 0.008707482993197279,
default_high_input_latency: 0.034829931972789115,
default_high_output_latency: 0.034829931972789115,
default_sample_rate: 44100
}
Supported standard sample rates for half-duplex 16-bit 2 channel input:
44100hz
48000hz
96000hz
Supported standard sample rates for half-duplex 16-bit 2 channel output:
44100hz
48000hz
88200hz
96000hz
192000hz
Supported standard sample rates for full-duplex 16-bit 2 channel input, 2 channel output:
44100hz
48000hz
96000hz
--------------------------------------- DeviceIndex(4)
DeviceInfo {
struct_version: 2,
name: "pulse",
host_api: 0,
max_input_channels: 32,
max_output_channels: 32,
default_low_input_latency: 0.008707482993197279,
default_low_output_latency: 0.008707482993197279,
default_high_input_latency: 0.034829931972789115,
default_high_output_latency: 0.034829931972789115,
default_sample_rate: 44100
}
Supported standard sample rates for half-duplex 16-bit 32 channel input:
8000hz
9600hz
11025hz
12000hz
16000hz
22050hz
24000hz
32000hz
44100hz
48000hz
88200hz
96000hz
192000hz
Supported standard sample rates for half-duplex 16-bit 32 channel output:
8000hz
9600hz
11025hz
12000hz
16000hz
22050hz
24000hz
32000hz
44100hz
48000hz
88200hz
96000hz
192000hz
Supported standard sample rates for full-duplex 16-bit 32 channel input, 32 channel output:
8000hz
9600hz
11025hz
12000hz
16000hz
22050hz
24000hz
32000hz
44100hz
48000hz
88200hz
96000hz
192000hz
--------------------------------------- DeviceIndex(5)
DeviceInfo {
struct_version: 2,
name: "default",
host_api: 0,
max_input_channels: 32,
max_output_channels: 32,
default_low_input_latency: 0.008707482993197279,
default_low_output_latency: 0.008707482993197279,
default_high_input_latency: 0.034829931972789115,
default_high_output_latency: 0.034829931972789115,
default_sample_rate: 44100
}
Supported standard sample rates for half-duplex 16-bit 32 channel input:
8000hz
9600hz
11025hz
12000hz
16000hz
22050hz
24000hz
32000hz
44100hz
48000hz
88200hz
96000hz
192000hz
Supported standard sample rates for half-duplex 16-bit 32 channel output:
8000hz
9600hz
11025hz
12000hz
16000hz
22050hz
24000hz
32000hz
44100hz
48000hz
88200hz
96000hz
192000hz
Supported standard sample rates for full-duplex 16-bit 32 channel input, 32 channel output:
8000hz
9600hz
11025hz
12000hz
16000hz
22050hz
24000hz
32000hz
44100hz
48000hz
88200hz
96000hz
192000hz
When running hosts.rs
:
Running `target/debug/examples/hosts`
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
jack_client_new: deprecated
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
jack_client_new: deprecated
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Default Host API: Ok(0)
All Host APIs:
(
0,
HostApiInfo {
struct_version: 1,
host_type: ALSA,
name: "ALSA",
device_count: 8,
default_input_device: Some(
DeviceIndex(
7
)
),
default_output_device: Some(
DeviceIndex(
7
)
)
}
)
(
1,
HostApiInfo {
struct_version: 1,
host_type: OSS,
name: "OSS",
device_count: 0,
default_input_device: None,
default_output_device: None
}
)
fyi, i was seeing this with debian bullseye as well, however, it seems to be resolved with portaudio 19.6.0-1.1
When running the example non_blocking, I get:
When doing a stacktrace with gdb:
A similar thing happens to
blocking.rs
,saw.rs
,sine.rs
, but not ondevices.rs
orhosts.rs
.I suspect that some struct passed to the C functions isn't correct.