osdir.com
mailing list archive F.A.Q. -since 2001!



Subject: Re: Patch to rescan audio device while launched -
msg#00094

List: audio.portaudio.devel

Mail Archive Navigation:
by Date: Prev Next Date Index by Thread: Prev Next Thread Index

Hello,

I know it's been a while since I've originally sent this patch to this list, but I have finally been able to found time and a USB headset to test the Pa_Terminate(); Pa_Initialize(); method to rescan audio devices. And when plugging, unplugging the headset while using audio it causes my application to crash. So I'll keep my current implementation for now. Do you plan integrating this feature to portaudio?

-Yann

Yann Biancheri wrote:
Hello,

I've tried the solution of calling Pa_Terminate(); Pa_Initialize(); before starting implementation and it was causing my application to crash.
I beleive that one benefit of my solution is that it can detect audio devices while having some opened streams. In fact, it is just rescanning audio devices and not going all the way through destrotying, reconsrtucting the hostApis. In case no device are detected (which is really likely) nothing is destroyed or rebuilt and make my solution lighter since I'm calling this method every 10 seconds. I use PortAudio in a VoIP application and I'm able to detect newly inserted device and auto-select them while on the phone.
Do you beleive your hack can handle this use-case? If yes, then this patch just make the process lighter.

I've tried replacing my Pa_RescanDevice() implementation by Pa_Terminate(); Pa_Initialize(); and it doesn't crash my app while on the phone. It has one nice side effect of cutting the echo each time I do a rescan. Therefore, I didn't have any USB headset right now to test if the detection of a newly inserted device will crash the system. I'll test with an USB headset as soon as I can get one and will post the result in the mailing list.

At least it will be helpful to create an API call, or document somewhere how we can rescandevice if this method is retained.

-Yann

Ross Bencina wrote:
Hi Yann

I Could be missing something here. But why can't you just call Pa_Terminate(); Pa_Initialize(); to refresh the device list? That's what I do. What does the patch do beyond that? What are the benefits?

On a slightly separate topic: I think a more important patch would be to fix problems where PortAudio gets out of sync with the host API when devices are connected/disconnected. Ideally it should be able to resolve portAudio devices even if the underlying device indexes have changed...

Best wishes

Ross.




----- Original Message ----- From: "Yann Biancheri" <ybiancheri@xxxxxxxxxxxxxxxx>
To: <portaudio@xxxxxxxxxxxxxxx>
Sent: Tuesday, January 09, 2007 7:55 PM
Subject: [Portaudio] Patch to rescan audio device while launched


Hello,

I have worked in adding audio device detection in IAXClient while the application is launched, and I end up adding this feature in PortAudio. Looking at your track entries it seems that it corresponds to ticket#11 (http://www.portaudio.com/trac/ticket/11).
My implementation is quite basic and offers the opportunity to rescan audio devices by an API call.
There is no callback if a device is inserted or removed, but the new audio device information could be accessed through standard API calls. I've done only two hostApi's implementation so far, one for CoreAudio on mac and one for Wmme on windows which are the only ones I need in my appication. It's certainly not the best way to handle those problems but it is by far (in my opinion) the simpler way to do it.
Please found the patch here http://yannbiancheri.free.fr/rescanDevicePortAudio.patch.

Sincerly,
Yann Biancheri
_______________________________________________
Portaudio mailing list
Portaudio@xxxxxxxxxxxxxxx
http://techweb.rfa.org/mailman/listinfo/portaudio

_______________________________________________
Portaudio mailing list
Portaudio@xxxxxxxxxxxxxxx
http://techweb.rfa.org/mailman/listinfo/portaudio



Thread at a glance:

Previous Message by Date:

Re: native formatting?

Hi Greg   Just to avoid confusion: you need to distinguish between a file format (AIFF, WAV etc) and sample formats (16 bit integer, float, big/little-endian etc). It is only the sample formats which PortAudio is concerned with, and AIFF and WAV can both contain most of the supported PortAudio formats (although the endianness is fixed and different for each file format)... file formats are realtively complex beasts and unless you have good reason you be well advised to use a library like libsndfile to interface to them.   Best wishes   Ross.   ----- Original Message ----- From: Greg To: port audio Sent: Tuesday, February 20, 2007 2:33 PM Subject: [Portaudio] native formatting? hi all,i was just wondering if portaudio does any formating for the platforms. ex: when i record some signal if i were to save it, is in in .wav if i'm on windows or .aiff on mac, or is it simply a PCM file that i have to compress later.thanks Never miss an email again!Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out.

