lasprs/examples_py/test_streammgr.ipynb

163 lines
18 KiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "afa2bdda-0748-4a76-ad5c-d19859f833f6",
"metadata": {},
"outputs": [],
"source": [
"from lasprs import DaqConfig, StreamMgr"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "2b47552e-823e-48ba-8853-7f58fc1f90de",
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 1\n",
"ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 1\n",
"ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 1\n",
"ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 1\n",
"ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 1\n",
"ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 1\n",
"Cannot connect to server socket err = No such file or directory\n",
"Cannot connect to server request channel\n",
"jack server is not running or cannot be started\n",
"JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock\n",
"JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock\n",
"Cannot connect to server socket err = No such file or directory\n",
"Cannot connect to server request channel\n",
"jack server is not running or cannot be started\n",
"JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock\n",
"JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock\n",
"ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp\n",
"ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp\n",
"ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 1\n",
"ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 1\n",
"ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 1\n",
"ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 1\n",
"ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 1\n",
"ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 1\n",
"ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map\n",
"ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map\n",
"ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map\n",
"ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map\n",
"ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map\n",
"ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map\n",
"ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream\n",
"ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream\n",
"ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream\n",
"ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream\n",
"ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream\n",
"ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream\n",
"ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream\n",
"ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream\n",
"ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream\n",
"ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream\n",
"ALSA lib pcm_dsnoop.c:541:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream\n",
"ALSA lib pcm_dsnoop.c:541:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream\n"
]
}
],
"source": [
"s = StreamMgr()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "39d4c156-8304-4ed6-b9da-1d8a14d3bbe8",
"metadata": {},
"outputs": [],
"source": [
"ds = s.getDeviceInfo()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "a6f28472-a52c-4ccf-b65f-2a44b2eb59e1",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[DeviceInfo { api: Cpal, device_name: \"pipewire\", avDataTypes: [I16, I32, F32, I16, I32, F32], prefDataType: F32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [1000.0, 2000.0, 4000.0, 8000.0, 11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 44100.0, 48000.0, 88200.0, 96000.0, 192000.0, 384000.0], prefSampleRate: 384000.0, iChannelCount: 32, oChannelCount: 32, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"pulse\", avDataTypes: [I16, I32, F32, I16, I32, F32], prefDataType: F32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [1000.0, 2000.0, 4000.0, 8000.0, 11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 44100.0, 48000.0, 88200.0, 96000.0, 192000.0, 384000.0], prefSampleRate: 384000.0, iChannelCount: 32, oChannelCount: 32, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"default\", avDataTypes: [I16, I32, F32, I16, I32, F32], prefDataType: F32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [1000.0, 2000.0, 4000.0, 8000.0, 11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 44100.0, 48000.0, 88200.0, 96000.0, 192000.0, 384000.0], prefSampleRate: 384000.0, iChannelCount: 32, oChannelCount: 32, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"hw:CARD=PCH,DEV=0\", avDataTypes: [I16, I32, I16, I32], prefDataType: I32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [], prefSampleRate: 48000.0, iChannelCount: 2, oChannelCount: 2, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"hw:CARD=PCH,DEV=3\", avDataTypes: [I16, I32], prefDataType: I32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [], prefSampleRate: 48000.0, iChannelCount: 0, oChannelCount: 8, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"hw:CARD=PCH,DEV=7\", avDataTypes: [I16, I32], prefDataType: I32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [], prefSampleRate: 48000.0, iChannelCount: 0, oChannelCount: 8, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"hw:CARD=PCH,DEV=8\", avDataTypes: [I16, I32], prefDataType: I32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [], prefSampleRate: 48000.0, iChannelCount: 0, oChannelCount: 8, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"hw:CARD=PCH,DEV=9\", avDataTypes: [I16, I32], prefDataType: I32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [], prefSampleRate: 48000.0, iChannelCount: 0, oChannelCount: 8, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"plughw:CARD=PCH,DEV=0\", avDataTypes: [I8, I16, I32, F32, F64, I8, I16, I32, F32, F64], prefDataType: F32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [4000.0, 8000.0, 11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 44100.0, 48000.0, 88200.0, 96000.0, 192000.0, 384000.0], prefSampleRate: 384000.0, iChannelCount: 32, oChannelCount: 32, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"plughw:CARD=PCH,DEV=3\", avDataTypes: [I8, I16, I32, F32, F64], prefDataType: F32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [4000.0, 8000.0, 11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 44100.0, 48000.0, 88200.0, 96000.0, 192000.0, 384000.0], prefSampleRate: 384000.0, iChannelCount: 0, oChannelCount: 32, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"plughw:CARD=PCH,DEV=7\", avDataTypes: [I8, I16, I32, F32, F64], prefDataType: F32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [4000.0, 8000.0, 11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 44100.0, 48000.0, 88200.0, 96000.0, 192000.0, 384000.0], prefSampleRate: 384000.0, iChannelCount: 0, oChannelCount: 32, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"plughw:CARD=PCH,DEV=8\", avDataTypes: [I8, I16, I32, F32, F64], prefDataType: F32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [4000.0, 8000.0, 11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 44100.0, 48000.0, 88200.0, 96000.0, 192000.0, 384000.0], prefSampleRate: 384000.0, iChannelCount: 0, oChannelCount: 32, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"plughw:CARD=PCH,DEV=9\", avDataTypes: [I8, I16, I32, F32, F64], prefDataType: F32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [4000.0, 8000.0, 11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 44100.0, 48000.0, 88200.0, 96000.0, 192000.0, 384000.0], prefSampleRate: 384000.0, iChannelCount: 0, oChannelCount: 32, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"sysdefault:CARD=PCH\", avDataTypes: [I8, I16, I32, F32, F64, I8, I16, I32, F32, F64], prefDataType: F32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [4000.0, 8000.0, 11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 44100.0, 48000.0, 88200.0, 96000.0, 192000.0, 384000.0], prefSampleRate: 384000.0, iChannelCount: 32, oChannelCount: 32, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"front:CARD=PCH,DEV=0\", avDataTypes: [I16, I32, I16, I32], prefDataType: I32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [], prefSampleRate: 48000.0, iChannelCount: 2, oChannelCount: 2, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"surround40:CARD=PCH,DEV=0\", avDataTypes: [I16, I32, I16, I32], prefDataType: I32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [], prefSampleRate: 48000.0, iChannelCount: 2, oChannelCount: 2, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"surround51:CARD=PCH,DEV=0\", avDataTypes: [I16, I32, I16, I32], prefDataType: I32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [], prefSampleRate: 48000.0, iChannelCount: 2, oChannelCount: 2, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"surround71:CARD=PCH,DEV=0\", avDataTypes: [I16, I32, I16, I32], prefDataType: I32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [], prefSampleRate: 48000.0, iChannelCount: 2, oChannelCount: 2, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"hdmi:CARD=PCH,DEV=0\", avDataTypes: [I16, I32], prefDataType: I32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [], prefSampleRate: 48000.0, iChannelCount: 0, oChannelCount: 8, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"hdmi:CARD=PCH,DEV=1\", avDataTypes: [I16, I32], prefDataType: I32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [], prefSampleRate: 48000.0, iChannelCount: 0, oChannelCount: 8, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"hdmi:CARD=PCH,DEV=2\", avDataTypes: [I16, I32], prefDataType: I32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [], prefSampleRate: 48000.0, iChannelCount: 0, oChannelCount: 8, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"hdmi:CARD=PCH,DEV=3\", avDataTypes: [I16, I32], prefDataType: I32, avFramesPerBlock: [256, 512, 1024, 2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [], prefSampleRate: 48000.0, iChannelCount: 0, oChannelCount: 8, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"dmix:CARD=PCH,DEV=0\", avDataTypes: [I32], prefDataType: I32, avFramesPerBlock: [2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [48000.0], prefSampleRate: 48000.0, iChannelCount: 0, oChannelCount: 2, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"dmix:CARD=PCH,DEV=3\", avDataTypes: [I32], prefDataType: I32, avFramesPerBlock: [2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [48000.0], prefSampleRate: 48000.0, iChannelCount: 0, oChannelCount: 2, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"dmix:CARD=PCH,DEV=7\", avDataTypes: [I32], prefDataType: I32, avFramesPerBlock: [2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [48000.0], prefSampleRate: 48000.0, iChannelCount: 0, oChannelCount: 2, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"dmix:CARD=PCH,DEV=8\", avDataTypes: [I32], prefDataType: I32, avFramesPerBlock: [2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [48000.0], prefSampleRate: 48000.0, iChannelCount: 0, oChannelCount: 2, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"dmix:CARD=PCH,DEV=9\", avDataTypes: [I32], prefDataType: I32, avFramesPerBlock: [2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [48000.0], prefSampleRate: 48000.0, iChannelCount: 0, oChannelCount: 2, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number },\n",
" DeviceInfo { api: Cpal, device_name: \"dsnoop:CARD=PCH,DEV=0\", avDataTypes: [I32], prefDataType: I32, avFramesPerBlock: [2048, 8192], prefFramesPerBlock: 2048, avSampleRates: [48000.0], prefSampleRate: 48000.0, iChannelCount: 2, oChannelCount: 0, hasInputIEPE: false, hasInputACCouplingSwitch: false, hasInputTrigger: false, hasInternalOutputMonitor: false, duplexModeForced: false, physicalIOQty: Number }]"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ds"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "00635264-6cbc-4391-b207-308e859fd109",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}