How to register a virtual card to alsa from user-space?

落花浮王杯 提交于 2019-12-06 10:47:09

I think you should stop bothering about overriding any particular file (i.e. stop using umview, it's not needed) and simply use the "file" plugin to create device in the ALSA config that will pipe the data to your virtual device over a named pipe in /var/run/virtualsound/output or somewhere like that.

Unlike the umview approach, this will work in all applications without having to run them in any special way.

I've solved this problem some times ago,

Alsa user-space lib simply open every /dev/snd/controlC# from 0 to 32 and launch

ioclt(SNDRV_CTL_IOCTL_CARD_INFO,...);

in order to build a list with the installed sound-cards

so, if we mount our UmView module on /dev/snd/control# and we hijack the ioctl and answer to it, our module will be identified as a sound-card by ALSA

I've created a virtual sound device with that technique, you can find it at https://github.com/berdav/umdevaudio

this is a simple way to build a simple user-space driver.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!