{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "b0d15138", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "make: Entering directory '/home/anne/wip/mycode/lasp'\n", "make[1]: Entering directory '/home/anne/wip/mycode/lasp'\n", "make[2]: Entering directory '/home/anne/wip/mycode/lasp'\n", "\u001b[35m\u001b[1mConsolidate compiler generated dependencies of target lasp_dsp_lib\u001b[0m\n", "make[2]: Leaving directory '/home/anne/wip/mycode/lasp'\n", "[ 26%] Built target lasp_dsp_lib\n", "make[2]: Entering directory '/home/anne/wip/mycode/lasp'\n", "\u001b[35m\u001b[1mConsolidate compiler generated dependencies of target lasp_device_lib\u001b[0m\n", "make[2]: Leaving directory '/home/anne/wip/mycode/lasp'\n", "[ 63%] Built target lasp_device_lib\n", "make[2]: Entering directory '/home/anne/wip/mycode/lasp'\n", "\u001b[35m\u001b[1mConsolidate compiler generated dependencies of target lasp_cpp\u001b[0m\n", "make[2]: Leaving directory '/home/anne/wip/mycode/lasp'\n", "[100%] Built target lasp_cpp\n", "make[1]: Leaving directory '/home/anne/wip/mycode/lasp'\n", "make: Leaving directory '/home/anne/wip/mycode/lasp'\n" ] } ], "source": [ "!make -j -C ~/wip/mycode/lasp" ] }, { "cell_type": "code", "execution_count": 2, "id": "1787e24c", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2022-07-20 22:04:50+0200 DebugTrace-cpp 2.0.0a2 (g++ 12.1.0)\n", "2022-07-20 22:04:50+0200 \n", "2022-07-20 22:04:50+0200 Enter fillUlDaqDeviceInfo (lasp_uldaq.cpp: 514)\n", "2022-07-20 22:04:51+0200 Leave fillUlDaqDeviceInfo (lasp_uldaq.cpp)\n" ] } ], "source": [ "import lasp\n", "ds = lasp.DeviceInfo.getDeviceInfo()" ] }, { "cell_type": "code", "execution_count": 3, "id": "cb4ab7d8", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "init_daqconfiguration(pybind11::module_&)\r\n" ] } ], "source": [ "!c++filt _Z21init_daqconfigurationRN8pybind117module_E" ] }, { "cell_type": "code", "execution_count": 4, "id": "22ae99b1", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0: Monitor of Starship/Matisse HD Audio Controller Analog Stereo\n", "1: Starship/Matisse HD Audio Controller Analog Stereo\n", "2: GP108 High Definition Audio Controller Digital Stereo (HDMI)\n", "3: Monitor of GP108 High Definition Audio Controller Digital Stereo (HDMI)\n", "4: default\n", "5: hw:HDA NVidia,3\n", "6: hw:HDA NVidia,7\n", "7: hw:HDA NVidia,8\n", "8: hw:HDA NVidia,9\n", "9: hw:HDA NVidia,10\n", "10: hw:HD-Audio Generic,0\n", "11: hw:HD-Audio Generic,1\n", "12: hw:HD-Audio Generic,2\n" ] } ], "source": [ "for i, d in enumerate(ds):\n", " print(f'{i}: ' + d.device_name)\n", "d = ds[1]" ] }, { "cell_type": "code", "execution_count": 5, "id": "47385b02", "metadata": {}, "outputs": [], "source": [ "config = lasp.DaqConfiguration(d)\n", "config.outchannel_config[0].enabled = True\n", "config.outchannel_config[1].enabled = True" ] }, { "cell_type": "code", "execution_count": 59, "id": "d12f84b7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Out channels: 2\n", "In channels: 0\n" ] } ], "source": [ "print('Out channels:',d.noutchannels)\n", "print('In channels:',d.ninchannels)" ] }, { "cell_type": "code", "execution_count": 52, "id": "902ce309", "metadata": {}, "outputs": [], "source": [ "mgr = lasp.StreamMgr.getInstance()" ] }, { "cell_type": "code", "execution_count": 55, "id": "b209294b", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2022-07-20 22:07:02+0200 \n", "2022-07-20 22:07:02+0200 Enter createDaq (lasp_daq.cpp: 18)\n", "2022-07-20 22:07:02+0200 | Enter Daq (lasp_daq.cpp: 39)\n", "2022-07-20 22:07:02+0200 | Leave Daq (lasp_daq.cpp)\n", "2022-07-20 22:07:02+0200 | \n", "2022-07-20 22:07:02+0200 | Enter RtAudioDaq (lasp_rtaudiodaq.cpp: 131)\n", "2022-07-20 22:07:02+0200 | Leave RtAudioDaq (lasp_rtaudiodaq.cpp)\n", "2022-07-20 22:07:02+0200 Leave createDaq (lasp_daq.cpp)\n", "2022-07-20 22:07:02+0200 isInput = false\n", "2022-07-20 22:07:02+0200 isOutput = true\n", "2022-07-20 22:07:02+0200 \n", "2022-07-20 22:07:02+0200 Enter start (lasp_rtaudiodaq.cpp: 211)\n", "2022-07-20 22:07:02+0200 Leave start (lasp_rtaudiodaq.cpp)\n" ] } ], "source": [ "mgr.startStream(d, config)" ] }, { "cell_type": "code", "execution_count": 27, "id": "0830ffb5", "metadata": {}, "outputs": [], "source": [ "#mgr.stopAllStreams()" ] }, { "cell_type": "code", "execution_count": 60, "id": "a7fddc19", "metadata": {}, "outputs": [], "source": [ "mgr.stopAllStreams()" ] }, { "cell_type": "code", "execution_count": 57, "id": "f4610574", "metadata": {}, "outputs": [], "source": [ "sine = lasp.Sine(200)\n", "sine.setLevel(-20, True)\n", "mgr.setSiggen(sine)" ] }, { "cell_type": "code", "execution_count": 21, "id": "d11c7dae", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "0eeb2311", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.10.5" } }, "nbformat": 4, "nbformat_minor": 5 }