Next Message by Date:

Re: Patch to rescan audio device while launched

Hi Yann I'm a bit unsure about the crash you describe, and how your patch fixes it. I am guessing that whatever prevents the crash is separate from the device load/restore functionality. What do you think? Overall, although I agree that the functionality is desirable, I am reluctant to introduce such a significant API change at the moment since it obviously impacts all implementations and significantly increases implementation complexity... what do others think? Ross. ----- Original Message ----- From: "Yann Biancheri" <ybiancheri@xxxxxxxxxxxxxxxx> To: "Yann Biancheri" <ybiancheri@xxxxxxxxxxxxxxxx> Cc: "Ross Bencina" <rossb-lists@xxxxxxxxxxxxxx>; <portaudio@xxxxxxxxxxxxxxx> Sent: Thursday, February 22, 2007 7:42 PM Subject: Re: [Portaudio] Patch to rescan audio device while launched Hello, I know it's been a while since I've originally sent this patch to this list, but I have finally been able to found time and a USB headset to test the Pa_Terminate(); Pa_Initialize(); method to rescan audio devices. And when plugging, unplugging the headset while using audio it causes my application to crash. So I'll keep my current implementation for now. Do you plan integrating this feature to portaudio? -Yann Yann Biancheri wrote: Hello, I've tried the solution of calling Pa_Terminate(); Pa_Initialize(); before starting implementation and it was causing my application to crash. I beleive that one benefit of my solution is that it can detect audio devices while having some opened streams. In fact, it is just rescanning audio devices and not going all the way through destrotying, reconsrtucting the hostApis. In case no device are detected (which is really likely) nothing is destroyed or rebuilt and make my solution lighter since I'm calling this method every 10 seconds. I use PortAudio in a VoIP application and I'm able to detect newly inserted device and auto-select them while on the phone. Do you beleive your hack can handle this use-case? If yes, then this patch just make the process lighter. I've tried replacing my Pa_RescanDevice() implementation by Pa_Terminate(); Pa_Initialize(); and it doesn't crash my app while on the phone. It has one nice side effect of cutting the echo each time I do a rescan. Therefore, I didn't have any USB headset right now to test if the detection of a newly inserted device will crash the system. I'll test with an USB headset as soon as I can get one and will post the result in the mailing list. At least it will be helpful to create an API call, or document somewhere how we can rescandevice if this method is retained. -Yann Ross Bencina wrote: Hi Yann I Could be missing something here. But why can't you just call Pa_Terminate(); Pa_Initialize(); to refresh the device list? That's what I do. What does the patch do beyond that? What are the benefits? On a slightly separate topic: I think a more important patch would be to fix problems where PortAudio gets out of sync with the host API when devices are connected/disconnected. Ideally it should be able to resolve portAudio devices even if the underlying device indexes have changed... Best wishes Ross. ----- Original Message ----- From: "Yann Biancheri" <ybiancheri@xxxxxxxxxxxxxxxx> To: <portaudio@xxxxxxxxxxxxxxx> Sent: Tuesday, January 09, 2007 7:55 PM Subject: [Portaudio] Patch to rescan audio device while launched Hello, I have worked in adding audio device detection in IAXClient while the application is launched, and I end up adding this feature in PortAudio. Looking at your track entries it seems that it corresponds to ticket#11 (http://www.portaudio.com/trac/ticket/11). My implementation is quite basic and offers the opportunity to rescan audio devices by an API call. There is no callback if a device is inserted or removed, but the new audio device information could be accessed through standard API calls. I've done only two hostApi's implementation so far, one for CoreAudio on mac and one for Wmme on windows which are the only ones I need in my appication. It's certainly not the best way to handle those problems but it is by far (in my opinion) the simpler way to do it. Please found the patch here http://yannbiancheri.free.fr/rescanDevicePortAudio.patch. Sincerly, Yann Biancheri _______________________________________________ Portaudio mailing list Portaudio@xxxxxxxxxxxxxxx http://techweb.rfa.org/mailman/listinfo/portaudio _______________________________________________ Portaudio mailing list Portaudio@xxxxxxxxxxxxxxx http://techweb.rfa.org/mailman/listinfo/portaudio

Previous Message by Thread:

PortAudio uses SETTRIGGER incorrectly

Hi, PortAudio is currently broken on all devices that doesn't support SETTRIGGER. The current code simply assumes the ioctl is supported and fails startup if an error is returned. But the OSS API defines that a device will set DSP_CAP_TRIGGER if it support triggers. Rgds -- Pierre Ossman OpenSource-based Thin Client Technology System Developer Telephone: +46-13-21 46 00 Cendio AB Web: http://www.cendio.com signature.asc Description: OpenPGP digital signature

