Solved Connecting USB headset

Argentum

Aspiring Daemon

Reaction score: 236
Messages: 507

Hello,

It is probably a simple issue, but I am stuck here:

When I connect the headset, it looks good in /var/log/messages:

Code:
Jun 10 09:08:20 CUPRUM kernel: ugen0.4: <Logitech Logitech USB Headset> at usbus0
Jun 10 09:08:20 CUPRUM kernel: uaudio0 on uhub0
Jun 10 09:08:20 CUPRUM kernel: uaudio0: <Logitech Logitech USB Headset, class 0/0, rev 1.10/1.0f, addr 4> on us
bus0
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Play[0]: 48000 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Play[0]: 44100 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Play[0]: 40000 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Play[0]: 32000 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Play[0]: 24000 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Play[0]: 22050 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Play[0]: 16000 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Play[0]: 11025 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Play[0]: 8000 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Record[0]: 48000 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Record[0]: 44100 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Record[0]: 40000 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Record[0]: 32000 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Record[0]: 24000 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Record[0]: 22050 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Record[0]: 16000 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Record[0]: 11025 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: Record[0]: 8000 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jun 10 09:08:20 CUPRUM kernel: uaudio0: No MIDI sequencer.
Jun 10 09:08:20 CUPRUM kernel: pcm5: <USB audio> on uaudio0
Jun 10 09:08:20 CUPRUM kernel: uaudio0: HID volume keys found.

Also:

1623306676090.png


The volume control on the headset cable also works moving the slider, but I can not switch the sound to the headset. It keeps coming from laptop built in audio.

Please help!
 

mer

Well-Known Member

Reaction score: 287
Messages: 487

All applications, some applications?
That dialog box, what DE are you using?

The following is some debugging to get data, we may be able to get the headset to work, but the following is not designed to "fix" the issue.

What is the output of the command:

cat /dev/sndstat
In the output, look for the line that says "USB audio" and remember the number after pcm.
Your /var/log/messages shows pcm5, so the 5 is important.

How about the output of the command:
sysctl hw.snd.default_unit

As a test, as root, do the following:
sysctl -w hw.snd.default_unit=5

The 5 would be whatever pcm is for USB audio in /dev/sndstat.

You may also want to look at the output of the command:
mixer -f /dev/mixerN

where N is the number after pcm in /dev/sndstat for USB audio.

If manually setting the default unit to point to the USB audio device works then I'd guess the settings are not flowing from the preferences to applications. There are different audio backends for the DEs, I don't use any DE (just old fashioned WM) so I manually set up the default audio unit and it works fine across applications.
 
OP
Argentum

Argentum

Aspiring Daemon

Reaction score: 236
Messages: 507

All applications, some applications?
I have tried with multimedia/minitube, www/chromium and www/firefox. I think all apps.

That dialog box, what DE are you using?
I am using MATE.

The following is some debugging to get data, we may be able to get the headset to work, but the following is not designed to "fix" the issue.

What is the output of the command:

cat /dev/sndstat
Code:
Installed devices:
pcm0: <Realtek ALC269 (Analog)> (play/rec) default
pcm1: <Realtek ALC269 (Analog)> (play/rec)
pcm2: <Intel Panther Point (HDMI/DP 8ch)> (play)
pcm3: <Intel Panther Point (HDMI/DP 8ch)> (play)
pcm4: <Intel Panther Point (HDMI/DP 8ch)> (play)
pcm5: <USB audio> (play/rec)
No devices installed from userspace.

In the output, look for the line that says "USB audio" and remember the number after pcm.
Your /var/log/messages shows pcm5, so the 5 is important.

How about the output of the command:
sysctl hw.snd.default_unit
Code:
hw.snd.default_unit: 0
As a test, as root, do the following:
sysctl -w hw.snd.default_unit=5
Did not help.


The 5 would be whatever pcm is for USB audio in /dev/sndstat.

You may also want to look at the output of the command:
mixer -f /dev/mixerN

where N is the number after pcm in /dev/sndstat for USB audio.
Code:
root@CUPRUM ~# mixer -f /dev/mixer5
Mixer vol      is currently set to 100:100
Mixer pcm      is currently set to  75:75
Mixer mic      is currently set to  25:25
Recording source: mic
If manually setting the default unit to point to the USB audio device works then I'd guess the settings are not flowing from the preferences to applications. There are different audio backends for the DEs, I don't use any DE (just old fashioned WM) so I manually set up the default audio unit and it works fine across applications.
The Mixer vol can be changed by headset controls.

Still I am not able to play from browser to headset. It comes from laptop speaker.
 

mer

Well-Known Member

Reaction score: 287
Messages: 487

I'm out of my depth on it if setting default device doesn't work. Maybe the data will help someone who knows than I do.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,027
Messages: 38,480

You probably need to restart the application after you changed the default audio device. I'm not sure if applications will pick this up dynamically.
 
OP
Argentum

Argentum

Aspiring Daemon

Reaction score: 236
Messages: 507

You probably need to restart the application after you changed the default audio device. I'm not sure if applications will pick this up dynamically.
Restarted the app and also tried to restart the whole MATE desktop, but this does not help.
 

Alexander88207

Aspiring Daemon

Reaction score: 423
Messages: 644

Hello,

you may want to use audio/mixertui for a proper easy managing of audio devices.

Please know that after switching the default device, pulseaudio have to be killed/restarted with killall pulseaudio and also maybe need to restart the apps like firefox.

Pulseaudio tries to determine default values for FreeBSD OSS driver at first start, based on /dev/sndstat output. The hw.snd.default_unit sysctl may affect these values, but restart of the Pulseaudio might be needed to rescan it again....
 
OP
Argentum

Argentum

Aspiring Daemon

Reaction score: 236
Messages: 507

Hello,

you may want to use audio/mixertui for a proper easy managing of audio devices.

Please know that after switching the default device, pulseaudio have to be killed/restarted with killall pulseaudio and also maybe need to restart the apps like firefox.
Amazing! That worked. But what exactly? I will try this again on another machine. Marked this thread solved.

1623321624222.png
 
Top