Re: [Dorset] Using Two USB Audio Adaptors and Selecting the Right One Programatically

2018-01-21 Thread Hamish MB
I think Ralph's solution is the better on if it works - instead of removing const from that cast, declare the variable as const. Why is it that you dislike C++ Ralph? I admit it is overcomplicated, but I'm quite fond of it :) Hamish On 21 Jan 2018, at 16:30, Terry Coles

Re: [Dorset] Using Two USB Audio Adaptors and Selecting the Right One Programatically

2018-01-21 Thread Terry Coles
On Sunday, 21 January 2018 16:23:56 GMT Ralph Corderoy wrote: > I haven't time to reply to your original email at the moment, though > from a quick skim the use of a compiled language looks like overkill, > and tedious due to low-level parsing. Ralph, No rush, but would you use something like

Re: [Dorset] Using Two USB Audio Adaptors and Selecting the Right One Programatically

2018-01-21 Thread Ralph Corderoy
Hi Terry, I haven't time to reply to your original email at the moment, though from a quick skim the use of a compiled language looks like overkill, and tedious due to low-level parsing. > $ g++ USB_Audio_Fix.cpp -o alsa_name > USB_Audio_Fix.cpp: In function ‘int GetDValue(const char*)’: >

Re: [Dorset] Using Two USB Audio Adaptors and Selecting the Right One Programatically

2018-01-21 Thread Terry Coles
On Sunday, 21 January 2018 16:02:03 GMT Hamish MB wrote: > Yes, it seems to me that this code has a mistake in it. The fix doesn't > change how the code works, just fixes (assuming this was indeed a mistake) > that cast, which seems like something that could never work to me. Well. I made the

Re: [Dorset] Using Two USB Audio Adaptors and Selecting the Right One Programatically

2018-01-21 Thread Hamish MB
Hi, Yes, it seems to me that this code has a mistake in it. The fix doesn't change how the code works, just fixes (assuming this was indeed a mistake) that cast, which seems like something that could never work to me. As far as I can see, that's an error in the code, because it tried to do

Re: [Dorset] Using Two USB Audio Adaptors and Selecting the Right One Programatically

2018-01-21 Thread Terry Coles
On Sunday, 21 January 2018 15:31:15 GMT Hamish MB wrote: > Try removing the "const" from the cast for the variable k, so it instead > reads: > char *p = strrchr((char *)k, 'D'); So you are suggesting that the code on the website where I got this from is in error? If so, I wonder how he got it

Re: [Dorset] Using Two USB Audio Adaptors and Selecting the Right One Programatically

2018-01-21 Thread Hamish MB
Hi, Try removing the "const" from the cast for the variable k, so it instead reads: char *p = strrchr((char *)k, 'D'); This may or may not fix the problem depending on how the rest of the code works. You can't cast a const type variable to a non-const type because it would potentially have

Re: [Dorset] Using Two USB Audio Adaptors and Selecting the Right One Programatically

2018-01-21 Thread Terry Coles
On Sunday, 21 January 2018 12:35:16 GMT Terry Coles wrote: > I'm starting to get my head round this and think that I have a fighting > chance of sorting it out. However, I have a couple of queries (so far), > both coming from the C++ code in your second link. I'm having problems compiling the

Re: [Dorset] Using Two USB Audio Adaptors and Selecting the Right One Programatically

2018-01-21 Thread Terry Coles
On Wednesday, 17 January 2018 23:06:44 GMT Ralph Corderoy wrote: > There's also https://alsa.opensrc.org/MultipleUSBAudioDevices that > describes the parameters the kernel module can take to index the audio > interfaces, and https://alsa.opensrc.org/Udev that it links to at the > end for using