Opened 18 years ago

Closed 16 years ago

Last modified 16 years ago

#3405 closed enhancement (fixed)

ALSA input for analog capture

Reported by: anonymous Owned by: Janne Grunau
Priority: minor Milestone: 0.22
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Currently, mythtv only supports OSS for analog capture. Since ALSA is the main audio system for Linux (2.6.0+), mythtv should alsa support ALSA capture.

Attachments (8)

mythtv_alsa.patch (28.9 KB ) - added by amistry@… 18 years ago.
Patch for alsa capture
mythtv_alsa-2.patch (29.0 KB ) - added by amistry@… 18 years ago.
Further adhere to coding standards
3405-v1.patch (33.0 KB ) - added by danielk 18 years ago.
Cleans up error handling, moves from libmythtv to libmyth so mythphone can use it evenually.
3405-v2.patch (33.0 KB ) - added by danielk 18 years ago.
This just updates the patch for the current trunk. It still needs to handle error conditions better.
alsa_input_3405-v3-trunk-18043.patch.gz (8.3 KB ) - added by Alan Calvert <cal@…> 17 years ago.
3405-v4.patch (41.0 KB ) - added by Alan Calvert <cal@…> 17 years ago.
@ 18856
3405-v5.patch.gz (8.7 KB ) - added by Alan Calvert <cal@…> 17 years ago.
@ 19944
3405-v6.patch.gz (8.5 KB ) - added by Alan Calvert <cal@…> 16 years ago.
refresh @ 20846, lightly tested.

Download all attachments as: .zip

Change History (25)

by amistry@…, 18 years ago

Attachment: mythtv_alsa.patch added

Patch for alsa capture

by amistry@…, 18 years ago

Attachment: mythtv_alsa-2.patch added

Further adhere to coding standards

comment:1 by Stuart Auchterlonie, 18 years ago

Milestone: unknown0.21
Version: unknownhead

OSSAudioInput::OpenDevice() is broken.

If the device open fails it throws a verbose error but then continues on it's merry way.

It repeatedly checks if (0 <= retval) and while it is reusing retval it just looks plain wrong.

Stuart

comment:2 by amistry@…, 18 years ago

Stuart: You're right, it is broken, but only with respect to logging info. The point of the repeated checking is to give the function a single return point at the end of the function. This way, I only have to do any potential cleanup at one point, at the end. All the 'if (0 <= retval)' is there to make sure further code only executes if everything up until that point is OK. If it's not, it'll be skipped and a return code of < 0 (usually -1) will signify an error. You'll notice all the functions I've wrote are like that inclusing the alsa input. If for some reason this is unacceptable, I can rework the patch to put returns after each error instead of just at the end.

comment:3 by danielk, 18 years ago

Owner: changed from Isaac Richards to danielk
Type: patchenhancement

by danielk, 18 years ago

Attachment: 3405-v1.patch added

Cleans up error handling, moves from libmythtv to libmyth so mythphone can use it evenually.

comment:4 by danielk, 18 years ago

Milestone: 0.210.22

by danielk, 18 years ago

Attachment: 3405-v2.patch added

This just updates the patch for the current trunk. It still needs to handle error conditions better.

comment:5 by Alan Calvert <cal@…>, 17 years ago

Presenting patch alsa_input_3405-v3-trunk-18043:
I've use this patch on three systems for over a year, so I'm interested in it's welfare. This little effort started as a refresh to current trunk, but it sort of morphed beyond that. Perhaps I've addressed some of danielk's concerns over error handling. Subjectively, I believe it holds synch better than anything else I've tried. Objectively, it seems to work ok, and does pretty much all the things it needs to do to perform respectably. Enjoy.

by Alan Calvert <cal@…>, 17 years ago

by Alan Calvert <cal@…>, 17 years ago

Attachment: 3405-v4.patch added

@ 18856

comment:6 by Alan Calvert <cal@…>, 17 years ago

v3 was pretty rough, v4 is a bit nicer.

comment:7 by Dibblah, 17 years ago

Status: newassigned

comment:8 by Janne Grunau, 17 years ago

Owner: changed from danielk to Janne Grunau
Status: assignedaccepted

by Alan Calvert <cal@…>, 17 years ago

Attachment: 3405-v5.patch.gz added

@ 19944

comment:9 by Alan Calvert <cal@…>, 17 years ago

3405-v5 refresh to 19944, some tweaks & tidies, and reinstate alsa device selection (it fell off).

in reply to:  description comment:10 by anonymous, 16 years ago

Any update on this?

Kernels built without OSS support are becoming more common (like in Fedora 11) so it's an actual problem now.

comment:11 by anonymous, 16 years ago

And software-based analogue capture cards are becoming less common, antiquated tech ...

Actually that's an understatement, they were surpassed by hardware capture cards years ago.

comment:12 by anonymous, 16 years ago

Maybe so, but I have such a card and I'm not afraid to use it. ;)

I'm compiling svn+patch now, to test it.

comment:13 by anonymous, 16 years ago

Been using the patch for a while now and it seems to work.

by Alan Calvert <cal@…>, 16 years ago

Attachment: 3405-v6.patch.gz added

refresh @ 20846, lightly tested.

comment:14 by Janne Grunau, 16 years ago

Resolution: fixed
Status: acceptedclosed

(In [21448]) adds alsa audio input to analog cards. Fixes #3405

factors the audio device handling code out of NuppelVideoRecorder into a AudioInput class with OSS and new ALSA implementation.

based on patches by: Alan Calvert, Anand K. Mistry and Daniel Kristjansson

comment:15 by Janne Grunau, 16 years ago

(In [21457]) fix windows build after [21448], Refs #3405

comment:16 by Janne Grunau, 16 years ago

(In [21471]) link libmythtv against alsa/oss libs for [21448]. Refs #3405

comment:17 by Janne Grunau, 16 years ago

(In [21526]) fix strerror handling in audioinputoss verbose messages. Refs #3405

Note: See TracTickets for help on using tickets.