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

2018-01-17 Thread Ralph Corderoy
Hi Terry,

(Been offline.)

> You may remember my queries in November of last year regarding the use
> of two USB Audio Adaptors with a Raspberry Pi

I've been struggling to find this in the archives.  Even assuming 2016.
https://mailman.lug.org.uk/mailman/private/dorset/
https://www.mail-archive.com/dorset@mailman.lug.org.uk/

> At the time it was suggested that I could discriminate between the two
> adaptors by reading their ID string.

I recall, but would like to find that again in case there was other
useful bits.  :-)

> I managed to obtain a couple of USB Audio Adaptors with a different ID
> string

How are you observing the ID string?  I think you might be wrongly
calling something else that.  It's not the `0d8c:013c' or `8086:0808'.

BTW, when you did `dmesg | grep PnP' you may have discarded useful
information in the vicinity of `PnP' lines that didn't contain that
text, so it could be worth looking again.

Also, `udevadm info -e' may give interesting details to distinguish the
two, but you'd have to search through the output for `audio' and poke
about.

> This is weird, I think something is cutting off the information that I
> have been putting at the end of the message.  One more time:

You've had this before.  I thought then you were sending a HTML email
and Mailman was stripping it back to plain text, losing a lot of the
content, and suggested you ensure you're sending plain text instead.  If
that can't be done, put the text in a file and paste the output of
`base64 

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

2018-01-17 Thread Terry Coles
On Wednesday, 17 January 2018 17:04:56 GMT Ralph Corderoy wrote:
> I've been struggling to find this in the archives.  Even assuming 2016.
> https://mailman.lug.org.uk/mailman/private/dorset/
> https://www.mail-archive.com/dorset@mailman.lug.org.uk/
> 
> > At the time it was suggested that I could discriminate between the two
> > adaptors by reading their ID string.

I thought that it was William Sowerbutts that said it, but I couldn't find that 
either.  What I did find was this:

https://mailman.lug.org.uk/mailman/private/dorset/2016-December/015967.html

Which might be the answer.  I'll not be able to follow this up for a day or 
two, because of family illness and other commitments, but I'll have a look at 
the OMG! Ubuntu link and see if I can make it work.
 
> How are you observing the ID string?  I think you might be wrongly
> calling something else that.  It's not the `0d8c:013c' or `8086:0808'.

Those numbers are the Manufacturer's ID.  I'm sure that someone thought that 
these could be used; maybe it was simply said at a Meeting.

I've been getting those numbers from lsusb.

> BTW, when you did `dmesg | grep PnP' you may have discarded useful
> information in the vicinity of `PnP' lines that didn't contain that
> text, so it could be worth looking again.

I also tried `dmesg | tail' and that wasn't much use either.

> Also, `udevadm info -e' may give interesting details to distinguish the
> two, but you'd have to search through the output for `audio' and poke
> about.

Yes that was what William was referring to in his post.

> You've had this before.  I thought then you were sending a HTML email
> and Mailman was stripping it back to plain text, losing a lot of the
> content, and suggested you ensure you're sending plain text instead.  If
> that can't be done, put the text in a file and paste the output of
> `base64 

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

2018-01-17 Thread Ralph Corderoy
Hi Terry,

> What I did find was this:
>
> https://mailman.lug.org.uk/mailman/private/dorset/2016-December/015967.html

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 udev, especially the second section where he has five
identical USB audio interfaces wired to distinct rooms.

> > It's not the `0d8c:013c' or `8086:0808'.
>
> Those numbers are the Manufacturer's ID.

In USB terms, they're the Vendor and Product IDs, both 16-bit.  8086 is
Intel's.  :-)  http://www.linux-usb.org/usb-ids.html doesn't know
Intel's 0808 and that's why lsusb(8) isn't saying anything more than
`Intel Corp.'.  That site accepts patches.

The CM108 datasheet says it can have a 93C46 EEPROM attached that
contains the serial number, amongst other things, and it can then be
written using USB HID according to the datasheet from
https://www.cmedia.com.tw/support/download_center/39
I expect it's normally ommitted for cost.  :-)

> I also tried `dmesg | tail' and that wasn't much use either.

No, that's right.  You have to search for likely things and then read
the context either side.

Cheers, Ralph.

-- 
Next meeting:  Bournemouth, Tuesday, 2018-02-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

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

2018-01-17 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 udev, especially the second section where he has five
> identical USB audio interfaces wired to distinct rooms.

That will be useful.

Looking again at my link to the post by William, noticed in my follow-up 
replies that I had 
been struggling a bit with the udev solution too.

I then looked at the discussions that went on after that time and remembered 
that I had 
originally been using a Pi Zero and a 'Naked' USB Hub from ModMyPi and had 
discovered, 
through this list, that the Zero has a Single-TT USB port and that had been at 
the root of 
the problem.

I then switched to using a Pi 3, which has a Multi-TT USB port.  The Pi 3 has 
an audio 
output, the whole problem of using multiple USB Audio Adaptors went away.

The rest is history  (well so was that really :-) )

> In USB terms, they're the Vendor and Product IDs, both 16-bit.  8086 is
> Intel's.  :-)  http://www.linux-usb.org/usb-ids.html doesn't know
> Intel's 0808 and that's why lsusb(8) isn't saying anything more than
> `Intel Corp.'.  That site accepts patches.

Yes.  I've always understood that, but since lsusb provided these numbers, I've 
always 
believed (until now) that they could be used to identify which interface 
carried the Audio 
device for the Bells and which for the music.

-- 



Terry Coles
-- 
Next meeting:  Bournemouth, Tuesday, 2018-02-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR