Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #53029 > unrolled thread
| Started by | tausciam@gmail.com |
|---|---|
| First post | 2013-08-26 20:42 -0700 |
| Last post | 2013-08-27 17:56 -0700 |
| Articles | 8 — 2 participants |
Back to article view | Back to comp.lang.python
Phonon error: libv4l2: error getting pixformat: Invalid argument tausciam@gmail.com - 2013-08-26 20:42 -0700
Re: Phonon error: libv4l2: error getting pixformat: Invalid argument tausciam@gmail.com - 2013-08-27 04:45 -0700
Re: Phonon error: libv4l2: error getting pixformat: Invalid argument Chris Angelico <rosuav@gmail.com> - 2013-08-28 00:50 +1000
Re: Phonon error: libv4l2: error getting pixformat: Invalid argument tausciam@gmail.com - 2013-08-27 16:17 -0700
Re: Phonon error: libv4l2: error getting pixformat: Invalid argument tausciam@gmail.com - 2013-08-27 16:26 -0700
Re: Phonon error: libv4l2: error getting pixformat: Invalid argument tausciam@gmail.com - 2013-08-27 16:39 -0700
Re: Phonon error: libv4l2: error getting pixformat: Invalid argument tausciam@gmail.com - 2013-08-27 17:42 -0700
Re: Phonon error: libv4l2: error getting pixformat: Invalid argument tausciam@gmail.com - 2013-08-27 17:56 -0700
| From | tausciam@gmail.com |
|---|---|
| Date | 2013-08-26 20:42 -0700 |
| Subject | Phonon error: libv4l2: error getting pixformat: Invalid argument |
| Message-ID | <12e50d6e-d3a6-465e-9d56-3ad3507964f7@googlegroups.com> |
Here is my code. I'm just trying to play an mp3 that I've clicked in a PyQT listwidget:
@pyqtSlot()
def item_clicked(self):
row = self.listWidget.currentRow()
song = musiclist[row]
QCoreApplication.setApplicationName("Phonon")
output = Phonon.AudioOutput(Phonon.MusicCategory)
m_media = Phonon.MediaObject()
Phonon.createPath(m_media, output)
m_media.setCurrentSource(Phonon.MediaSource(song))
m_media.play()
I'm running OpenSUSE Linux 12.3
Any ideas?
[toc] | [next] | [standalone]
| From | tausciam@gmail.com |
|---|---|
| Date | 2013-08-27 04:45 -0700 |
| Message-ID | <b00f7d28-e4dd-425d-ac58-4606ae4e0002@googlegroups.com> |
| In reply to | #53029 |
Looking in /var/log/messages, every time I get that error I get: [41553.128652] xc2028 9-0061: i2c input error: rc = -19 (should be 2) [41553.152537] xc2028 9-0061: i2c input error: rc = -19 (should be 2) [41553.355913] xc2028 9-0061: i2c input error: rc = -19 (should be 2) [41553.379712] xc2028 9-0061: i2c input error: rc = -19 (should be 2) and that's my video capture card! That has nothing to do with playing an mp3
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-08-28 00:50 +1000 |
| Message-ID | <mailman.274.1377615030.19984.python-list@python.org> |
| In reply to | #53029 |
On Tue, Aug 27, 2013 at 1:42 PM, <tausciam@gmail.com> wrote:
> Here is my code. I'm just trying to play an mp3 that I've clicked in a PyQT listwidget:
>
> @pyqtSlot()
> def item_clicked(self):
> row = self.listWidget.currentRow()
> song = musiclist[row]
> QCoreApplication.setApplicationName("Phonon")
> output = Phonon.AudioOutput(Phonon.MusicCategory)
> m_media = Phonon.MediaObject()
> Phonon.createPath(m_media, output)
> m_media.setCurrentSource(Phonon.MediaSource(song))
> m_media.play()
I can't help with Phonon itself, but here's a general comment: When
you have a problem like this, post the full exception traceback. Also,
if you can, try to cut down the example to the point where you can
post all the code, not just one method; if you make it so we can
actually run the script, it's that much more likely we can help you.
But mainly, the exception traceback - it's very helpful.
Help us to help you! :)
ChrisA
[toc] | [prev] | [next] | [standalone]
| From | tausciam@gmail.com |
|---|---|
| Date | 2013-08-27 16:17 -0700 |
| Message-ID | <c8d010bb-e08b-4126-a9da-ff7abcc312e2@googlegroups.com> |
| In reply to | #53071 |
It's not giving me an exception. Here is the code I used:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.phonon import Phonon
import os
import sys, traceback
def lumberjack():
song = '/home/tannhaus/Music/A Perfect Circle/eMOTIVE/02 Imagine.mp3'
QCoreApplication.setApplicationName("Phonon")
output = Phonon.AudioOutput(Phonon.MusicCategory)
m_media = Phonon.MediaObject()
Phonon.createPath(m_media, output)
m_media.setCurrentSource(Phonon.MediaSource(song))
m_media.play()
class MainWindow(QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
try:
lumberjack()
except IndexError:
exc_type, exc_value, exc_traceback = sys.exc_info()
print "*** print_tb:"
traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
print "*** print_exception:"
traceback.print_exception(exc_type, exc_value, exc_traceback,
limit=2, file=sys.stdout)
print "*** print_exc:"
traceback.print_exc()
print "*** format_exc, first and last line:"
formatted_lines = traceback.format_exc().splitlines()
print formatted_lines[0]
print formatted_lines[-1]
print "*** format_exception:"
print repr(traceback.format_exception(exc_type, exc_value,
exc_traceback))
print "*** extract_tb:"
print repr(traceback.extract_tb(exc_traceback))
print "*** format_tb:"
print repr(traceback.format_tb(exc_traceback))
print "*** tb_lineno:", exc_traceback.tb_lineno
if __name__=="__main__":
from sys import argv, exit
a=QApplication(argv)
m=MainWindow()
m.show()
m.raise_()
exit(a.exec_())
When I run it, the complete and only error I get is:
libv4l2: error getting pixformat: Invalid argument
When I check /var/log/messages, I see these messages:
2013-08-27T18:12:04.163062-05:00 tannhaus-PC kernel: [ 1786.397499] xc2028 9-0061: i2c input error: rc = -19 (should be 2)
2013-08-27T18:12:04.187054-05:00 tannhaus-PC kernel: [ 1786.421479] xc2028 9-0061: i2c input error: rc = -19 (should be 2)
2013-08-27T18:12:04.391057-05:00 tannhaus-PC kernel: [ 1786.625614] xc2028 9-0061: i2c input error: rc = -19 (should be 2)
2013-08-27T18:12:04.415052-05:00 tannhaus-PC kernel: [ 1786.649613] xc2028 9-0061: i2c input error: rc = -19 (should be 2)
[toc] | [prev] | [next] | [standalone]
| From | tausciam@gmail.com |
|---|---|
| Date | 2013-08-27 16:26 -0700 |
| Message-ID | <15fbb714-ebe8-4b6b-9a96-202faa5b1dd6@googlegroups.com> |
| In reply to | #53101 |
I unplugged the tv capture card and got no errors at all. It didn't cause it to crash when I had it plugged in. However, it appears that it's not actually playing the mp3. I don't hear it at all. I checked my sound mixer and no channels are muted.
[toc] | [prev] | [next] | [standalone]
| From | tausciam@gmail.com |
|---|---|
| Date | 2013-08-27 16:39 -0700 |
| Message-ID | <99708acd-a544-4dbf-afc1-55bf16a4571b@googlegroups.com> |
| In reply to | #53104 |
But, the PYQT example works: https://github.com/Werkov/PyQt4/blob/master/examples/phonon/musicplayer.py#L1 It's just my code isn't working for some reason. I don't hear anything coming from it
[toc] | [prev] | [next] | [standalone]
| From | tausciam@gmail.com |
|---|---|
| Date | 2013-08-27 17:42 -0700 |
| Message-ID | <527b0398-57ce-49c5-96c9-b3e1efed78cb@googlegroups.com> |
| In reply to | #53105 |
When I pare down the code to the following, I can't hear the mp3 play either:
#!/usr/bin/env python
import sip
sip.setapi('QString', 2)
import sys
from PyQt4 import QtCore, QtGui
from PyQt4.phonon import Phonon
class MainWindow(QtGui.QMainWindow):
def __init__(self):
super(QtGui.QMainWindow, self).__init__()
self.audioOutput = Phonon.AudioOutput(Phonon.MusicCategory, self)
self.mediaObject = Phonon.MediaObject(self)
self.metaInformationResolver = Phonon.MediaObject(self)
Phonon.createPath(self.mediaObject, self.audioOutput)
self.sources = "/home/tannhaus/Music/A Perfect Circle/eMOTIVE/02 Imagine.mp3"
self.metaInformationResolver.setCurrentSource(Phonon.MediaSource(self.sources))
self.mediaObject.play()
if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)
app.setApplicationName("Music Player")
app.setQuitOnLastWindowClosed(True)
window = MainWindow()
window.show()
sys.exit(app.exec_())
[toc] | [prev] | [next] | [standalone]
| From | tausciam@gmail.com |
|---|---|
| Date | 2013-08-27 17:56 -0700 |
| Message-ID | <1c42ff1c-348b-46f0-9d0e-5cfa0fb8d4a6@googlegroups.com> |
| In reply to | #53106 |
I've played around with it and got code that plays mp3s now. I'm not sure what I was doing wrong.... or why it plays now...but it does, so I'm going to use it:
#!/usr/bin/env python
import sip
sip.setapi('QString', 2)
import sys
from PyQt4 import QtCore, QtGui
from PyQt4.phonon import Phonon
class MainWindow(QtGui.QMainWindow):
def __init__(self):
super(QtGui.QMainWindow, self).__init__()
self.sources = "/home/tannhaus/Music/A Perfect Circle/eMOTIVE/02 Imagine.mp3"
self.mediaObject = Phonon.createPlayer(Phonon.MusicCategory)
self.audioOutput = Phonon.AudioOutput(Phonon.MusicCategory, self)
Phonon.createPath(self.mediaObject, self.audioOutput)
self.mediaObject.setCurrentSource(Phonon.MediaSource(self.sources))
self.mediaObject.play()
if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)
app.setApplicationName("Music Player")
app.setQuitOnLastWindowClosed(True)
window = MainWindow()
window.show()
sys.exit(app.exec_())
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web