Re: snd_ctl_open and snd_rawmidi_open conflict

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Mon, 31 Jul 2006 04:52:21 +0400,
Dmitry Baikov wrote:
> 
> Hello!
> 
> I'm writing a program that have to open all rawmidi ports, and
> periodically remove nonexisting ones, and open new ones (read, deal
> with usb-midi connect/disconnect).
> 
> For example, we have USB-midi interface with 2 ports: hw:1,0,0 and hw:1,0,1
> To get the list, I make snd_ctl_open("hw:1), then walk through
> devices/subdevices and try to open all rawmidi ports. The problem is,
> that I can only open first one - hw:1,0,0, trying to open another
> gives "Device or resource is busy".
> 
> If I do NOT have ctl opened, I can open all subdevices without trouble.

Could you check the behavior via strace?

> Another releated question is: how can I detect connection of a new
> usb-midi device?
> For now I use inotify on /dev/snd, but it's a kludge, cause I have to
> add sleep(1) before actual rescan of devices, or I miss the update.

HAL would be the best friest for such a thing.


Takashi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux