Page 1 of 1

Problems: USB C-Media Electronics, Inc. CM108 Audio Controller

Posted: Sat May 19, 2018 9:59 am
by RaspISteve
I have had the USB Audio stick (see Subject) for a while and I remember it working correctly but this all predates Jessie and Stretch. The USB stick works as advertised on my Ubuntu 16.04 laptop but not on current Rasbian. Have searched here for solutions finding a lot of now dated threads. Found setup advice on one of the supplier web sites which I followed including a simple test sending a sound file but without success. This USB Audio stick has worked on one of my early Pis but it was a while ago.

I have an application developed on my Ubuntu 16.04 that uses the DEFAULT audio in/out. Transferring it to my Pi (tried Jessie and Stretch (and re-compiling, Duh!)) and confirming the built in sound is set to DEFAULT using the GUI Sound thing (and in the .conf file) it works (I hear what I expect from the speaker). However , I also need audio input hence the need for the USB Audio stick.

Changing the DEFAULT audio to the USB stick and re-running my application it barfs, it can't find the audio device on output (although the error report is more generic/vague) and it times out on input. I also tried "aplay .." and that barfs. Symptoms suggest that although the GUI sees it and lets me define it as DEFAULT applications can't find the USB Audio. The core of the application is from GitHub and also works in Ubuntu so I'm guessing its a Pi problem.

The application does allow specifying an audio device by name but I'm stuffed if I know what this one is called in the system or how to ask it what its called. I would be very happy to take input on this along with any other clues as to why I can't access this audio device as DEFAULT.

Re: Problems: USB C-Media Electronics, Inc. CM108 Audio Controller

Posted: Sat May 19, 2018 1:53 pm
by RaspISteve
A bit more detail... Remembering the application works correctly on my Ubuntu 16.04 laptop...

I can get the audio output mode to NOT barf on a PI (currently Jessie) if I change the code to open TWO channels vice ONE.

Code: Select all

i=snd_pcm_set_params(pcm, format, SND_PCM_ACCESS_RW_INTERLEAVED, 2, rate, 0, 1000 * audio_latency);
/* int snd_pcm_set_params(
                snd_pcm_t *   pcm,
                snd_pcm_format_t format,
                snd_pcm_access_t access,
                unsigned int channels,
                unsigned int rate,
                int soft_resample,
                unsigned int latency)
Whether the output is at the correct pitch I haven't determined (1 channel data -> 2 channels). Making the Raspbian OS working differently to Ubuntu 16.04.

Confusingly setting TWO channel mode allows the audio generate mode to work but this barfs out on error for audio input mode.

Still not getting any audio input. I times out on "nothing heard".