Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Sep 2003 02:06:28 +0300 (EEST)
From:      Vladimir Kushnir <vkushnir@Alfacom.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/57198: multimedia/xmms fix to work with CDDA under -CURRENT
Message-ID:  <200309242306.h8ON6SSO052556@kushnir1.kiev.ua>
Resent-Message-ID: <200309242310.h8ONAMtN078164@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         57198
>Category:       ports
>Synopsis:       multimedia/xmms fix to work with CDDA under -CURRENT
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 24 16:10:21 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Vladimir Kushnir
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD kushnir1.kiev.ua 5.1-CURRENT FreeBSD 5.1-CURRENT #11: Tue Sep 23 12:56:27 EEST 2003 root@kushnir1.kiev.ua:/usr/obj/usr/src/sys/KUSHNIR i386


	
>Description:
	Under FreeBSD-CURRENT, several ports including multimedua/xmms would 
	not work with CDDA because of CDIOCREADAUDIO ioctl removal from 
	ATA/ATAPI driver.
>How-To-Repeat:
	Try to listen CD with XMMS choosing "Digital audio extraction" option
	in CD Audio Player plugin configuration. No sound.
>Fix:

	

--- patch-Input::cdaudio::cdaudio.c begins here ---
*** Input/cdaudio/cdaudio.c.orig	Mon Jul 14 01:20:30 2003
--- Input/cdaudio/cdaudio.c	Thu Sep 25 01:55:47 2003
***************
*** 19,24 ****
--- 19,25 ----
   */
  
  #include "cdaudio.h"
+ #include <sys/cdrio.h>
  #include <pthread.h>
  #include <errno.h>
  #include "xmms/i18n.h"
***************
*** 57,63 ****
  #ifndef CDDA_DEVICE
  # ifdef HAVE_SYS_CDIO_H
  #  ifdef __FreeBSD__
! #   define CDDA_DEVICE "/dev/acd0c"
  #  elif defined __OpenBSD__
  #   define CDDA_DEVICE "/dev/cd0c"
  #  else
--- 58,64 ----
  #ifndef CDDA_DEVICE
  # ifdef HAVE_SYS_CDIO_H
  #  ifdef __FreeBSD__
! #   define CDDA_DEVICE "/dev/acd0"
  #  elif defined __OpenBSD__
  #   define CDDA_DEVICE "/dev/cd0c"
  #  else
***************
*** 860,885 ****
  }
  
  
- #if defined(CDIOCREADAUDIO)
  #ifdef __FreeBSD__
  int read_audio_data(int fd, int pos, int num, void *buf)
  {
! 	struct ioc_read_audio cdra;
  
! 	cdra.address.lba = pos - CDDA_MSF_OFFSET;
! 	cdra.address_format = CD_LBA_FORMAT;
! 	cdra.nframes = num;
! 	cdra.buffer = buf;
! 
! 	if (ioctl(fd, CDIOCREADAUDIO, &cdra) < 0)
! 		return -errno;
! 
! 	return cdra.nframes;
  }
- #else
- #error Please test on other <sys/cdio.h> platforms.
  #endif
- #endif /* CDIOCREADAUDIO */
  
  #ifdef XMMS_CDROM_BSD_NETBSD /* NetBSD, OpenBSD */
  
--- 861,876 ----
  }
  
  
  #ifdef __FreeBSD__
  int read_audio_data(int fd, int pos, int num, void *buf)
  {
! 	int bsize = 2352;
  
! 	if (ioctl(fd, CDRIOCSETBLOCKSIZE, &bsize) == -1) return -errno;
! 	if (pread(fd, buf, num*bsize, (pos - 150)*bsize) != num*bsize) return 0;
! 	return num;	 	
  }
  #endif
  
  #ifdef XMMS_CDROM_BSD_NETBSD /* NetBSD, OpenBSD */
  
--- patch-Input::cdaudio::cdaudio.c ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309242306.h8ON6SSO052556>