Next Message by Thread:

Re: Patch to rescan audio device while launched

Hi Yann I'm a bit unsure about the crash you describe, and how your patch fixes it. I am guessing that whatever prevents the crash is separate from the device load/restore functionality. What do you think? Overall, although I agree that the functionality is desirable, I am reluctant to introduce such a significant API change at the moment since it obviously impacts all implementations and significantly increases implementation complexity... what do others think? Ross. ----- Original Message ----- From: "Yann Biancheri" <ybiancheri@xxxxxxxxxxxxxxxx> To: "Yann Biancheri" <ybiancheri@xxxxxxxxxxxxxxxx> Cc: "Ross Bencina" <rossb-lists@xxxxxxxxxxxxxx>; <portaudio@xxxxxxxxxxxxxxx> Sent: Thursday, February 22, 2007 7:42 PM Subject: Re: [Portaudio] Patch to rescan audio device while launched Hello, I know it's been a while since I've originally sent this patch to this list, but I have finally been able to found time and a USB headset to test the Pa_Terminate(); Pa_Initialize(); method to rescan audio devices. And when plugging, unplugging the headset while using audio it causes my application to crash. So I'll keep my current implementation for now. Do you plan integrating this feature to portaudio? -Yann Yann Biancheri wrote: Hello, I've tried the solution of calling Pa_Terminate(); Pa_Initialize(); before starting implementation and it was causing my application to crash. I beleive that one benefit of my solution is that it can detect audio devices while having some opened streams. In fact, it is just rescanning audio devices and not going all the way through destrotying, reconsrtucting the hostApis. In case no device are detected (which is really likely) nothing is destroyed or rebuilt and make my solution lighter since I'm calling this method every 10 seconds. I use PortAudio in a VoIP application and I'm able to detect newly inserted device and auto-select them while on the phone. Do you beleive your hack can handle this use-case? If yes, then this patch just make the process lighter. I've tried replacing my Pa_RescanDevice() implementation by Pa_Terminate(); Pa_Initialize(); and it doesn't crash my app while on the phone. It has one nice side effect of cutting the echo each time I do a rescan. Therefore, I didn't have any USB headset right now to test if the detection of a newly inserted device will crash the system. I'll test with an USB headset as soon as I can get one and will post the result in the mailing list. At least it will be helpful to create an API call, or document somewhere how we can rescandevice if this method is retained. -Yann Ross Bencina wrote: Hi Yann I Could be missing something here. But why can't you just call Pa_Terminate(); Pa_Initialize(); to refresh the device list? That's what I do. What does the patch do beyond that? What are the benefits? On a slightly separate topic: I think a more important patch would be to fix problems where PortAudio gets out of sync with the host API when devices are connected/disconnected. Ideally it should be able to resolve portAudio devices even if the underlying device indexes have changed... Best wishes Ross. ----- Original Message ----- From: "Yann Biancheri" <ybiancheri@xxxxxxxxxxxxxxxx> To: <portaudio@xxxxxxxxxxxxxxx> Sent: Tuesday, January 09, 2007 7:55 PM Subject: [Portaudio] Patch to rescan audio device while launched Hello, I have worked in adding audio device detection in IAXClient while the application is launched, and I end up adding this feature in PortAudio. Looking at your track entries it seems that it corresponds to ticket#11 (http://www.portaudio.com/trac/ticket/11). My implementation is quite basic and offers the opportunity to rescan audio devices by an API call. There is no callback if a device is inserted or removed, but the new audio device information could be accessed through standard API calls. I've done only two hostApi's implementation so far, one for CoreAudio on mac and one for Wmme on windows which are the only ones I need in my appication. It's certainly not the best way to handle those problems but it is by far (in my opinion) the simpler way to do it. Please found the patch here http://yannbiancheri.free.fr/rescanDevicePortAudio.patch. Sincerly, Yann Biancheri _______________________________________________ Portaudio mailing list Portaudio@xxxxxxxxxxxxxxx http://techweb.rfa.org/mailman/listinfo/portaudio _______________________________________________ Portaudio mailing list Portaudio@xxxxxxxxxxxxxxx http://techweb.rfa.org/mailman/listinfo/portaudio
blog comments powered by Disqus

Home | News | Sitemap | FAQ | advertise | OSDir is an Inevitable website. GBiz is too!