Project

General

Profile

Actions

Submit #2682

closed

Fix for uaudio driver, so it can be used on DragonFly

Added by shamaz over 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Kernel
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Hello. A new uaudio driver for usb4bsd (sys/bus/u4b/audio) needs some care
and love. Currently it can only probe audio devices, that is all. So I
propose a patch which makes this driver useful.

What works: playback with different audio formats and sample rates (8/16
bit pcm, 44.1kHz, 8kHz and so on). Up to 2 channels (what most people need
;). Module loading/unloading.
What does not: multichannel environments, mixer master output level ("vol")
affects only left channel, I really do not know why.
What was not tested: recording

Is it good enough to be committed?

With best regards, Vasily.

Files

uaudio.patch (3.47 KB) uaudio.patch shamaz, 06/08/2014 11:19 AM
uaudio.patch (7.07 KB) uaudio.patch shamaz, 06/09/2014 10:02 AM
uaudio.patch (6.33 KB) uaudio.patch shamaz, 07/02/2014 09:37 AM
Actions #1

Updated by profmakx over 10 years ago

Can you please make sure that the mixer is properly protected using snd_mtxlock/snd_mtxunlock when modifying it?

Actions #2

Updated by profmakx over 10 years ago

I also get the following errors when I try building with the patch applied:

/home/makx/src/sys/bus/u4b/audio/uaudio_pcm.c:76:1: error: 'ua_chan_setfragments' defined but not used [-Werror=unused-function]
/home/makx/src/sys/bus/u4b/audio/uaudio_pcm.c:107:1: error: 'ua_chan_getmatrix' defined but not used [-Werror=unused-function]
cc1: all warnings being treated as errors
  • [uaudio_pcm.o] Error code 1
Actions #3

Updated by profmakx over 10 years ago

  • Assignee set to profmakx
Actions #4

Updated by shamaz over 10 years ago

Here is the new patch. It fixes mixer problem (so you can control volume of both channels). Please note, that it affects both pcm (sound) and uaudio drivers. Also, MIXER_UNINIT is called with mixer lock released now, as it is in FreeBSD. Is it ok? Or maybe do I need to release/unsetup usb transfer/acquire mixer lock in mixer_uninit method explicitly?

Actions #5

Updated by jorisgio over 10 years ago

  • Tracker changed from Bug to Submit
  • Category set to Kernel
  • Target version set to 3.9.x
Actions #6

Updated by shamaz over 10 years ago

This is a variation I use now, if someone is still interested. I moved new functionality from pcm driver to uaudio (only round_bufdz in dev/sound/pcm/channel.c was left modified to accept any values of min and max, not just power of 2). Now I am sure it will not break anything else.

Actions #7

Updated by profmakx over 10 years ago

Hi,

I haven't forgotten about your patch, I am just rather busy fumbling with other issues at the moment. I'll integrate it this weekend. Cheers for submitting!

Actions #8

Updated by profmakx over 10 years ago

  • Status changed from New to Feedback

I applied your patch to master.

Actions #9

Updated by dragonflybsd1 about 10 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF